This commit is contained in:
root 2023-06-19 15:13:51 +08:00
parent 6fb9a0ff7e
commit c55f2a0fed
4 changed files with 15 additions and 16 deletions

View File

@ -95,4 +95,4 @@
`systemctl stop firewalld` #关闭防火墙 `systemctl stop firewalld` #关闭防火墙
`sh tools/docker/install.sh` `sh tools/docker/install.sh`
2. 运行ansible镜像执行k8s安装 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脚本

View File

@ -6,8 +6,7 @@ def projectProperties = [
string(name: 'VERSION', defaultValue: "1.0", description: '包版本'), string(name: 'VERSION', defaultValue: "1.0", description: '包版本'),
string(name: 'GENERATE_IMAGES_LISTS', defaultValue: "true", description: '是否生成images_list文件'), string(name: 'GENERATE_IMAGES_LISTS', defaultValue: "true", description: '是否生成images_list文件'),
string(name: 'INCLUDE_APPS_IMAGES', defaultValue: "true", description: '是否包含应用镜像'), string(name: 'INCLUDE_APPS_IMAGES', defaultValue: "true", description: '是否包含应用镜像'),
string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录'), string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录')
string(name: 'HARBOR_SRC', defaultValue: 'docker.io', description: '源镜像仓库')
]) ])
] ]
@ -16,7 +15,7 @@ properties(projectProperties)
node('master') { node('master') {
//部署文件路径 //部署文件路径
DEPLOY_PROJECT_PATH="${WORKSPACE}/k8s_deploy"; DEPLOY_PROJECT_PATH="${WORKSPACE}/ccyunchina-deploy";
//镜像文件保存目录 //镜像文件保存目录
IMAGES_PATH="${DEPLOY_PROJECT_PATH}/images" IMAGES_PATH="${DEPLOY_PROJECT_PATH}/images"
@ -31,7 +30,7 @@ node('master') {
DEST_PATH="${DEST_PATH_PREFIX}/k8s_data/${VERSION}" DEST_PATH="${DEST_PATH_PREFIX}/k8s_data/${VERSION}"
//源harobr镜像库地址 //源harobr镜像库地址
HARBOR_SRC="docker.io" HARBOR_SRC="dev-docker-registry.ccyunchina.com"
stage('拉取k8s部署文件') { stage('拉取k8s部署文件') {
@ -39,7 +38,7 @@ node('master') {
cleanWs() cleanWs()
} }
dir(DEPLOY_PROJECT_PATH){ 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镜像') { stage('拉取并导出ansible镜像') {
sh "docker pull toyangdon/ansible:latest" sh "docker pull dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest"
sh "docker save toyangdon/ansible:latest -o k8s_deploy/ansible_image.tar" sh "docker save dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest -o ccyunchina-deploy/ansible_image.tar"
} }
stage('打包部署文件') { stage('打包部署文件') {
sh "rm -rf k8s_deploy/.git" sh "rm -rf ccyunchina-deploy/.git"
sh "tar --use-compress-program=pigz -cvpf k8s_deploy.tar.gz k8s_deploy" sh "tar --use-compress-program=pigz -cvpf ccyunchina-deploy.tar.gz ccyunchina-deploy"
} }
stage('归档部署文件'){ stage('归档部署文件'){
//根据版本号创建目录,如果目录已经存在则报错退出 //根据版本号创建目录,如果目录已经存在则报错退出
sh "mkdir -p ${DEST_PATH}" sh "mkdir -p ${DEST_PATH}"
sh "cp k8s_deploy.tar.gz ${DEST_PATH}/" sh "cp ccyunchina-deploy.tar.gz ${DEST_PATH}/"
} }
} }

View File

@ -1,6 +1 @@
toyangdon/dm:7-arm64 toyangdon/dm:7-arm64
toyangdon/tongweb:7
toyangdon/antdb_alone:5.0
toyangdon/kingbase:v8r3
toyangdon/redis:5.0-arm64-jemalloc
toyangdon/busybox:latest

View File

@ -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