jenkins shell脚本自动化构建阿里云k8s上应用

#!/bin/bash

source /etc/profile

cd /mnt/workspace/weifeng-ui-pre/

npm i && npm run build 

rm -rf /mnt/workspace/weifeng-ui-pre/dockerfile/build

cd /mnt/workspace/weifeng-ui-pre/dockerfile

mv  ../build  .

sudo docker build -t pre-weifeng-ui -f Dockerfile.pre .

sudo docker login --username=******* -p Zh******k registry-vpc********.aliyuncs.com

sudo docker tag pre-weifeng-ui registry-vpc******liyuncs.com/weifeng-system/pre-weifeng-ui

sudo docker push  registry-*******.aliyuncs.com/weifeng-system/pre-weifeng-ui

curl https://cs.console.aliyun.com/hook/trigger?toke***********************************************7k

if [ $? -eq 0 ]; then
echo -e "\033[32m[ the application weifeng-ui-pre successfully deployed ]\033[0m" else
echo -e "\033[31m\033[01m[ the application weifeng-ui-pre deploy failed ]\033[0m" fi

  

上一篇:Druid链接池配置加密密码链接数据库


下一篇:SQL 问题记录