Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven multi module #359 #400

Merged
merged 7 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
version: 2

references:
workspace_root: &workspace_root
/tmp/workspace
workspace_root: &workspace_root /tmp/workspace
apeksharma marked this conversation as resolved.
Show resolved Hide resolved
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root
package_mirror_node: &package_mirror_node
package_mirror_importer: &package_mirror_importer
run:
name: Generating mirror-node.tgz
name: Generating mirror-importer.tgz
working_directory: /tmp/workspace/
command: |
_tagged_dir=mirror-node-${CIRCLE_TAG:-b$CIRCLE_BUILD_NUM}
mv mirror-node "${_tagged_dir}"
tar -czf /tmp/workspace/mirror-node.tgz "${_tagged_dir}"
_tagged_dir=mirror-importer-${CIRCLE_TAG:-b$CIRCLE_BUILD_NUM}
mv mirror-importer "${_tagged_dir}"
tar -czf /tmp/workspace/mirror-importer.tgz "${_tagged_dir}"
apeksharma marked this conversation as resolved.
Show resolved Hide resolved

workflows:
version: 2
main:
jobs:
- build_mirror_node:
- build_mirror_importer:
filters: # required since `release_artifacts` has tag filters AND requires `this`
branches:
only: /.*/
Expand All @@ -33,7 +32,7 @@ workflows:
only: /.*/
- release_artifacts:
requires:
- build_mirror_node
- build_mirror_importer
- build_rest_api
filters:
branches:
Expand All @@ -42,7 +41,7 @@ workflows:
only: /^v.*/

jobs:
build_mirror_node:
build_mirror_importer:
docker:
- image: adoptopenjdk:11-jdk-hotspot
- image: postgres:9.6-alpine
Expand All @@ -54,31 +53,32 @@ jobs:
- checkout
- restore_cache:
keys:
- maven-v1-{{ .Branch }}-{{ checksum "pom.xml" }}-{{ checksum "mirror-importer/pom.xml" }}
- maven-v1-{{ .Branch }}-{{ checksum "pom.xml" }}
- maven-v1-{{ .Branch }}
- maven-v1-
- run:
name: Running maven (validate, compile, test, package)
command: ./mvnw package
command: ./mvnw package -pl mirror-importer -am
- save_cache:
key: maven-v1-{{ .Branch }}-{{ checksum "pom.xml" }}
key: maven-v1-{{ .Branch }}-{{ checksum "pom.xml" }}-{{ checksum "mirror-importer/pom.xml" }}
paths:
- ~/.m2
- ~/.m2
- store_test_results:
path: target/surefire-reports
path: mirror-importer/target/surefire-reports
- run:
name: Upload Code Coverage
command: bash <(curl -s https://codecov.io/bash)
- run:
name: Collecting mirror-node assets
name: Collecting mirror-importer assets
command: |
mkdir -p /tmp/workspace/mirror-node/
mv target/mirror-node-*.jar /tmp/workspace/mirror-node/mirror-node.jar
mv scripts /tmp/workspace/mirror-node/
mkdir -p /tmp/workspace/mirror-importer/
mv mirror-importer/target/mirror-importer-*.jar /tmp/workspace/mirror-importer/mirror-importer.jar
mv mirror-importer/scripts /tmp/workspace/mirror-importer/
- persist_to_workspace:
root: *workspace_root
paths:
- mirror-node
- mirror-importer

build_rest_api:
docker:
Expand All @@ -92,30 +92,30 @@ jobs:
- checkout:
- restore_cache:
keys:
- npm-v1-{{ .Branch }}-{{ checksum "rest-api/package-lock.json" }}
- npm-v1-{{ .Branch }}-{{ checksum "mirror-api-rest/rest-api/package-lock.json" }}
- npm-v1-{{ .Branch }}
- npm-v1-
- run:
working_directory: 'rest-api'
working_directory: "mirror-api-rest/rest-api"
apeksharma marked this conversation as resolved.
Show resolved Hide resolved
name: Run npm ci (ensure node_modules is based on package-lock.json).
command: npm ci
- save_cache:
key: npm-v1-{{ .Branch }}-{{ checksum "rest-api/package-lock.json" }}
key: npm-v1-{{ .Branch }}-{{ checksum "mirror-api-rest/rest-api/package-lock.json" }}
paths:
- node_modules
- .node-flywaydb
- ~/.npm
- run:
working_directory: 'rest-api'
working_directory: "mirror-api-rest/rest-api"
name: Run npm test
command: npm test
environment:
TEST_DB_HOST: '127.0.0.1'
TEST_DB_NAME: 'mirror_node_integration'
TEST_DB_HOST: "127.0.0.1"
TEST_DB_NAME: "mirror_node_integration"
- store_test_results:
path: rest-api/target/jest-junit
path: mirror-api-rest/rest-api/target/jest-junit
- run:
working_directory: 'rest-api'
working_directory: "mirror-api-rest/rest-api"
name: Collecting rest-api assets
command: |
npm pack
Expand All @@ -131,8 +131,12 @@ jobs:
- image: adoptopenjdk:11-jdk-hotspot
steps:
- *attach_workspace
- *package_mirror_node
- *package_mirror_importer
- store_artifacts:
path: /tmp/workspace/mirror-node.tgz
path: /tmp/workspace/mirror-importer.tgz
- store_artifacts:
path: /tmp/workspace/rest-api.tgz

dependencies:
apeksharma marked this conversation as resolved.
Show resolved Hide resolved
override:
- mvn install -DskipTests
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
*/target/**
apeksharma marked this conversation as resolved.
Show resolved Hide resolved
.project
/data/
mirror-importer/data/
.classpath
output/
/db/
Expand Down
Loading