1 Star 0 Fork 0

烛火流风/rabbit-spring-cloud-stream-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 2.09 KB
一键复制 编辑 原始数据 按行查看 历史
devine 提交于 2021-12-18 09:15 +08:00 . feat(项目): 项目初始化
pipeline {
agent {
node {
label 'maven'
}
}
stages {
stage('拉取代码') {
agent none
steps {
container('maven') {
git(url: 'http://10.0.2.13/test/rabbit-spring-cloud-stream-demo.git', credentialsId: 'gitlab-certificate', branch: 'master', changelog: true, poll: false)
sh 'ls -al'
}
}
}
stage('项目编译') {
agent none
steps {
container('maven') {
sh 'ls'
sh 'mvn clean package -Dmaven.test.skip=true'
}
}
}
stage('镜像推送') {
agent none
steps {
container('maven') {
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker build -t $REGISTRY/$DOCKER_NAMESPACE/$APP_NAME:SNAPSHOT-$BUILD_NUMBER -f Dockerfile .'
sh 'docker push $REGISTRY/$DOCKER_NAMESPACE/$APP_NAME:SNAPSHOT-$BUILD_NUMBER'
}
}
}
}
stage('项目部署(DEV)') {
agent none
steps {
kubernetesDeploy(configs: 'deploy/**', enableConfigSubstitution: true, kubeconfigId: "$KUBECONFIG_CREDENTIAL_ID", dockerCredentials: [])
}
}
stage('deploy to production') {
steps {
input(id: 'deploy-to-production', message: 'deploy to production?')
kubernetesDeploy(configs: 'deploy/prod-ol/**', enableConfigSubstitution: true, kubeconfigId: "$KUBECONFIG_CREDENTIAL_ID")
}
}
}
environment {
GITHUB_CREDENTIAL_ID = 'github-id'
GITHUB_ACCOUNT = 'kubesphere'
KUBECONFIG_CREDENTIAL_ID = 'kubeconfig-id'
DOCKER_CREDENTIAL_ID = 'harbor-account'
DOCKER_REGISTRY = '10.0.2.18:88'
DOCKER_NAMESPACE = 'devops'
HARBOR_CREDENTIAL = credentials('harbor-certificate')
REGISTRY = '10.0.2.18:88'
APP_NAME = 'rabbit-spring-cloud-stream-demo'
}
parameters {
string(name: 'TAG_NAME', defaultValue: '', description: '')
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/ht16519/rabbit-spring-cloud-stream-demo.git
git@gitee.com:ht16519/rabbit-spring-cloud-stream-demo.git
ht16519
rabbit-spring-cloud-stream-demo
rabbit-spring-cloud-stream-demo
master

搜索帮助