Skip to content

Commit

Permalink
update to add merge support from release-2.x to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Feb 15, 2024
1 parent 0e1b24c commit 8c2dc1e
Showing 1 changed file with 71 additions and 18 deletions.
89 changes: 71 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,47 @@ executors:

orbs:
sign-packages: opennms/sign-packages@2.1.3
branch-management: opennms/branch-management@2.3.0

commands:
shallow-clone:
description: "Quick shallow checkout (if possible)"
steps:
- run:
name: git clone
command: |
install -d -m 700 ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-keyscan -p 443 ssh.github.com >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
git clone --no-checkout --filter=tree:0 "${CIRCLE_REPOSITORY_URL}" .
if [ -n "${CIRCLE_TAG}" ]; then
git checkout --force "${CIRCLE_TAG}"
git reset --hard "${CIRCLE_SHA1}"
else
git checkout --force -B "${CIRCLE_BRANCH}" "${CIRCLE_SHA1}"
fi
build:
description: "Build Cortex Plugin"
steps:
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Compile source without tests
command: |
mvn -DskipITs=true -DskipTests=true clean install
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- persist_to_workspace:
root: ~/
paths:
- .m2
- project

workflows:
build-deploy:
Expand All @@ -20,6 +61,13 @@ workflows:
- tests:
requires:
- build
- merge:
requires:
- tests
filters:
branches:
only:
- /^release-.*/
- deploy:
context:
- OSSRH Principal
Expand All @@ -37,24 +85,7 @@ jobs:
executor: build-executor
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Compile source without tests
command: |
mvn -DskipITs=true -DskipTests=true clean install
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- persist_to_workspace:
root: ~/
paths:
- .m2
- project
- build

tests:
executor: system-test-executor
Expand All @@ -76,6 +107,28 @@ jobs:
- store_test_results:
path: ~/junit

merge:
executor: build-executor

steps:
- add_ssh_keys:
fingerprints:
- "27:c8:b4:c2:27:cf:78:ae:5f:1f:3a:ee:d7:bb:e8:ca"

- shallow-clone
- branch-management/merge-branch:
committer_email: "cicd-system@opennms.com"
committer_name: "CI/CD System"
from: release-2.x
to: master

# make sure the build passes after merge
- build

- run:
name: "Push to Master"
command: git push --no-verify origin master:master

deploy:
executor: build-executor
steps:
Expand Down

0 comments on commit 8c2dc1e

Please sign in to comment.