stages: 
    - deploy
deploy:
    stage: deploy
    script:
      - mvn install
      - mvn clean package
      - rm -rf /root/spring_boot/*.jar
      - rm -rf /etc/init.d/litemall-*
      - cp -rf litemall-admin-api/target/litemall-admin-api-*-exec.jar /root/spring_boot/litemall-admin-api.jar
      - cp -rf litemall-os-api/target/litemall-os-api-*-exec.jar /root/spring_boot/litemall-os-api.jar
      - cp -rf litemall-wx-api/target/litemall-wx-api-*-exec.jar /root/spring_boot/litemall-wx-api.jar
      - sudo chmod 777 /root/spring_boot/*.jar
      - sudo ln -f -s /root/spring_boot/litemall-admin-api.jar /etc/init.d/litemall-admin-api
      - sudo ln -f -s /root/spring_boot/litemall-os-api.jar /etc/init.d/litemall-os-api
      - sudo ln -f -s /root/spring_boot/litemall-wx-api.jar /etc/init.d/litemall-wx-api
      - sudo /etc/init.d/litemall-os-api restart
      - sudo /etc/init.d/litemall-wx-api restart
      - sudo /etc/init.d/litemall-admin-api restart
      - systemctl stop nginx
      - rm -rf /root/nginx_web/
      - cd litemall-admin
      - cnpm install
      - cnpm run build:dep
      - mkdir /root/nginx_web
      - cp -rf dist/* /root/nginx_web
      - sudo chmod 777 /root/nginx_web
      - systemctl restart nginx
    tags:
      - litemall_dev