From 36c578dc8c51e6500607a495214971f910e14ad1 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Fri, 12 Aug 2022 22:37:32 +0200 Subject: [PATCH] Version and build and deploy. --- .drone.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- pom.xml | 2 +- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index cb038bc..23b7f90 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: docker -name: default +name: analyseAndBuild steps: - name: test @@ -19,4 +19,51 @@ steps: SONAR_HOST_URL: from_secret: sonarScannerHostUrl SONAR_LOGIN: - from_secret: sonarScannerLogin \ No newline at end of file + from_secret: sonarScannerLogin +trigger: + event: + - push + - pull_request +--- +kind: pipeline +type: docker +name: Deploy + +steps: + - name: build + image: maven:3-jdk-11 + commands: + - mvn install -DskipTests=true -Dmaven.javadoc.skip=true + - name: scpFiles + image: appleboy/drone-scp + settings: + host: amine-louveau.fr + username: ubuntu + key: + from_secret: privateKey + port: 22 + target: /home/ubuntu/courses-jar + source: target/* + - name: deploy + image: appleboy/drone-ssh + settings: + host: amine-louveau.fr + user: ubuntu + key: + from_secret: privateKey + command_timeout: 2m + script: + - sudo service ldc stop + - cd /home/ubuntu/courses-jar + - mv target/* ./ + - sudo chown ubuntu:ubuntu ./* + - sudo mv ./liste-de-courses-1.4-SNAPSHOT-jar-with-dependencies.jar /usr/local/bin/ #todo change file to variable + - cd /usr/local/bin/ + - sudo rm ldc.jar + - sudo ln -s liste-de-courses-1.4-SNAPSHOT-jar-with-dependencies.jar ldc.jar #todo change file to variable + - sudo service ldc start +trigger: + event: + - promote + target: + - production \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8f78eb8..b6b04bd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ liste-de-courses fr.louveau-amine - 1.3-SNAPSHOT + 1.4-SNAPSHOT jar liste-de-courses