kind: pipeline type: docker name: analyseAndBuild steps: - name: buildAndTest image: gradle:jdk8 commands: - ./gradlew build - ./gradlew test trigger: event: - push - pull_request --- kind: pipeline type: docker name: Deploy steps: - name: build image: gradle:jdk8 commands: - ./gradlew build - name: scpFiles image: appleboy/drone-scp settings: host: amine-bouabdallaoui.fr username: ubuntu key: from_secret: privateKey port: 22 target: /home/ubuntu/cv-api source: build/libs/* - name: deploy image: appleboy/drone-ssh settings: host: amine-bouabdallaoui.fr user: ubuntu key: from_secret: privateKey command_timeout: 2m script: - sudo service cv-api stop - cd /home/ubuntu/cv-api/build/libs - sudo chown ubuntu:ubuntu ./* - sudo mv -f ./cvApi-1.0-SNAPSHOT-all.jar /usr/local/bin/ #todo change file to variable - cd /usr/local/bin/ - sudo mv -f cv-api.jar cv-api.jar.back - sudo ln -s cvApi-1.0-SNAPSHOT-all.jar cv-api.jar #todo change file to variable - sudo service cv-api start trigger: event: - promote target: - production