circle ci test

This commit is contained in:
ori agranat
2019-11-18 21:52:37 +02:00
parent a0d180d538
commit a325e9680e
2 changed files with 30 additions and 50 deletions

30
.circleci/.config.yml Normal file
View File

@@ -0,0 +1,30 @@
version: 2.1
jobs:
build_ui:
docker:
- image: node:latest
steps:
- checkout
- run:
name: changing directory
command: |
cd chameleon-client
- run:
name: installing dependencies
command: |
npm install
- run:
name: building ui
command: |
npm run build
- store_artifacts:
path: chameleon-client/dist
build_jar:
docker:
- image: maven:3.6.2-jdk-12
steps:
- run: rm -r Main/src/main/resources/web/*
- run: mv chameleon-client/dist/* Main/src/main/resources/web
- run: cd Main
- run: mvn package

View File

@@ -1,50 +0,0 @@
stages:
- build_ui
- build_jar
- deploy
build_ui:
stage: build_ui
image: node:latest
only:
refs:
- master
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
only:
refs:
- master
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
only:
refs:
- master
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}"