Skip to content

Commit

Permalink
Merge pull request #17 from bcgov/main
Browse files Browse the repository at this point in the history
update from main
  • Loading branch information
vivid-cpreston authored Oct 25, 2023
2 parents 63fdc27 + bf497b3 commit b617858
Show file tree
Hide file tree
Showing 40 changed files with 23,334 additions and 3,557 deletions.
41 changes: 28 additions & 13 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: deploy_dev

# Controls when the action will run.
on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
tags: [deploy-dev*]
Expand All @@ -13,6 +14,9 @@ env:
TG_VERSION: 0.29.2
TARGET_ENV: dev

permissions:
id-token: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
Expand All @@ -31,10 +35,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

#Compile lambda functions
Expand All @@ -45,24 +49,36 @@ jobs:
mvn --batch-mode install -f wfdm-file-index-initializer/pom.xml
mvn --batch-mode install -f wfdm-file-index-service/pom.xml
- name: Make directory and copy in jar files
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';'
- name: Create zip file structure
run: |
mkdir java
mkdir java/lib
find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm/aws-lambda-layer-base -name *.jar -exec mv {} ./java/lib/aws-lambda-layer-base.jar \;
- uses: montudor/action-zip@v1
with:
args: zip -qq -r java.zip java

- name: Make directory, copy in jar files and zip file
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';' && cp java.zip staging/java.zip

- name: Get source code hash of jar files
run: |
openssl sha256 staging/wfdm-clamav-scan-handler* > staging/wfdm-clamav-scan-handler-hash.txt
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-dev --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand All @@ -83,4 +99,3 @@ jobs:
opensearch_password: ${{ secrets.OPENSEARCH_PASSWORD_DEV }}
opensearch_user: ${{ secrets.OPENSEARCH_USER_DEV }}
run: terragrunt run-all apply --terragrunt-non-interactive
#run: terragrunt run-all plan --terragrunt-non-interactive
36 changes: 24 additions & 12 deletions .github/workflows/deploy_dlv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

#Compile lambda functions
Expand All @@ -45,24 +45,36 @@ jobs:
mvn --batch-mode install -f wfdm-file-index-initializer/pom.xml
mvn --batch-mode install -f wfdm-file-index-service/pom.xml
- name: Make directory and copy in jar files
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';'
- name: Create zip file structure
run: |
mkdir java
mkdir java/lib
find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm/aws-lambda-layer-base -name *.jar -exec mv {} ./java/lib/aws-lambda-layer-base.jar \;
- uses: montudor/action-zip@v1
with:
args: zip -qq -r java.zip java

- name: Make directory, copy in jar files and zip file
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';' && cp java.zip staging/java.zip

- name: Get source code hash of jar files
run: |
openssl sha256 staging/wfdm-clamav-scan-handler* > staging/wfdm-clamav-scan-handler-hash.txt
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-dlv --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand Down
55 changes: 40 additions & 15 deletions .github/workflows/deploy_int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ name: deploy_int

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
tags: [deploy-int*]
pull_request_target:
types:
- closed
branches:
- 'main'
paths:
- .github/**
- aws-lambda-layer-base/**
- terraform/**
- terragrunt/**
- wfdm-file-scan-service/**
- wfdm-clamav-service/**
- wfdm-file-index-initializer/**
- wfdm-file-index-service/**
- wfdm-file-reindexer/**


env:
TF_VERSION: 1.1.0
Expand All @@ -31,10 +44,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

#Compile lambda functions
Expand All @@ -45,24 +58,36 @@ jobs:
mvn --batch-mode install -f wfdm-file-index-initializer/pom.xml
mvn --batch-mode install -f wfdm-file-index-service/pom.xml
- name: Make directory and copy in jar files
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';'
- name: Create zip file structure
run: |
mkdir java
mkdir java/lib
find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm/aws-lambda-layer-base -name *.jar -exec mv {} ./java/lib/aws-lambda-layer-base.jar \;
- uses: montudor/action-zip@v1
with:
args: zip -qq -r java.zip java

- name: Make directory, copy in jar files and zip file
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';' && cp java.zip staging/java.zip

- name: Get source code hash of jar files
run: |
openssl sha256 staging/wfdm-clamav-scan-handler* > staging/wfdm-clamav-scan-handler-hash.txt
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-int --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand Down
41 changes: 26 additions & 15 deletions .github/workflows/deploy_prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: deploy_prd

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
tags: [deploy-prd*]
release:
types: [released]

env:
TF_VERSION: 1.1.0
Expand All @@ -31,10 +30,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

#Compile lambda functions
Expand All @@ -45,24 +44,36 @@ jobs:
mvn --batch-mode install -f wfdm-file-index-initializer/pom.xml
mvn --batch-mode install -f wfdm-file-index-service/pom.xml
- name: Make directory and copy in jar files
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';'
- name: Create zip file structure
run: |
mkdir java
mkdir java/lib
find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm/aws-lambda-layer-base -name *.jar -exec mv {} ./java/lib/aws-lambda-layer-base.jar \;
- uses: montudor/action-zip@v1
with:
args: zip -qq -r java.zip java

- name: Make directory, copy in jar files and zip file
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';' && cp java.zip staging/java.zip

- name: Get source code hash of jar files
run: |
openssl sha256 staging/wfdm-clamav-scan-handler* > staging/wfdm-clamav-scan-handler-hash.txt
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-prd --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand Down
41 changes: 26 additions & 15 deletions .github/workflows/deploy_tst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ name: deploy_tst

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
tags: [deploy-tst*]
release:
types: [prereleased]

env:
TF_VERSION: 1.1.0
Expand All @@ -31,10 +30,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

#Compile lambda functions
Expand All @@ -45,24 +44,36 @@ jobs:
mvn --batch-mode install -f wfdm-file-index-initializer/pom.xml
mvn --batch-mode install -f wfdm-file-index-service/pom.xml
- name: Make directory and copy in jar files
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';'
- name: Create zip file structure
run: |
mkdir java
mkdir java/lib
find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm/aws-lambda-layer-base -name *.jar -exec mv {} ./java/lib/aws-lambda-layer-base.jar \;
- uses: montudor/action-zip@v1
with:
args: zip -qq -r java.zip java

- name: Make directory, copy in jar files and zip file
run: mkdir staging && find /home/runner/.m2/repository/ca/bc/gov/nrs/wfdm -name '*.jar' -exec cp -prv '{}' 'staging' ';' && cp java.zip staging/java.zip

- name: Get source code hash of jar files
run: |
openssl sha256 staging/wfdm-clamav-scan-handler* > staging/wfdm-clamav-scan-handler-hash.txt
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-tst --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand Down
Loading

0 comments on commit b617858

Please sign in to comment.