mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 12:40:44 +00:00
188 lines
5.0 KiB
YAML
188 lines
5.0 KiB
YAML
version: 2.1
|
|
|
|
orbs:
|
|
localstack: localstack/platform@2.1
|
|
browser-tools: circleci/browser-tools@1.4.7
|
|
|
|
commands:
|
|
mvn_build:
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "pom.xml" }}
|
|
- browser-tools/install-chrome
|
|
- browser-tools/install-chromedriver
|
|
- run:
|
|
name: Write .env
|
|
command: |
|
|
echo "RDBMS_PASSWORD=$RDBMS_PASSWORD" >> qqq-sample-project/.env
|
|
- run:
|
|
name: Run Maven Compile
|
|
command: |
|
|
mvn -s .circleci/mvn-settings.xml -T4 --no-transfer-progress compile
|
|
- save_cache:
|
|
paths:
|
|
- ~/.m2
|
|
key: v1-dependencies-{{ checksum "pom.xml" }}
|
|
|
|
mvn_verify:
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "pom.xml" }}
|
|
- run:
|
|
name: Run Maven Verify
|
|
command: |
|
|
mvn -s .circleci/mvn-settings.xml -T4 --no-transfer-progress verify
|
|
- run:
|
|
name: Collect JaCoCo reports
|
|
command: .circleci/collect-jacoco-reports.sh
|
|
when: always
|
|
- store_artifacts:
|
|
path: /home/circleci/jacoco-reports
|
|
destination: jacoco-reports
|
|
when: always
|
|
- run:
|
|
name: Concatenate test output files
|
|
command: .circleci/concatenate-test-output.sh
|
|
when: always
|
|
- store_artifacts:
|
|
path: /home/circleci/test-output-artifacts
|
|
destination: test-output
|
|
when: always
|
|
- run:
|
|
name: Save test results
|
|
command: |
|
|
mkdir -p ~/test-results/junit/
|
|
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
|
|
when: always
|
|
- store_test_results:
|
|
path: ~/test-results
|
|
|
|
check_middleware_api_versions:
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "pom.xml" }}
|
|
- run:
|
|
name: Build and Run ValidateApiVersions
|
|
command: |
|
|
mvn -s .circleci/mvn-settings.xml -T4 --no-transfer-progress install -DskipTests
|
|
mvn -s .circleci/mvn-settings.xml -T4 --no-transfer-progress -pl qqq-middleware-javalin package appassembler:assemble -DskipTests
|
|
qqq-middleware-javalin/target/appassembler/bin/ValidateApiVersions -r $(pwd)
|
|
|
|
mvn_jar_deploy:
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Adjust pom version
|
|
command: |
|
|
.circleci/adjust-pom-version.sh
|
|
- restore_cache:
|
|
keys:
|
|
- v1-dependencies-{{ checksum "pom.xml" }}
|
|
- run:
|
|
name: Run Maven Jar Deploy
|
|
command: |
|
|
mvn -s .circleci/mvn-settings.xml -T4 --no-transfer-progress flatten:flatten jar:jar deploy:deploy
|
|
- save_cache:
|
|
paths:
|
|
- ~/.m2
|
|
key: v1-dependencies-{{ checksum "pom.xml" }}
|
|
|
|
install_asciidoctor:
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install asciidoctor
|
|
command: |
|
|
sudo apt-get update
|
|
sudo apt install -y asciidoctor
|
|
|
|
run_asciidoctor:
|
|
steps:
|
|
- run:
|
|
name: Run asciidoctor
|
|
command: |
|
|
cd docs
|
|
asciidoctor -a docinfo=shared index.adoc
|
|
- store_artifacts:
|
|
path: docs/index.html
|
|
when: always
|
|
|
|
jobs:
|
|
build:
|
|
executor: localstack/default
|
|
steps:
|
|
- mvn_build
|
|
|
|
test:
|
|
executor: localstack/default
|
|
steps:
|
|
- mvn_verify
|
|
|
|
api_version_check:
|
|
executor: localstack/default
|
|
steps:
|
|
- check_middleware_api_versions
|
|
|
|
mvn_deploy:
|
|
executor: localstack/default
|
|
steps:
|
|
- mvn_build
|
|
- mvn_verify
|
|
- check_middleware_api_versions
|
|
- mvn_jar_deploy
|
|
|
|
publish_asciidoc:
|
|
executor: localstack/default
|
|
steps:
|
|
- install_asciidoctor
|
|
- run_asciidoctor
|
|
|
|
workflows:
|
|
test_only:
|
|
jobs:
|
|
- build:
|
|
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
|
|
filters:
|
|
branches:
|
|
ignore: /(dev|integration.*)/
|
|
tags:
|
|
ignore: /(version|snapshot)-.*/
|
|
- test:
|
|
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
ignore: /(dev|integration.*)/
|
|
tags:
|
|
ignore: /(version|snapshot)-.*/
|
|
- api_version_check:
|
|
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
ignore: /(dev|integration.*)/
|
|
tags:
|
|
ignore: /(version|snapshot)-.*/
|
|
|
|
deploy:
|
|
jobs:
|
|
- mvn_deploy:
|
|
context: [ qqq-maven-registry-credentials, build-qqq-sample-app ]
|
|
filters:
|
|
branches:
|
|
only: /(dev|integration.*)/
|
|
tags:
|
|
only: /(version|snapshot)-.*/
|
|
- publish_asciidoc:
|
|
filters:
|
|
branches:
|
|
only: /dev/
|