jenkins
This commit is contained in:
parent
aaa29e02c0
commit
93c3809f85
@ -5,28 +5,50 @@ pipeline {
|
||||
DOCKER_IMAGE = 'yoga-cms'
|
||||
DOCKER_REGISTRY = 'your-docker-registry'
|
||||
DOCKER_CREDENTIALS_ID = 'your-docker-credentials-id'
|
||||
CURRENT_VERSION = ''
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
// checkout([$class: 'GitSCM', branches: [[name: '*/main']], userRemoteConfigs: [[url: 'https://gitea.rschneider.hu/rschneider/yogastic.git', credentialsId: 'rschneider_gitea.rschneider.hu']]])
|
||||
git branch: 'main', credentialsId: 'rschneider_gitea.rschneider.hu', poll: false, url: 'https://gitea.rschneider.hu/rschneider/yogastic.git'
|
||||
git branch: 'main', credentialsId: 'rschneider_gitea.rschneider.hu', poll: false, url: 'https://gitea.rschneider.hu/rschneider/yogastic.git'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage('Build Docker image') {
|
||||
steps {
|
||||
sh """
|
||||
cd environment/dev/docker/cms/scripts
|
||||
ls -lah
|
||||
pwd
|
||||
bash ./build.docker.build.sh
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
stage('Commit & Push version image') {
|
||||
steps {
|
||||
CURRENT_VERSION = readFile('environment/dev/docker/cms/scripts/version.txt').trim()
|
||||
env.CURRENT_VERSION = CURRENT_VERSION
|
||||
sh """
|
||||
cd environment/dev/docker/cms/scripts
|
||||
git config user.email "jenkins@rschneider.hu"
|
||||
git config user.name "Jenkins"
|
||||
git add version.txt
|
||||
git commit -m "[ci-skip] Update version to ${CURRENT_VERSION}"
|
||||
git push
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push Docker image') {
|
||||
steps {
|
||||
sh """
|
||||
cd environment/dev/docker/cms/scripts
|
||||
bash ./build.docker.push.sh
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user