build-job: # This job runs in the build stage, which runs first.
stage: build # before_script: # - mkdir -p fanrui/hello/cache/__flag__
<<: *fanrui_hello # 锚点第一次引用,引用结果:失败
script:
- mvn package
- pwd #/home/gitlab-runner/builds/6vHTy9wZy/0/fanrui/hello # cache: # paths: # - fanrui/hello/cache/__flag__ #WARNING: processPath: artifact path is not a subpath of project directory: /tmp/gitlab_cache
artifacts:
paths:
- "target/*.jar"
deploy-job:
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
tags:
- production
script:
- cp target/*.jar /var/www/html/hello.jar
- crontab -i /var/www/html/cronfile.sh
- echo ""
<<: *fanrui_hello # 锚点第二次引用,引用结果:成功