diff --git a/.circleci/circleci-m2-settings.xml b/.circleci/circleci-m2-settings.xml new file mode 100644 index 00000000..ea1c53da --- /dev/null +++ b/.circleci/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/config.yml b/.circleci/config.yml index b2068e29..0c309ad8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,36 +1,59 @@ -# Java Maven CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-java/ for more details -# -version: 2 +version: 2.1 + +executors: + openjdk8: + docker: + - image: cimg/openjdk:8.0 + jobs: build: - docker: - # specify the version you desire here - - image: circleci/openjdk:8-jdk - working_directory: ~/repo - - environment: - # Customize the JVM maximum heap limit - MAVEN_OPTS: -Xmx3200m - + executor: openjdk8 + 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 + - run: + name: Build + command: mvn -s .circleci/circleci-m2-settings.xml clean install - save_cache: paths: - ~/.m2 key: v1-dependencies-{{ checksum "pom.xml" }} - - # run tests! - - run: mvn integration-test + deploy: + executor: openjdk8 + + steps: + - checkout + + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + - v1-dependencies- + + - run: + name: Deploy + command: mvn -s .circleci/circleci-m2-settings.xml clean deploy -P cloudsoft-release -P sonatype-release + +workflows: + build-and-deploy: + jobs: + - build: + filters: + branches: + only: master + - deploy: + requires: + - build + context: + - org-global + - cloudsoft-artifactory + filters: + branches: + only: master