Files
Mateusz Pstrucha edd1316912
Gitea/mtps/gentlemans/pipeline/head Something is wrong with the build of this commit
must specify $class
2024-03-13 20:49:37 +01:00

51 lines
1.5 KiB
Groovy

def domain = 'malwina-barber.pl'
pipeline {
agent any
stages {
stage('Build frontend') {
steps {
sh 'docker compose build frontend'
}
}
stage('Build api') {
steps {
sh 'docker compose build api'
}
}
stage('Push') {
steps {
withCredentials([
usernamePassword(
credentialsId: 'gitea-packages',
passwordVariable: 'PASS',
usernameVariable: 'UNAME'
)])
{
sh 'docker login -u $UNAME -p $PASS git.app.ygg'
}
sh 'docker compose push frontend'
sh 'docker save -o frontend.tar $(docker compose config frontend | grep image | awk "{print \\$2}")'
sh 'docker compose push api'
sh 'docker save -o api.tar $(docker compose config api | grep image | awk "{print \\$2}")'
}
}
stage('Deploy') {
steps {
archiveArtifacts artifacts: 'frontend.tar, api.tar, docker-compose.yml', fingerprint: true
build job: 'ansible/deploy/container', parameters: [
[$class: 'StringParameterValue', name: 'domain', value: domain],
[$class: 'StringParameterValue', name: 'cert', value: 'malwina-barber.pl']
]
}
}
}
}