eficode-academy / jenkins-katas Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Find a better way to find the IP address of the host inside docker
We have to add to exercise 1 or 2, that students should go and enable periodic scan of repository in the "old" Jenkins UI. If not, their commits will not automatically trigger a build.
Either add it as an optional to the exercise, or add a slide and show it to the students.
Confusing wording: PR based workflow exercise.
Running docker-compose up -d
in Google Cloud Shell leads to the following error:
michael_ingeman_nielsen@cloudshell:~/jenkins-katas/setup$ docker-compose up -d
Creating network "setup_default" with the default driver
Creating volume "setup_jenkins_home" with default driver
Pulling jenkins (praqma/jenkins-kata-jenkins:latest)...
latest: Pulling from praqma/jenkins-kata-jenkins
3192219afd04: Pulling fs layer
17c160265e75: Pulling fs layer
...
Status: Downloaded newer image for praqma/jenkins-kata-jenkins:latest
Building swarm_agent
ERROR: gcloud failed to load: /tmp/_MEITOPJ2m/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu.so)
...
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-gcloud exited with "".',)
[15137] Failed to execute script docker-compose
michael_ingeman_nielsen@cloudshell:~/jenkins-katas/setup$
There are existing issues on this here and here. A workaround is described in the issue: Running export LD_LIBRARY_PATH=/usr/local/lib
in the Cloud Shell before building works for me, but really shouldn't be necessary.
Working:
pipeline {
agent any
stages {
stage('Parallel execution') {
parallel {
stage('build app') {
steps {
sh 'echo hello world'
}
}
stage('build app2') {
steps {
sh 'echo hello world'
}
}
stage('build app3') {
steps {
sh 'echo hello world'
}
}
stage('build app4') {
steps {
sh 'echo hello world'
}
}
stage('build app5') {
steps {
sh 'echo hello world'
}
}
stage('build app6') {
steps {
sh 'echo hello world'
}
}
}
}
}
}
Not working:
pipeline {
agent any
stages {
stage('Parallel execution') {
parallel {
stage('build app') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
stage('build app2') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
stage('build app3') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
stage('build app4') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
stage('build app5') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
stage('build app6') {
agent {
docker {
image 'debian'
}
}
steps {
sh 'echo hello world'
}
}
}
}
}
}
Reason is some kind of sketchy docker in docker part :(
In the create agents
While teaching Jenkins using this kata, multiple students confronted an issue where agents defined as docker containers would not execute.
The problem was persistent throughout different OS's and environments: some were running Vagrant (VirtualBox) on Windows, some Docker Desktop on Windows or macOS.
I personally could not reproduce the problem. My environment was running Jenkins on Docker Desktop (Windows) and everything worked as expected.
Only consistent messages that showed in the logs every time the problem occurred was
...
Jenkins does not seem to be running inside a container - -
...
while everywhere where things worked, the corresponding log-entry was
[Pipeline] sh
+ docker inspect -f . gradle:6-jdk11
.
[Pipeline] withDockerContainer
Jenkins seems to be running inside container 7886fea1c6ff2c3c59dba72500f73d00693fc64e06b600635c16c5ec8d76e2f2
$ docker run -t -d -u 0:0 -w /var/jenkins_home/workspace/jenkins-katas_master@2 --volumes-from 7886fea1c6ff2c3c59dba72500f73d00693fc64e06b600635c16c5ec8d76e2f2 -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** gradle:6-jdk11 cat
$ docker top 58d0ce76181245e4e5a72a3f93718ce18da85a00a159d4ea3d5b78ede3012854 -eo pid,comm
I've tried running the katas on a Jenkins instance installed using apt. There are a few prerequisites that might be worth mentioning in setup-on-your-own.md.
Image in host shows different key host verification than what you should do
Test reporting:
https://github.com/eficode-academy/jenkins-katas/blob/master/labs/02-editing-your-pipeline.md#test-reporting
Add an image of how the build stages works
Clean up is the last post step that will be executed, and therefore we should move our "deletedir" to that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.