stages:
  - build
  - test
  - deploy
  - manual_build
cache:
  paths:
  - /notes-union/target/*.jar

auto_build:
  stage: build
  only:
   - master
  tags:
   - MCJ-Runner
  script:
    - mvn clean package -Dskiptests=true
    
auto_test:
  stage: test
  only:
   - master
  tags:
   - MCJ-Runner
  script:
   - echo "test skiped."

auto_deploy:
  stage: deploy
  only:
   - master
  tags:
   - MCJ-Runner
  script:
    #登录159服务器远程执行命令
    - java -jar /notes-union/target/*.jar > dev/null/ &
    
manual_build:
  stage: manual_build
  only:
   - master
  tags:
   - MCJ-Runner
  script:
    - mvn clean package -Dskiptests=true
  when: manual
  artifacts:
    when: on_success
    expire_in: 1 days
    paths:
      - /notes-union/target/*.jar