liste-de-courses-www/.drone.yml
aminecmi 15e69496b7
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
Laast pipeline should be laast.
2022-08-06 15:24:47 +02:00

92 lines
1.6 KiB
YAML

kind: pipeline
type: docker
name: analyseAndBuild
steps:
- name: code-analysis
image: sonarsource/sonar-scanner-cli
detach: true
failure: ignore
commands:
- ls -la
- sonar-scanner -Dsonar.projectKey=LDC-WWW -Dsonar.sources=. -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN
environment:
SONAR_HOST_URL:
from_secret: sonarScannerHostUrl
SONAR_LOGIN:
from_secret: sonarScannerLogin
- name: build
image: node:14
commands:
- npm install
- npm run lint
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: CopyToServer
steps:
- name: build
image: node:14
commands:
- npm install
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
- name: scp files
image: appleboy/drone-scp
settings:
host: amine-louveau.fr
username: ubuntu
key:
from_secret: privateKey
port: 22
target: /home/ubuntu/courses
source: dist/*
trigger:
event:
- promote
target:
- production
---
kind: pipeline
type: ssh
name: Deploy
server:
host: amine-louveau.fr
user: ubuntu
ssh_key:
from_secret: ssh_key
steps:
- name: copy
commands:
- cd /home/ubuntu/courses
- mv dist/* ./
- sudo chown www-data:www-data ./*
- sudo rm -rf /var/www/amine/courses/*
- sudo mv ./* /var/www/amine/courses/
depends_on:
- CopyToServer
trigger:
event:
- promote
target:
- production