pipeline {
agent { docker { image 'maven:3.6.0-jdk-8-alpine' } }
stages {
stage('Build') {
steps {
sh "apk add git"
git 'https://github.com/eea/geonetwork-eea.git'
sh 'mvn clean install -U -DskipTests'
sh 'cd web'
sh "mvn clean install -U -DskipTests -Des.host=elasticsearch -Dkb.url=http://kibana:5601;"
}
}
}
}
[ERROR] Failed to execute goal on project cachingxslt: Could not resolve dependencies for project org.geonetwork-opensource:cachingxslt:jar:2.9.0-SNAPSHOT: Failed to collect dependencies at net.sf.saxon:saxon:jar:9.1.0.8b-patch: Failed to read artifact descriptor for net.sf.saxon:saxon:jar:9.1.0.8b-patch: Could not transfer artifact net.sf.saxon:saxon:pom:9.1.0.8b-patch from/to k-int (http://developer.k-int.com/maven2/): Connect to developer.k-int.com:80 [developer.k-int.com/62.31.135.44] failed: Connection refused (Connection refused) -> [Help 1]
jenkinsci/blueocean
Docker images are deprecated. They were used in the past for tutorials on jenkins.io. Those tutorial references were replaced by references to the jenkins/jenkins
docker containers in October 2020. Switch the FROM
argument and assure that you install the plugins you need for your installation.
/run/secretes
(ref. https://github.com/dduportal/jenkins-examples/blob/8f0bc983389038d90a2b61bed571105069e5c162/docker/docker-compose.yml#L8-L9docker-compose run jenkins ls -l /var/jenkins/home
to confirm. Also this channel is for creating the jenkins packaging, not for jenkins help, I would recommend going to jenkinsci/jenkins room
Hi team.. I'm working with a project that uses espressif and to build it on my machine with docker way I do the following:
docker run --rm -v $PWD:/project -w /project espressif/idf:v4.2.2 idf.py build
(note that, first of all I make a cd to the project directory and then the PWD environment variable passes the correct path for mounting the volume)
I would like to elaborate a declarative pipeline, and I would like to execute the command equivalent to the one above. The way I implemented it based on other examples that worked, and the log result below.
I don't understand why the way to pass these 'idf.py build' arguments in the 'steps' block is not working. Does anyone have any ideas?
My pipeline:
pipeline {
agent any
environment {
PROJ_NAME = 'test'
}
stages {
stage('Checkout') {
steps {
git url: 'ssh://git@bitbucket.org/joaogbc/iot-project.git'
}
}
stage('Build') {
agent {
docker {
image 'espressif/idf:v4.2.2'
args '--rm -v $PWD:/project -w /project'
reuseNode true
}
}
steps{
sh 'idf.py build'
}
}
}
}
Error snippet:
[Pipeline] withDockerContainer
Jenkins does not seem to be running inside a container
$ docker run -t -d -u 1000:1000 --rm -v $PWD:/project -w /project -w /var/lib/jenkins/workspace/iot-project-TEST -v /var/lib/jenkins/workspace/iot-project-TEST:/var/lib/jenkins/workspace/iot-project-TEST:rw,z -v /var/lib/jenkins/workspace/iot-project-TEST@tmp:/var/lib/jenkins/workspace/iot-project-TEST@tmp:rw,z -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 ******** espressif/idf:v4.2.2 cat
$ docker top 81920a1146eabe9bf5c08339a682d81ac23777de0421895e1184d2a8ef27fc8c -eo pid,comm
ERROR: The container started but didn't run the expected command. Please double check your ENTRYPOINT does execute the command passed as docker run argument, as required by official docker images (see https://github.com/docker-library/official-images#consistency for entrypoint consistency requirements).
Alternatively you can force image entrypoint to be disabled by adding option `--entrypoint=''`.
[Pipeline] {
[Pipeline] sh
+ idf.py build
/var/lib/jenkins/workspace/iot-project-TEST@tmp/durable-b8bf6ce0/script.sh: 1: /var/lib/jenkins/workspace/iot-project-TEST@tmp/durable-b8bf6ce0/script.sh: idf.py: not found
[Pipeline] }
$ docker stop --time=1 81920a1146eabe9bf5c08339a682d81ac23777de0421895e1184d2a8ef27fc8c
$ docker rm -f 81920a1146eabe9bf5c08339a682d81ac23777de0421895e1184d2a8ef27fc8c
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE
stage('Build') {
agent {
docker {
image 'tool/stm32-cubeide-image:1.0'
reuseNode true
}
}
steps {
sh '/opt/stm32cubeide/headless-build.sh -importAll $WORKSPACE -data $WORKSPACE -cleanBuild $DIR/$OPT_BUILD'
}
}
jenkins-plugin-cli
which fails the plugin installation?
install-plugins.sh
(which was using the versionLT()
bash function as far as I remember) ?
have it all automated
Use https://www.jenkins.io/projects/jcasc/ with job-dsl-plugin: https://github.com/jenkinsci/job-dsl-plugin/blob/master/docs/JCasC.md :)
have it all automated
Use https://www.jenkins.io/projects/jcasc/ with job-dsl-plugin: https://github.com/jenkinsci/job-dsl-plugin/blob/master/docs/JCasC.md :)
Well... that's just super-interesting and super-helpful - thanks a whole bunch :)