amarillo-core/Jenkinsfile
Csaba e8d484d588
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
#13 Fixed package registry url
2024-01-09 14:30:48 +01:00

51 lines
1.7 KiB
Groovy

pipeline {
agent any
environment {
GITEA_CREDS = credentials('AMARILLO-JENKINS-GITEA-USER')
TWINE_REPO_URL = "git.gerhardt.io/api/packages/amarillo/pypi"
REGISTRY_URL = 'https://git.gerhardt.io'
OWNER = 'amarillo'
IMAGE_NAME = 'amarillo'
TAG = 'latest'
PLUGINS = 'amarillo-metrics amarillo-enhancer'
}
stages {
stage('Build docker image') {
steps {
echo 'Building image'
script {
docker.build("${OWNER}/${IMAGE_NAME}:${TAG}",
"--build-arg='PACKAGE_REGISTRY_URL=${TWINE_REPO_URL}' --build-arg='PLUGINS=${PLUGINS}' --secret id=AMARILLO_REGISTRY_CREDENTIALS,env=GITEA_CREDS .")
}
}
}
stage('Push image to container registry') {
steps {
echo 'Pushing image to registry'
script {
docker.withRegistry(REGISTRY_URL, 'AMARILLO-JENKINS-GITEA-USER'){
docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").push()
}
}
}
}
}
post {
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
}
failure {
echo 'This will run only if failed'
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
changed {
echo 'This will run only if the state of the Pipeline has changed'
echo 'For example, if the Pipeline was previously failing but is now successful'
}
}
}