From 5c2dccde46914c7b35351836e7b144c4ccd5392e Mon Sep 17 00:00:00 2001 From: Chris Preston Date: Tue, 9 Apr 2024 15:42:00 -0700 Subject: [PATCH] Added settings.xml Added CI build components --- .github/{actions => workflows}/build-dev.yml | 9 +-- .../{actions => workflows}/build-package.yml | 7 +-- .github/workflows/underwriting-api-ci.yml | 16 ++++++ .../underwriting-listener-api-ci.yml | 16 ++++++ .github/workflows/underwriting-war-ci.yml | 16 ++++++ settings.xml | 56 +++++++++++++++++++ 6 files changed, 109 insertions(+), 11 deletions(-) rename .github/{actions => workflows}/build-dev.yml (66%) rename .github/{actions => workflows}/build-package.yml (89%) create mode 100644 .github/workflows/underwriting-api-ci.yml create mode 100644 .github/workflows/underwriting-listener-api-ci.yml create mode 100644 .github/workflows/underwriting-war-ci.yml create mode 100644 settings.xml diff --git a/.github/actions/build-dev.yml b/.github/workflows/build-dev.yml similarity index 66% rename from .github/actions/build-dev.yml rename to .github/workflows/build-dev.yml index 5385e55b..cd65f71c 100644 --- a/.github/actions/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -5,25 +5,22 @@ on: jobs: build-underwriting-api: - uses: ./.github/actions/build-package + uses: ./.github/workflows/build-package.yml secrets: inherit with: ENVIRONMENT: DEV MICROSERVICE_NAME: cirras-underwriting-api - VERSION_NUMBER: 1.0.0-SNAPSHOT build-underwriting-listener-api: - uses: ./.github/actions/build-package + uses: ./.github/workflows/build-package.yml secrets: inherit with: ENVIRONMENT: DEV MICROSERVICE_NAME: cirras-underwriting-listener-api - VERSION_NUMBER: 1.0.0-SNAPSHOT build-underwriting-war: - uses: ./.github/actions/build-package + uses: ./.github/workflows/build-package.yml secrets: inherit with: ENVIRONMENT: DEV MICROSERVICE_NAME: cirras-underwriting-war - VERSION_NUMBER: 1.0.0-SNAPSHOT diff --git a/.github/actions/build-package.yml b/.github/workflows/build-package.yml similarity index 89% rename from .github/actions/build-package.yml rename to .github/workflows/build-package.yml index fa61d828..64f98d37 100644 --- a/.github/actions/build-package.yml +++ b/.github/workflows/build-package.yml @@ -9,9 +9,6 @@ on: MICROSERVICE_NAME: required: true type: string - VERSION_NUMBER: - required: true - type: string env: DIRECTORY_SUFFIX: ${{ contains(inputs.MICROSERVICE_NAME, '-api') && '-rest-endpoints' || '' }} @@ -36,10 +33,10 @@ jobs: run: | export MAVEN_OPTS="-Xmx3072m -XX:MaxMetaspaceSize=512m" export NODE_OPTIONS="--max-old-space-size=4096" - mvn --batch-mode --update-snapshots -f ${{ inputs.MICROSERVICE_NAME }}/pom.xml -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }} package + mvn --settings=settings.xml --batch-mode --update-snapshots -f ${{ inputs.MICROSERVICE_NAME }}/pom.xml -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }} package - name: Copy files to neccessary folders - run: mkdir staging && cp ${{ inputs.MICROSERVICE_NAME }}/${{ inputs.MICROSERVICE_NAME }}${{ DIRECTORY_SUFFIX }}/target/*.war staging + run: mkdir staging && cp ${{ inputs.MICROSERVICE_NAME }}/${{ inputs.MICROSERVICE_NAME }}${{ env.DIRECTORY_SUFFIX }}/target/*.war staging - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/underwriting-api-ci.yml b/.github/workflows/underwriting-api-ci.yml new file mode 100644 index 00000000..54ef234f --- /dev/null +++ b/.github/workflows/underwriting-api-ci.yml @@ -0,0 +1,16 @@ +name: cirras-underwriting-api CI build + +on: + pull_request_target: + branches: + - main + paths: + - cirras-underwriting-api/** + +jobs: + build-underwriting-api: + uses: ./.github/actions/build-package.yml + secrets: inherit + with: + ENVIRONMENT: DEV + MICROSERVICE_NAME: cirras-underwriting-api diff --git a/.github/workflows/underwriting-listener-api-ci.yml b/.github/workflows/underwriting-listener-api-ci.yml new file mode 100644 index 00000000..2687a6da --- /dev/null +++ b/.github/workflows/underwriting-listener-api-ci.yml @@ -0,0 +1,16 @@ +name: cirras-underwriting-listener-api CI build + +on: + pull_request_target: + branches: + - main + paths: + - cirras-underwriting-listener-api/** + +jobs: + build-underwriting-listener-api: + uses: ./.github/actions/build-package.yml + secrets: inherit + with: + ENVIRONMENT: DEV + MICROSERVICE_NAME: cirras-underwriting-listener-api diff --git a/.github/workflows/underwriting-war-ci.yml b/.github/workflows/underwriting-war-ci.yml new file mode 100644 index 00000000..68773743 --- /dev/null +++ b/.github/workflows/underwriting-war-ci.yml @@ -0,0 +1,16 @@ +name: cirras-underwriting-war CI build + +on: + pull_request_target: + branches: + - main + paths: + - cirras-underwriting-war/** + +jobs: + build-underwriting-war: + uses: ./.github/actions/build-package.yml + secrets: inherit + with: + ENVIRONMENT: DEV + MICROSERVICE_NAME: cirras-underwriting-war diff --git a/settings.xml b/settings.xml new file mode 100644 index 00000000..5f905b9d --- /dev/null +++ b/settings.xml @@ -0,0 +1,56 @@ + + + + + ${repo.login} + ${repo.password} + central + + + ${repo.login} + ${repo.password} +snapshots + + + + + + + + false + + central + libs-release + https://bwa.nrs.gov.bc.ca/int/artifactory/libs-release + + + + snapshots + libs-snapshot + https://bwa.nrs.gov.bc.ca/int/artifactory/libs-snapshot + + + + + + false + + central + plugins-release + https://bwa.nrs.gov.bc.ca/int/artifactory/plugins-release + + + + snapshots + plugins-snapshot + https://bwa.nrs.gov.bc.ca/int/artifactory/plugins-snapshot + + +artifactory + + + + artifactory + + \ No newline at end of file