68 lines
2.0 KiB
Groovy
68 lines
2.0 KiB
Groovy
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
yamlFile 'ci/podTemplate.yaml'
|
|
yamlMergeStrategy merge()
|
|
defaultContainer 'buildah'
|
|
}
|
|
}
|
|
|
|
stages {
|
|
stage('Prepare') {
|
|
steps {
|
|
container('jnlp') {
|
|
// TODO checkout lib/ branch based on $BRANCH_NAME
|
|
sh 'git fetch origin lib/main:lib/main'
|
|
sh 'git worktree add lib lib/main'
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
steps {
|
|
sh 'sh -e build.sh --base git.pyrocufflink.net/aimeeos/build/base'
|
|
}
|
|
}
|
|
|
|
stage('Push') {
|
|
steps {
|
|
withEnv([
|
|
"REGISTRY_AUTH_FILE=${env.WORKSPACE_TMP}/auth.json"
|
|
]) {
|
|
withCredentials([usernamePassword(
|
|
credentialsId: 'jenkins-packages',
|
|
usernameVariable: 'BUILDAH_USERNAME',
|
|
passwordVariable: 'BUILDAH_PASSWORD',
|
|
)]) {
|
|
sh """
|
|
buildah login \
|
|
--username \${BUILDAH_USERNAME} \
|
|
--password \${BUILDAH_PASSWORD} \
|
|
git.pyrocufflink.net
|
|
"""
|
|
}
|
|
sh 'buildah push aimee-os.org/build/cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu'
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
success {
|
|
build([
|
|
job: "${BRANCH_NAME.replace('cross/', 'rust-cross%2F')}",
|
|
wait: false,
|
|
])
|
|
}
|
|
|
|
failure {
|
|
sh 'unshare -Ur --map-auto chown root:root -R tmp log'
|
|
dir('tmp/portage') {
|
|
archiveArtifacts '*/*/temp/*.log'
|
|
}
|
|
archiveArtifacts 'log/**/*'
|
|
}
|
|
}
|
|
}
|