cv-api/.drone.yml

57 lines
1.2 KiB
YAML
Raw Normal View History

2022-10-01 12:37:50 +00:00
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:
2022-10-01 19:17:04 +00:00
- ./gradlew build
2022-10-01 12:37:50 +00:00
- name: scpFiles
image: appleboy/drone-scp
settings:
2023-10-22 18:46:59 +00:00
host: amine-bouabdallaoui.fr
2022-10-01 12:37:50 +00:00
username: ubuntu
key:
from_secret: privateKey
port: 22
target: /home/ubuntu/cv-api
source: build/libs/*
- name: deploy
image: appleboy/drone-ssh
settings:
2023-10-22 18:46:59 +00:00
host: amine-bouabdallaoui.fr
2022-10-01 12:37:50 +00:00
user: ubuntu
key:
from_secret: privateKey
command_timeout: 2m
script:
- sudo service cv-api stop
2022-10-01 19:26:37 +00:00
- cd /home/ubuntu/cv-api/build/libs
2022-10-01 12:37:50 +00:00
- sudo chown ubuntu:ubuntu ./*
2022-10-01 19:17:04 +00:00
- sudo mv -f ./cvApi-1.0-SNAPSHOT-all.jar /usr/local/bin/ #todo change file to variable
2022-10-01 12:37:50 +00:00
- cd /usr/local/bin/
2022-10-01 19:17:04 +00:00
- 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
2022-10-01 12:37:50 +00:00
- sudo service cv-api start
2022-10-01 12:39:12 +00:00
2022-10-01 12:37:50 +00:00
trigger:
event:
- promote
target:
- production