diff --git a/Jenkinsfile b/Jenkinsfile index a74e7fdc..75de98cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { sh 'debuild -us -uc -b' sh 'mkdir -p output' sh 'mv ../*.deb ../*.build ../*.buildinfo ../*.changes output' - sleep 600 + sleep 1800 stash includes: 'output/*', name: 'debuildOutput' } @@ -95,6 +95,7 @@ pipeline { } environment { CREDS = credentials('docker-registry') + IMAGE = "$REGISTRY/verdnatura/hedera-web" } steps { script { @@ -103,17 +104,20 @@ pipeline { env.TAG = "${packageJson.version}-build${env.BUILD_ID}" } - sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' - sh 'docker-compose push' + sh "docker tag $IMAGE:$TAG $IMAGE:latest" + + sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' + sh "docker push $IMAGE:$TAG" + sh "docker push $IMAGE:latest" withKubeConfig([ serverUrl: "$KUBERNETES_API", credentialsId: 'kubernetes', namespace: 'salix' ]) { - sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$REGISTRY/hedera-web:$TAG' - sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$REGISTRY/hedera-web:$TAG' + sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$IMAGE:$TAG' + sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$IMAGE:$TAG' } } } diff --git a/docker-compose.yml b/docker-compose.yml index 0a1a862d..ff930121 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,9 @@ version: '3.7' services: main: - image: registry.verdnatura.es/hedera-web:${VERSION:?} + image: registry.verdnatura.es/verdnatura/hedera-web:${TAG:?} build: context: . dockerfile: Dockerfile args: - VERSION=${VERSION:?} - cron: - image: registry.verdnatura.es/hedera-web:${VERSION:?} - command: 'cron -f'