web-redirects/.drone.yml
Adler Neves eb7fd943fa
All checks were successful
continuous-integration/drone Build is passing
first commit
2023-08-12 20:15:44 -03:00

45 lines
1.3 KiB
YAML

kind: pipeline
type: exec
name: default
clone:
depth: 50
steps:
- name: analyze
environment:
SONAR_TOKEN:
from_secret: sonar_token
commands:
- if [[ -z "$(curl -s https://qa.adlerneves.com | grep '502 Bad Gateway')" ]]; then /opt/sonar-scanner/bin/sonar-scanner -Dsonar.login=$$SONAR_TOKEN ; fi
- name: submodules
depends_on:
- analyze
commands:
- git config --global url.https://git.adlerneves.com/.insteadOf "gitea@git.adlerneves.com:"
- git submodule update --init --recursive --remote
- name: build
depends_on:
- submodules
commands:
- echo "Nothing to do..."
- name: deploy
depends_on:
- build
commands:
- mkdir -p local/sites/redirects/files
- sudo rm -rf /var/lib/static-site-server-rs/sites/redirects
- sudo mkdir -p /var/lib/static-site-server-rs/sites/redirects/files
- sudo cp -R local/sites/redirects/files/. /var/lib/static-site-server-rs/sites/redirects/files/.
- sudo install -m 644 -T local/sites/redirects/site.yaml /var/lib/static-site-server-rs/sites/redirects/site.yaml
- sudo chown http:http -R /var/lib/static-site-server-rs/sites/redirects
- name: reload
depends_on:
- deploy
commands:
- sudo touch /var/lib/static-site-server-rs/routes.yaml