From a968595852c6a49c3a52cbcba9bd874a6cba2b72 Mon Sep 17 00:00:00 2001 From: Thomas Bouron Date: Thu, 14 Mar 2024 12:34:41 +0100 Subject: [PATCH] Update CircleCI configuration --- .circleci/config.yaml | 42 -------------------- .circleci/config.yml | 83 +++++++++++++-------------------------- .circleci/m2-settings.xml | 42 ++++++++++++++++++++ .circleci/settings.xml | 49 ----------------------- pom.xml | 28 +++++++++++-- 5 files changed, 95 insertions(+), 149 deletions(-) delete mode 100644 .circleci/config.yaml create mode 100644 .circleci/m2-settings.xml delete mode 100644 .circleci/settings.xml diff --git a/.circleci/config.yaml b/.circleci/config.yaml deleted file mode 100644 index 336366e..0000000 --- a/.circleci/config.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Java Maven CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-java/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/openjdk:8-jdk - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - environment: - # Customize the JVM maximum heap limit - MAVEN_OPTS: -Xmx3200m - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "pom.xml" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: mvn dependency:go-offline - - - save_cache: - paths: - - ~/.m2 - key: v1-dependencies-{{ checksum "pom.xml" }} - - # run tests! - - run: mvn package - diff --git a/.circleci/config.yml b/.circleci/config.yml index 27ceafe..3962746 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,66 +1,39 @@ -# Base build parameters -base_build: &base_build - working_directory: ~/repo - docker: - - image: circleci/openjdk:8-jdk - environment: - MAVEN_OPTS: -Xmx3200m +version: 2.1 -# Base steps for maven project -base_restore_cache: &base_restore_cache - restore_cache: - keys: - - v1-dependencies-{{ checksum "pom.xml" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- +orbs: + maven: circleci/maven@1.4.1 -base_save_cache: &base_save_cache - save_cache: - paths: - - ~/.m2 - key: v1-dependencies-{{ checksum "pom.xml" }} +executors: + openjdk8: + docker: + - image: cimg/openjdk:8.0 -# Jobs definitions -version: 2 -jobs: - build: - <<: *base_build - - steps: - - checkout - - *base_restore_cache - - run: mvn dependency:go-offline - - *base_save_cache - # run tests! - - run: mvn clean install - - deploy: - <<: *base_build - - steps: - - checkout - - *base_restore_cache - - run: mvn dependency:go-offline - - *base_save_cache - # Import key in GPG - - run: echo $GPG_SECRET_KEY | base64 --decode | $GPG_EXECUTABLE --batch --import - # Deploy to sonatype - - run: mvn clean deploy -DskipTests -DdeployTo=sonatype --settings .circleci/settings.xml - -# Workflow definitions workflows: - version: 2 - deploy_sonatype: + build-and-deploy: jobs: - - build - # If we are on master or a release branch, we deploy directly to sonatype. Release version will still need manual - # approval via sonatype UI: https://oss.sonatype.org/#stagingRepositories - - deploy: - context: org-global + - maven/test: + name: build + executor: openjdk8 + filters: + branches: + only: + - master + - /release\/.*/ + settings_file: .circleci/m2-settings.xml + verify_dependencies: false + - maven/test: + name: deploy + executor: openjdk8 requires: - build + context: + - org-global + - cloudsoft-artifactory filters: branches: only: - master - - /^release\/.*$/ + - /release\/.*/ + settings_file: .circleci/m2-settings.xml + command: deploy -DskipTests -P cloudsoft-release + verify_dependencies: false \ No newline at end of file diff --git a/.circleci/m2-settings.xml b/.circleci/m2-settings.xml new file mode 100644 index 0000000..ea1c53d --- /dev/null +++ b/.circleci/m2-settings.xml @@ -0,0 +1,42 @@ + + + + cloudsoft-deploy-artifactory-snapshot + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + + + cloudsoft-deploy-artifactory-release + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + + + + cloudsoft-snapshots + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + + + cloudsoft-releases + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + + + cloudsoft-artifactory-repo + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + + + + sonatype-nexus-staging + ${env.SONATYPE_USER} + ${env.SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${env.SONATYPE_USER} + ${env.SONATYPE_PASSWORD} + + + \ No newline at end of file diff --git a/.circleci/settings.xml b/.circleci/settings.xml deleted file mode 100644 index 90eade1..0000000 --- a/.circleci/settings.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - sonatype-nexus-snapshots - ${env.SONATYPE_USER} - ${env.SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${env.SONATYPE_USER} - ${env.SONATYPE_PASSWORD} - - - - - - sonatype-nexus-repo - - ${env.GPG_EXECUTABLE} - ${env.GPG_SECRET_KEY} - ${env.GPG_PASSPHRASE} - - - - sonatype-nexus-staging - Nexus Release Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - true - - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - - - - - - - - sonatype-nexus-repo - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index ab82f27..39d06ef 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ 1.4 3.3.0 2.8.2 + 3.2.0 @@ -159,7 +160,7 @@ - sonatype-nexus-repo + sonatype-release deployTo @@ -194,8 +195,8 @@ sign - ${gpg.secret.key} - ${gpg.passphrase} + ${env.GPG_SECRET_KEY} + ${env.GPG_PASSPHRASE} --pinentry-mode loopback @@ -207,6 +208,27 @@ + + cloudsoft-release + + + brooklyn.deployTo + cloudsoftArtifactory + + + + + cloudsoft-deploy-artifactory-release + Cloudsoft Artifactory libs-release-local repo + https://artifactory.cloudsoftcorp.com/artifactory/libs-release-local/ + + + cloudsoft-deploy-artifactory-snapshot + Cloudsoft Artifactory libs-snapshot-local repo + https://artifactory.cloudsoftcorp.com/artifactory/libs-snapshot-local/ + + +