You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
pipeline { |
|
agent any |
|
|
|
environment { |
|
DOCKERHUB_REPO = 'jacqueskingram/python-jenkins-project' |
|
GITEA_REPO = 'http://code.jacquesingram.online:3000/lenape/python-jenkins-project.git' |
|
} |
|
|
|
stages { |
|
stage('Build Docker Image') { |
|
steps { |
|
script { |
|
def imageName = "${env.DOCKERHUB_REPO}:${BUILD_NUMBER}" |
|
docker.build(imageName, '.') |
|
env.IMAGE_NAME = imageName |
|
} |
|
} |
|
} |
|
stage('Push to Gitea') { |
|
steps { |
|
git credentialsId: 'my-gitea-credentials', url: "${env.GITEA_REPO}" |
|
sh 'git push origin master' |
|
} |
|
} |
|
stage('Push to Docker Hub') { |
|
steps { |
|
script { |
|
docker.withRegistry('https://index.docker.io/v1/', 'my-dockerhub-credentials') { |
|
docker.image(env.IMAGE_NAME).push() |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|