init
This commit is contained in:
parent
6fb9a0ff7e
commit
c55f2a0fed
|
@ -95,4 +95,4 @@
|
|||
`systemctl stop firewalld` #关闭防火墙
|
||||
`sh tools/docker/install.sh`
|
||||
2. 运行ansible镜像执行k8s安装
|
||||
`/opt/k8s/bin/docker run --name ansible -it --privileged -v /root/k8s-install:/etc/ansible toyangdon/ansible:latest` #进入容器内执行ansible脚本
|
||||
`/opt/k8s/bin/docker run --name ansible -it --privileged -v /root/ccyunchina-deploy:/etc/ansible toyangdon/ansible:latest` #进入容器内执行ansible脚本
|
||||
|
|
|
@ -6,8 +6,7 @@ def projectProperties = [
|
|||
string(name: 'VERSION', defaultValue: "1.0", description: '包版本'),
|
||||
string(name: 'GENERATE_IMAGES_LISTS', defaultValue: "true", description: '是否生成images_list文件'),
|
||||
string(name: 'INCLUDE_APPS_IMAGES', defaultValue: "true", description: '是否包含应用镜像'),
|
||||
string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录'),
|
||||
string(name: 'HARBOR_SRC', defaultValue: 'docker.io', description: '源镜像仓库')
|
||||
string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录')
|
||||
])
|
||||
]
|
||||
|
||||
|
@ -16,7 +15,7 @@ properties(projectProperties)
|
|||
node('master') {
|
||||
|
||||
//部署文件路径
|
||||
DEPLOY_PROJECT_PATH="${WORKSPACE}/k8s_deploy";
|
||||
DEPLOY_PROJECT_PATH="${WORKSPACE}/ccyunchina-deploy";
|
||||
|
||||
//镜像文件保存目录
|
||||
IMAGES_PATH="${DEPLOY_PROJECT_PATH}/images"
|
||||
|
@ -31,7 +30,7 @@ node('master') {
|
|||
DEST_PATH="${DEST_PATH_PREFIX}/k8s_data/${VERSION}"
|
||||
|
||||
//源harobr镜像库地址
|
||||
HARBOR_SRC="docker.io"
|
||||
HARBOR_SRC="dev-docker-registry.ccyunchina.com"
|
||||
|
||||
|
||||
stage('拉取k8s部署文件') {
|
||||
|
@ -39,7 +38,7 @@ node('master') {
|
|||
cleanWs()
|
||||
}
|
||||
dir(DEPLOY_PROJECT_PATH){
|
||||
git branch: "${BRANCH_NAME}", url: 'https://git.trustie.net/toyangdon/proprietary-cloud-deploy.git'
|
||||
git branch: "${BRANCH_NAME}", url: 'https://gitlink.org.cn/toyangdon/ccyunchina-deploy.git'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,21 +60,21 @@ node('master') {
|
|||
}
|
||||
|
||||
stage('拉取并导出ansible镜像') {
|
||||
sh "docker pull toyangdon/ansible:latest"
|
||||
sh "docker save toyangdon/ansible:latest -o k8s_deploy/ansible_image.tar"
|
||||
sh "docker pull dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest"
|
||||
sh "docker save dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest -o ccyunchina-deploy/ansible_image.tar"
|
||||
}
|
||||
|
||||
|
||||
|
||||
stage('打包部署文件') {
|
||||
sh "rm -rf k8s_deploy/.git"
|
||||
sh "tar --use-compress-program=pigz -cvpf k8s_deploy.tar.gz k8s_deploy"
|
||||
sh "rm -rf ccyunchina-deploy/.git"
|
||||
sh "tar --use-compress-program=pigz -cvpf ccyunchina-deploy.tar.gz ccyunchina-deploy"
|
||||
}
|
||||
|
||||
stage('归档部署文件'){
|
||||
//根据版本号创建目录,如果目录已经存在则报错退出
|
||||
sh "mkdir -p ${DEST_PATH}"
|
||||
sh "cp k8s_deploy.tar.gz ${DEST_PATH}/"
|
||||
sh "cp ccyunchina-deploy.tar.gz ${DEST_PATH}/"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1 @@
|
|||
toyangdon/dm:7-arm64
|
||||
toyangdon/tongweb:7
|
||||
toyangdon/antdb_alone:5.0
|
||||
toyangdon/kingbase:v8r3
|
||||
toyangdon/redis:5.0-arm64-jemalloc
|
||||
toyangdon/busybox:latest
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
toyangdon/dm:7-arm64
|
||||
toyangdon/antdb_alone:5.0
|
||||
toyangdon/kingbase:v8r3
|
||||
toyangdon/redis:5.0-arm64-jemalloc
|
||||
toyangdon/busybox:latest
|
Loading…
Reference in New Issue