EPC的CI/CD
1. 流程介绍 开发人员合并代码到gogs,触发钩子,drone根据git仓库中的.drone.yml进行工作,使用fpm进行rpm打包并更新本地yum仓库
2. .drone.yml workspace: base: /root/gogs path: epc-c pipeline: build: image: centos7.5:dev environment: - SSH_ARGS=-p 22 -o StrictHostKeyChecking=no - SCP_ARGS=-P 22 -o StrictHostKeyChecking=no - TEST_SERVER=root@192.168.9.105 - RUN_PATH=/root/df/caddy/filebrowser/files/EPC-VERSION commands: - git_rev=$(git rev-parse HEAD| cut -c1-10) - git clone http://192.168.9.105:60080/dongfeng/pack-epc-c.git - cd pack-epc-c - ./pack-epc-c.sh - rpm_name="baicells-epc-c-$(cat VERSION)-$(cat RELEASE).x86_64.rpm" - rpm_rename=$(echo $rpm_name| awk -F .rpm '{print $1}') - rpm_newname="$rpm_rename"_"$(date '+%Y%m%d')"_"$git_rev".rpm - eval $(ssh-agent -s) - ssh-add /root/.ssh/id_rsa - scp $SCP_ARGS $rpm_name "$TEST_SERVER":"$RUN_PATH"/"$rpm_newname" - ssh "$TEST_SERVER" > /dev/null 2>&1 << eeooff - cd /root/df/caddy/yum.……