1 Star 0 Fork 3

Rukiy/alpine-openjdk17

forked from Rukiy/alpine-openjdk11 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
Rukiy 提交于 2024-10-23 11:00 . update Jenkinsfile.
def createVersion() {
// 定义一个版本号作为当次构建的版本,输出结果 201912101758
return new Date().format('yyyyMMddHHmm',TimeZone.getTimeZone('Asia/Shanghai'))
}
pipeline {
agent {
label 'k3s'
}
environment {
def useRepository = "https://gitee.com/rukiy/alpine-openjdk17.git"
def IMAGE_NAME = "alpine-openjdk17"
def GIT_CHOOSE_BRANCH = "master"
def TEMP_IMAGE_TAG = createVersion()
def IMAGE_TAG = "${TEMP_IMAGE_TAG}"
}
stages {
stage('初始化'){
steps{
buildName "${IMAGE_TAG}"
}
}
stage('更新') {
steps {
git branch: "${GIT_CHOOSE_BRANCH}", credentialsId: '', url: "${useRepository}"
}
}
stage('构建') {
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId: "${HARBOR_CREDENTIALSID}", usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
sh """
docker buildx build --builder multiarch-builder --platform linux/amd64,linux/arm64 --force-rm -t ${HARBOR_ENDPOINT}/rukiy/${IMAGE_NAME} -f Dockerfile . --push
"""
}
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/rukiy/alpine-openjdk17.git
[email protected]:rukiy/alpine-openjdk17.git
rukiy
alpine-openjdk17
alpine-openjdk17
master

搜索帮助