ci: refs #7643 Reprepro debug
gitea/hedera-web/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Juan Ferrer 2024-07-09 16:55:20 +02:00
parent bdf7a16003
commit ddaff6afe9
1 changed files with 12 additions and 13 deletions

25
Jenkinsfile vendored
View File

@ -5,7 +5,7 @@ def BRANCH_ENV = [
master: 'production' master: 'production'
] ]
def remote = [:] def remote = [:]
def debFile def changesFile
node { node {
stage('Setup') { stage('Setup') {
@ -38,8 +38,8 @@ pipeline {
steps { steps {
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 ../*.changes output'
sleep 3600 sleep 86400
stash includes: 'output/*', name: 'debuildOutput' stash includes: 'output/*', name: 'debuildOutput'
} }
@ -52,14 +52,13 @@ pipeline {
} }
} }
environment { environment {
REPREPRO_DIR = '/var/lib/reprepro' REPREPRO_BASE_DIR = '/var/lib/reprepro/repo'
REPO_DIR = "$REPREPRO_DIR/repo"
} }
steps { steps {
unstash 'debuildOutput' unstash 'debuildOutput'
script { script {
def files = findFiles(glob: 'output/*.deb') def files = findFiles(glob: 'output/*.changes')
files.each { file -> debFile = file.name } files.each { file -> changesFile = file.name }
} }
withCredentials([sshUserPrivateKey( withCredentials([sshUserPrivateKey(
@ -76,12 +75,12 @@ pipeline {
} }
sshPut([ sshPut([
remote: remote, remote: remote,
from: "output/$debFile", from: "output/$changesFile",
into: "$REPO_DIR/incoming" into: "$REPREPRO_BASE_DIR/incoming"
]) ])
sshCommand([ sshCommand([
remote: remote, remote: remote,
command: "reprepro -b $REPO_DIR --gnupghome $REPREPRO_DIR/.gnupg includedeb bookworm $REPO_DIR/incoming/$debFile" command: "reprepro processincoming default $changesFile"
]) ])
} }
} }
@ -105,11 +104,11 @@ pipeline {
} }
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
sh "docker tag $IMAGE:$TAG $IMAGE:latest" sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
sh "docker push $IMAGE:$TAG" sh 'docker push $IMAGE:$TAG'
sh "docker push $IMAGE:latest" sh 'docker push $IMAGE:latest'
withKubeConfig([ withKubeConfig([
serverUrl: "$KUBERNETES_API", serverUrl: "$KUBERNETES_API",