feat: add the tip of before_sparrow_command if docker not exits #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github-ci | |
on: | |
push: | |
branches: | |
- main | |
- test | |
- develop | |
jobs: | |
CIManager: | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_NAME: "CIManager" | |
# ========================= CI ========================= | |
# [stage] = pre | |
CI_STAGE_PRE_JOB_PRE_CHECK_SWITCH: "ON" | |
CI_STAGE_PRE_JOB_PRE_CHECK_CMD: "" | |
CI_STAGE_PRE_JOB_PRE_INSTALL_SWITCH: "ON" | |
CI_STAGE_PRE_JOB_PRE_INSTALL_CMD: "" | |
# [stage] = test | |
CI_STAGE_TEST_JOB_UNIT_TEST_SWITCH: "ON" | |
CI_STAGE_TEST_JOB_UNIT_TEST_CMD: "cd .work/test && bash run.sh && cd ../../" | |
CI_STAGE_TEST_JOB_CHECK_CODE_SWITCH: "ON" | |
CI_STAGE_TEST_JOB_CHECK_CODE_CMD: "" | |
# [stage] = build | |
CI_STAGE_BUILD_JOB_LOCAL_BUILD_SWITCH: "ON" | |
CI_STAGE_BUILD_JOB_LOCAL_BUILD_CMD: "" | |
CI_STAGE_BUILD_JOB_APIDOC_GEN_SWITCH: "ON" | |
CI_STAGE_BUILD_JOB_APIDOC_GEN_CMD: "" | |
# ========================= CD ========================= | |
# [stage] = deploy | |
CD_STAGE_DEPLOY_JOB_SSH_SWITCH: "ON" | |
CD_STAGE_DEPLOY_JOB_SSH_CMD: "" | |
# [stage] = monitor | |
CD_STAGE_MONITOR_JOB_API_TEST_SWITCH: "ON" | |
CD_STAGE_MONITOR_JOB_API_TEST_CMD: "" | |
CD_STAGE_MONITOR_JOB_HEALTH_CHECK_SWITCH: "ON" | |
CD_STAGE_MONITOR_JOB_HEALTH_CHECK_CMD: "" | |
CD_STAGE_MONITOR_JOB_HEALTH_CHECK_CMD_RES: "ok" | |
steps: | |
- uses: actions/checkout@v1 | |
- run: | | |
printf "================ Start to Boot CIManager ================\n" | |
git clone https://github.com/wgrape/CIManager.git | |
cp -an ./CIManager/.pipeline ./ | |
rm -rf ./CIManager | |
cd .pipeline | |
printf "================ End Boot ================\n\n" | |
printf "================ Debug Start ================\n\n" | |
show_env(){ | |
echo "1. cat /proc/version="$(cat /proc/version) | |
echo "2. pwd="$(pwd) | |
echo "3. ls="$(ls -a) | |
} | |
show_env | |
printf "================ End Debug ================\n\n" | |
printf "\e[36m>>>>>>>>>>> Start Pipeline\e[0m\n\n" | |
# you can run sudo with the -E/--preserve-env switch, sudo -E/--preserve-env ..., which retains environment variables. | |
sudo --preserve-env bash start.sh | |
printf "\e[36m<<<<<<<<<<< End Pipeline\e[0m" |