60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
pipeline {
|
|
agent any
|
|
|
|
environment {
|
|
DOCKER_IMAGE = 'yoga-cms'
|
|
DOCKER_REGISTRY = 'your-docker-registry'
|
|
DOCKER_CREDENTIALS_ID = 'your-docker-credentials-id'
|
|
CURRENT_VERSION = ''
|
|
}
|
|
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
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
|
|
bash ./build.docker.build.sh
|
|
"""
|
|
}
|
|
}
|
|
|
|
stage('Commit & Push version image') {
|
|
steps {
|
|
script {
|
|
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 {
|
|
cleanWs()
|
|
}
|
|
}
|
|
} |