liste-de-courses/.drone.yml

66 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2022-07-19 14:51:49 +00:00
kind: pipeline
2022-07-19 15:00:29 +00:00
type: docker
2022-08-12 20:37:32 +00:00
name: analyseAndBuild
2022-07-22 18:52:34 +00:00
2022-07-19 14:51:49 +00:00
steps:
- name: test
2022-07-22 20:06:36 +00:00
image: maven:3-jdk-11
2022-07-19 14:51:49 +00:00
commands:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
2022-07-22 18:52:34 +00:00
- mvn test -B
- name: analyse
2022-07-22 20:06:36 +00:00
image: maven:3-jdk-11
2022-07-22 19:45:44 +00:00
failure: ignore
2022-07-22 19:39:14 +00:00
commands:
- mvn clean verify sonar:sonar -Dsonar.projectKey=LDC -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN
2022-07-22 18:54:00 +00:00
environment:
SONAR_HOST_URL:
from_secret: sonarScannerHostUrl
SONAR_LOGIN:
2022-08-12 20:37:32 +00:00
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
2022-08-12 20:55:35 +00:00
- sudo chown ubuntu:ubuntu ./target/*
- sudo mv -f ./target/liste-de-courses-1.4-SNAPSHOT-jar-with-dependencies.jar /usr/local/bin/ #todo change file to variable
2022-08-12 20:37:32 +00:00
- 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