Shell

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
case "${BRANCH_NAME}" in
cicd-test)
    export DEPLOY_ENV="测试环境"
    ;;
cicd-beta)
    export DEPLOY_ENV="灰度环境"
    ;;
cicd-prod)
    export DEPLOY_ENV="生产环境"
    ;;
master)
    export DEPLOY_ENV="上个稳定版本"
    ;;
*)
    export DEPLOY_ENV="未知"
esac
1
jo msgtype=markdown "markdown[content]=${msg}"

循环

1
2
3
for (( i=0; i<3; i++ )); do
	echo "$i"
done
1
2
3
for file in `ls`; do
	echo "$file"
done

【小菜笔记】系列文章首发于公众号【小菜学编程】,敬请关注: