Compare commits

...

5 commits

Author SHA1 Message Date
Csaba dc482f70dd #13 push image with both tags
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
2024-01-18 13:46:38 +01:00
Csaba c8b8aa8b36 Fixed stage steps
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good
2024-01-18 13:37:48 +01:00
Csaba 984996dbb4 Echo some environment variables for testing
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
2024-01-18 13:36:50 +01:00
Csaba fddb0093bb #13 Test build with multiple tags 2024-01-18 13:33:03 +01:00
Csaba 3f263f87f1 #13 Test build with multiple tags
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
2024-01-18 13:29:15 +01:00

18
Jenkinsfile vendored
View file

@ -7,18 +7,28 @@ pipeline {
DOCKER_REGISTRY_URL = 'https://git.gerhardt.io' DOCKER_REGISTRY_URL = 'https://git.gerhardt.io'
OWNER = 'amarillo' OWNER = 'amarillo'
IMAGE_NAME = 'amarillo' IMAGE_NAME = 'amarillo'
TAG = 'latest' AMARILLO_DISTRIBUTION = '0.1'
TAG = "${AMARILLO_DISTRIBUTION}.${BUILD_NUMBER}"
PLUGINS = 'amarillo-metrics amarillo-enhancer' PLUGINS = 'amarillo-metrics amarillo-enhancer'
DEPLOY_WEBHOOK_URL = 'http://amarillo.mfdz.de:8888/mitanand' DEPLOY_WEBHOOK_URL = 'http://amarillo.mfdz.de:8888/mitanand'
DEPLOY_SECRET = credentials('AMARILLO-JENKINS-DEPLOY-SECRET') DEPLOY_SECRET = credentials('AMARILLO-JENKINS-DEPLOY-SECRET')
} }
stages { stages {
stage('Echo environment variables'){
steps {
echo "BRANCH_NAME: ${BRANCH_NAME}"
echo "JOB_NAME: ${JOB_NAME}"
echo "BRANCH_IS_PRIMARY ${BRANCH_IS_PRIMARY}"
echo "TAG_NAME: ${TAG_NAME}"
}
}
stage('Build docker image') { stage('Build docker image') {
steps { steps {
echo 'Building image' echo 'Building image'
script { script {
docker.build("${OWNER}/${IMAGE_NAME}:${TAG}", docker.build("${OWNER}/${IMAGE_NAME}:${TAG}",
"--build-arg='PACKAGE_REGISTRY_URL=${PLUGINS_REPO_URL}' --build-arg='PLUGINS=${PLUGINS}' --secret id=AMARILLO_REGISTRY_CREDENTIALS,env=GITEA_CREDS .") //--no-cache to make sure plugins are updated
"-t ${OWNER}/${IMAGE_NAME}:latest --no-cache --build-arg='PACKAGE_REGISTRY_URL=${PLUGINS_REPO_URL}' --build-arg='PLUGINS=${PLUGINS}' --secret id=AMARILLO_REGISTRY_CREDENTIALS,env=GITEA_CREDS .")
} }
} }
} }
@ -43,7 +53,9 @@ pipeline {
echo 'Pushing image to registry' echo 'Pushing image to registry'
script { script {
docker.withRegistry(DOCKER_REGISTRY_URL, 'AMARILLO-JENKINS-GITEA-USER'){ docker.withRegistry(DOCKER_REGISTRY_URL, 'AMARILLO-JENKINS-GITEA-USER'){
docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").push() def image = docker.image("${OWNER}/${IMAGE_NAME}:${TAG}")
image.push()
image.push('latest')
} }
} }
} }