-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.1 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: CD-Sonar Metrics Collector
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
name: Deploy-ssh
runs-on: ubuntu-latest
steps:
- name: Executing remote ssh commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd db1-projects/sonar-metrics-collector/;
docker container stop sonar-metrics-collector;
docker rm sonar-metrics-collector;
git pull origin main;
rm -rf .env
touch .env
echo SONAR_USER_TOKEN=${{ secrets.SONAR_USER_TOKEN }} >> .env
echo SONAR_URL=https://sonarhomolog.db1.com.br >> .env
echo PORT=5100 >> .env
docker rmi sonar-metrics-collector;
docker build -t sonar-metrics-collector .;
docker run -d -t -i -p 5100:5100 --network host --name sonar-metrics-collector sonar-metrics-collector:latest npm run start:prod