补充gogs的pipeline

This commit is contained in:
fastjrun 2022-03-08 19:35:05 +08:00
parent c7f0dd68e9
commit fdde81b149
1 changed files with 32 additions and 0 deletions

32
gogs/docker.groovy Normal file
View File

@ -0,0 +1,32 @@
pipeline {
agent any
parameters {
gitParameter name: 'TAG',
type: 'PT_TAG',
defaultValue: 'v0.12.3'
}
stages {
stage('git chekout') {
steps {
checkout([$class : 'GitSCM',
branches : [[name: "${params.TAG}"]],
doGenerateSubmoduleConfigurations: false,
extensions : [],
gitTool : 'Default',
submoduleCfg : [],
userRemoteConfigs : [[url: 'https://github.com/gogs/gogs.git']]
])
}
}
stage('docker build & push') {
steps {
sh 'sed -i "7i\\ENV GOPROXY https://goproxy.cn,direct" docker/Dockerfile.aarch64'
sh 'sed -i 14d docker/Dockerfile.aarch64'
sh 'cp -f /var/software/gosu-arm64 gosu-arm64'
sh 'sed -i "14i\\ADD gosu-arm64 /usr/sbin/gosu" docker/Dockerfile.aarch64'
sh 'docker build . -t pi4k8s/gogs:v0.12.3 -f docker/Dockerfile.aarch64'
sh 'docker push pi4k8s/gogs:v0.12.3'
}
}
}
}