I have a Django project uploaded in GitHub and I need to link it with jenkins. I installed Jenkins and Docker services on Ubuntu 20.04 machine.
I configured the Jenkins server with my repo and I installed all the suggestd plggins + docker pipeline plugin.
after that, I created a Jenkinsfile that uses docker agent to run the stages inside a python docker container but I'm getting "‘Jenkins’ doesn’t have label ‘docker’" in the console output. I tried to add the label docker in the project settings but still the same error appears!
This is my Jenkinsfile:
pipeline {
agent any
stages {
stage("install pip dependencies") {
agent {
docker {
label "docker"
image "python:3.7"
}
}
steps {
withEnv(["HOME=${env.WORKSPACE}"]) {
sh "pip install virtualenv"
sh "virtualenv venv"
sh "pip install -r requirements.txt "
}
}
}
}}
What am I missing?
Thank you!