ci: refs #7643 Reprepro debug & docker deploy improve
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-07-09 12:16:31 +02:00
parent 7ff9e2e97d
commit 3db9314dfd
2 changed files with 10 additions and 9 deletions

14
Jenkinsfile vendored
View File

@ -39,7 +39,7 @@ pipeline {
sh 'debuild -us -uc -b' sh 'debuild -us -uc -b'
sh 'mkdir -p output' sh 'mkdir -p output'
sh 'mv ../*.deb ../*.build ../*.buildinfo ../*.changes output' sh 'mv ../*.deb ../*.build ../*.buildinfo ../*.changes output'
sleep 600 sleep 1800
stash includes: 'output/*', name: 'debuildOutput' stash includes: 'output/*', name: 'debuildOutput'
} }
@ -95,6 +95,7 @@ pipeline {
} }
environment { environment {
CREDS = credentials('docker-registry') CREDS = credentials('docker-registry')
IMAGE = "$REGISTRY/verdnatura/hedera-web"
} }
steps { steps {
script { script {
@ -103,17 +104,20 @@ pipeline {
env.TAG = "${packageJson.version}-build${env.BUILD_ID}" 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 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([ withKubeConfig([
serverUrl: "$KUBERNETES_API", serverUrl: "$KUBERNETES_API",
credentialsId: 'kubernetes', credentialsId: 'kubernetes',
namespace: 'salix' 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-$BRANCH_NAME hedera-web-$BRANCH_NAME=$IMAGE:$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-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$IMAGE:$TAG'
} }
} }
} }

View File

@ -1,12 +1,9 @@
version: '3.7' version: '3.7'
services: services:
main: main:
image: registry.verdnatura.es/hedera-web:${VERSION:?} image: registry.verdnatura.es/verdnatura/hedera-web:${TAG:?}
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
- VERSION=${VERSION:?} - VERSION=${VERSION:?}
cron:
image: registry.verdnatura.es/hedera-web:${VERSION:?}
command: 'cron -f'