conventionschedule-pwa/.drone.yml

65 lines
2.1 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: devclean
depends_on:
- submodules
commands:
- rm nextjs/public/*.ico
- rm nextjs/public/*.png
- rm nextjs/public/own-config.json
- name: build
depends_on:
- devclean
commands:
- echo "Nothing to do..."
- static-site-server-rs -c local/sites/site_furmeet_pwa/files/index.htmltpl
- static-site-server-rs -c nextjs/public/own-config.jsontpl
- static-site-server-rs -c nextjs/public/manifest.jsontpl
- rm local/sites/site_furmeet_pwa/files/index.htmltpl
- rm nextjs/public/own-config.jsontpl
- rm nextjs/public/manifest.jsontpl
- cd nextjs
- npm install
- npm run build
- cd ..
- name: deploy
depends_on:
- build
commands:
- sudo rm -rf /var/lib/static-site-server-rs/sites/site_furmeet_pwa
- sudo mkdir -p /var/lib/static-site-server-rs/sites/site_furmeet_pwa/files
- sudo cp -R local/sites/site_furmeet_pwa/files/. /var/lib/static-site-server-rs/sites/site_furmeet_pwa/files/.
- sudo install -m 644 -T local/sites/site_furmeet_pwa/site.yaml /var/lib/static-site-server-rs/sites/site_furmeet_pwa/site.yaml
- sudo rm -rf /var/lib/static-site-server-rs/sites/site_furmeet_pwa/files
- sudo mkdir -p /var/lib/static-site-server-rs/sites/site_furmeet_pwa/files
- sudo cp -R nextjs/out/. /var/lib/static-site-server-rs/sites/site_furmeet_pwa/files/.
- sudo chown http:http -R /var/lib/static-site-server-rs/sites/site_furmeet_pwa
- name: reload
depends_on:
- deploy
commands:
- sudo touch /var/lib/static-site-server-rs/routes.yaml