Reviewed-on: #5 Co-authored-by: Thumbscrew <thumbscrw@pm.me> Co-committed-by: Thumbscrew <thumbscrw@pm.me>
37 lines
958 B
Groovy
37 lines
958 B
Groovy
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
inheritFrom 'buildah'
|
|
}
|
|
}
|
|
options {
|
|
timeout(time: 30, unit: 'MINUTES')
|
|
}
|
|
stages {
|
|
stage('Build') {
|
|
environment {
|
|
GITEA_PACKAGE_REGISTRY = credentials('gitea-package-registry')
|
|
}
|
|
steps {
|
|
container('buildah') {
|
|
sh('buildah --storage-driver=overlay build --build-arg NEXTCLOUD_TAG=${TAG_NAME:-stable} -t $GITEA_PACKAGE_REGISTRY:${TAG_NAME:-stable} .')
|
|
}
|
|
}
|
|
}
|
|
stage('Publish') {
|
|
when {
|
|
buildingTag()
|
|
}
|
|
environment {
|
|
GITEA_PACKAGE_REGISTRY = credentials('gitea-package-registry')
|
|
GITEA_PACKAGE_WRITE = credentials('gitea-package-write')
|
|
}
|
|
steps {
|
|
container('buildah') {
|
|
sh('buildah login -u $GITEA_PACKAGE_WRITE_USR -p $GITEA_PACKAGE_WRITE_PSW $GITEA_PACKAGE_REGISTRY')
|
|
sh('buildah push $GITEA_PACKAGE_REGISTRY:$TAG_NAME')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |