Lukas Heiligenbrunner
777cc2a712
no redirect on tagclick on homepage no multiple add of same tag possible
89 lines
1.8 KiB
YAML
89 lines
1.8 KiB
YAML
image: node:14
|
|
|
|
stages:
|
|
- prepare
|
|
- build
|
|
- test
|
|
- packaging
|
|
- deploy
|
|
|
|
cache:
|
|
paths:
|
|
- node_modules/
|
|
|
|
include:
|
|
- template: Code-Quality.gitlab-ci.yml
|
|
|
|
variables:
|
|
SAST_DISABLE_DIND: "true"
|
|
|
|
prepare:
|
|
stage: prepare
|
|
script:
|
|
- npm install --progress=false
|
|
|
|
build:
|
|
stage: build
|
|
script:
|
|
- npm run build
|
|
artifacts:
|
|
expire_in: 7 days
|
|
paths:
|
|
- build/
|
|
needs: ["prepare"]
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- CI=true npm run test
|
|
artifacts:
|
|
reports:
|
|
junit:
|
|
- ./junit.xml
|
|
needs: ["prepare"]
|
|
|
|
coverage:
|
|
stage: test
|
|
script:
|
|
- CI=true npm run coverage
|
|
artifacts:
|
|
reports:
|
|
cobertura:
|
|
- ./coverage/cobertura-coverage.xml
|
|
needs: ["prepare"]
|
|
|
|
package_debian:
|
|
stage: packaging
|
|
image: debian
|
|
script:
|
|
- cd deb
|
|
- mkdir -p "./OpenMediaCenter/var/www/openmediacenter/videos/"
|
|
- mkdir -p "./OpenMediaCenter/tmp/"
|
|
- cp -r ../build/* ./OpenMediaCenter/var/www/openmediacenter/
|
|
- cp -r ../api ./OpenMediaCenter/var/www/openmediacenter/
|
|
- cp ../database.sql ./OpenMediaCenter/tmp/openmediacenter.sql
|
|
- chmod -R 0775 *
|
|
- dpkg-deb --build OpenMediaCenter
|
|
- mv OpenMediaCenter.deb OpenMediaCenter-0.1_amd64.deb
|
|
artifacts:
|
|
paths:
|
|
- deb/OpenMediaCenter-0.1_amd64.deb
|
|
needs: ["build"]
|
|
|
|
deploy_test1:
|
|
stage: deploy
|
|
image: luki42/alpineopenssh:latest
|
|
needs:
|
|
- test
|
|
- package_debian
|
|
only:
|
|
- master
|
|
script:
|
|
- eval $(ssh-agent -s)
|
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
- mkdir -p ~/.ssh
|
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
|
- scp deb/OpenMediaCenter-*.deb root@192.168.0.42:/tmp/
|
|
- ssh root@192.168.0.42 "DEBIAN_FRONTEND=noninteractive apt-get --reinstall -y -qq install /tmp/OpenMediaCenter-*.deb && rm /tmp/OpenMediaCenter-*.deb"
|
|
|