Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] docker improvements #1101

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pipeline {

move "_packages\\*.zip" "soh.zip"
"""
archiveArtifacts artifacts: 'soh.zip', followSymlinks: false, onlyIfSuccessful: true
}
archiveArtifacts artifacts: 'soh.zip', followSymlinks: false, onlyIfSuccessful: true
}
post {
always {
Expand All @@ -91,6 +91,7 @@ pipeline {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
unstash 'assets'
sh '''
if docker ps -aq --filter "name=sohcont" | grep -q .; then docker rm -f sohcont; fi
docker build . -t soh
docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
docker exec sohcont scripts/linux/appimage/build.sh
Expand All @@ -102,11 +103,12 @@ pipeline {

'''
}
sh 'sudo docker container stop sohcont'
archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true
}
post {
always {
sh 'sudo docker container stop sohcont'
sh 'docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi' // Clean dangling docker images
step([$class: 'WsCleanup']) // Clean workspace
}
}
Expand Down Expand Up @@ -159,9 +161,10 @@ pipeline {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
unstash 'assets'
sh '''
if docker ps -aq --filter "name=sohswitchcont" | grep -q .; then docker rm -f sohswitchcont; fi
docker build . -t sohswitch
docker run --name sohcont -dit --rm -v $(pwd):/soh sohswitch /bin/bash
docker exec sohcont scripts/switch/build.sh
docker run --name sohswitchcont -dit --rm -v $(pwd):/soh sohswitch /bin/bash
docker exec sohswitchcont scripts/switch/build.sh

mv build-switch/soh/*.nro soh.nro
mv README.md readme.txt
Expand All @@ -170,11 +173,12 @@ pipeline {

'''
}
sh 'sudo docker container stop sohcont'
archiveArtifacts artifacts: 'soh-switch.7z', followSymlinks: false, onlyIfSuccessful: true
}
post {
always {
sh 'sudo docker container stop sohswitchcont'
sh 'docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi' // Clean dangling docker images
step([$class: 'WsCleanup']) // Clean workspace
}
}
Expand Down