mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 17:32:19 -05:00
[ci] docker improvements (#1101)
This commit is contained in:
parent
c803ff65ce
commit
5453c68399
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@ -67,8 +67,8 @@ pipeline {
|
|||||||
|
|
||||||
move "_packages\\*.zip" "soh.zip"
|
move "_packages\\*.zip" "soh.zip"
|
||||||
"""
|
"""
|
||||||
archiveArtifacts artifacts: 'soh.zip', followSymlinks: false, onlyIfSuccessful: true
|
|
||||||
}
|
}
|
||||||
|
archiveArtifacts artifacts: 'soh.zip', followSymlinks: false, onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
@ -91,6 +91,7 @@ pipeline {
|
|||||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||||
unstash 'assets'
|
unstash 'assets'
|
||||||
sh '''
|
sh '''
|
||||||
|
if docker ps -aq --filter "name=sohcont" | grep -q .; then docker rm -f sohcont; fi
|
||||||
docker build . -t soh
|
docker build . -t soh
|
||||||
docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
|
docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
|
||||||
docker exec sohcont scripts/linux/appimage/build.sh
|
docker exec sohcont scripts/linux/appimage/build.sh
|
||||||
@ -102,11 +103,12 @@ pipeline {
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
sh 'sudo docker container stop sohcont'
|
|
||||||
archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true
|
archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
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
|
step([$class: 'WsCleanup']) // Clean workspace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,9 +161,10 @@ pipeline {
|
|||||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||||
unstash 'assets'
|
unstash 'assets'
|
||||||
sh '''
|
sh '''
|
||||||
|
if docker ps -aq --filter "name=sohswitchcont" | grep -q .; then docker rm -f sohswitchcont; fi
|
||||||
docker build . -t sohswitch
|
docker build . -t sohswitch
|
||||||
docker run --name sohcont -dit --rm -v $(pwd):/soh sohswitch /bin/bash
|
docker run --name sohswitchcont -dit --rm -v $(pwd):/soh sohswitch /bin/bash
|
||||||
docker exec sohcont scripts/switch/build.sh
|
docker exec sohswitchcont scripts/switch/build.sh
|
||||||
|
|
||||||
mv build-switch/soh/*.nro soh.nro
|
mv build-switch/soh/*.nro soh.nro
|
||||||
mv README.md readme.txt
|
mv README.md readme.txt
|
||||||
@ -170,11 +173,12 @@ pipeline {
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
sh 'sudo docker container stop sohcont'
|
|
||||||
archiveArtifacts artifacts: 'soh-switch.7z', followSymlinks: false, onlyIfSuccessful: true
|
archiveArtifacts artifacts: 'soh-switch.7z', followSymlinks: false, onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
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
|
step([$class: 'WsCleanup']) // Clean workspace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user