码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2019-01-06 00:32:19      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:amp   阿里   The   ash   ace   ons   jenkin   etc   docker   

#!/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

  

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

标签:amp   阿里   The   ash   ace   ons   jenkin   etc   docker   

原文地址:https://www.cnblogs.com/weifeng1463/p/10226838.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!