Files
PhotonVision/.gitlab-ci.yml
2019-11-09 10:41:36 +00:00

42 lines
1.1 KiB
YAML

stages:
- build_ui
- build_jar
- deploy
build_ui:
stage: build_ui
image: node:latest
script:
- cd chameleon-client
- npm install
- npm run build
artifacts:
paths:
- chameleon-client/dist
build_jar:
stage: build_jar
image: maven:3.6.2-jdk-12
script:
- rm -r Main/src/main/resources/web/*
- mv chameleon-client/dist/* Main/src/main/resources/web
- cd Main
- mvn package
artifacts:
paths:
- Main/target
deploy:
stage: deploy
image: ubuntu:latest
before_script:
- apt-get update
- apt-get --yes install git ssh rsync
- git submodule update --init --recursive
script:
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- echo "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
- chmod 700 "${HOME}/.ssh/id_rsa"
- cd Main/target
- rsync -e "ssh -o StrictHostKeyChecking=no" $(find . -name "chameleon-vision-*") "${SSH_HOST_ADRESS}"