- 新建run.sh(同级目录)
echo "hello world from external file"
2。 编写.gitlab-ci.yml
stages:
- testing # stage编排
- build
- deploy
run_test: #Job
stage: testing
tags:
- shell #Gitlab-runner
script:
- echo "执行测试"
- chmod +x ./run.sh # 给run.sh加可执行权限
- ./run.sh # 运行外部文件./run.sh
- 运行结果: