Merge branch 'circleci' into dev

This commit is contained in:
ori agranat
2019-11-20 00:07:08 +02:00
4 changed files with 82 additions and 59 deletions

76
.circleci/config.yml Normal file
View File

@@ -0,0 +1,76 @@
version: 2
jobs:
build_ui:
working_directory: ~/project/chameleon-client
docker:
- image: node:latest
steps:
- checkout:
path: ~/project
- run: npm install
- run: npm run build
- persist_to_workspace:
root: .
paths:
- dist
build_jar:
working_directory: ~/project/Main
docker:
- image: maven:3.6.2-jdk-12
steps:
- checkout:
path: ~/project
- attach_workspace:
at: /UI
- run: rm -rf src/main/resources/web/*
- run: cp -r /UI/dist/. src/main/resources/web/
- run: mvn package
- store_artifacts:
path: target/
- persist_to_workspace:
root: ./target
paths:
- .
deploy:
docker:
- image: cibuilds/github:0.10
steps:
- attach_workspace:
at: ./
- run:
name: Publish Release on GitHub"
command: |
VERSION=$(find . -name 'chameleon-vision-*.jar' | sed 's/.*chameleon-vision-//; s/.jar//' )
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./$(find . -name "chameleon-vision-*")
workflows:
version: 2
release:
jobs:
- build_ui:
filters:
branches:
only:
- master
- dev
- build_jar:
requires:
- build_ui
filters:
branches:
only:
- master
- dev
- deploy:
requires:
- build_jar
filters:
branches:
only: master

6
.gitignore vendored
View File

@@ -111,3 +111,9 @@ Main/target
New client/chameleon-client/node_modules/
Main/dependency-reduced-pom.xml
Main/src/main/java/META-INF
Main/.settings/org.eclipse.jdt.core.prefs
Main/.classpath
Main/.project

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}"

View File

@@ -1,9 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
org.eclipse.jdt.core.compiler.compliance=12
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=12