-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better micro-infrastructure with Gradle composite builds (#146)
- Loading branch information
Showing
138 changed files
with
19,105 additions
and
2,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: common-check | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- 'common/**' | ||
|
||
env: | ||
JAVA_VERSION: "15" | ||
JAVA_DISTRIBUTION: "zulu" | ||
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }} | ||
GCP_SA_KEY_APP: ${{ secrets.GCP_SA_KEY_APP }} | ||
MONITORING_SLACK_URL: ${{ secrets.MONITORING_SLACK_URL }} | ||
|
||
jobs: | ||
common-check-build: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-common-check-build | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./common/infra/credentials-gcp-infra.json | ||
echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json | ||
echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties | ||
- name: Build project | ||
run: | | ||
set -o pipefail && | ||
cd common && | ||
./gradlew --no-daemon assemble && | ||
cd .. | ||
- name: Preview infrastructure | ||
uses: pulumi/actions@v5 | ||
with: | ||
command: preview | ||
stack-name: prod | ||
work-dir: common/infra | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Build | ||
path: | | ||
**/build | ||
**/secrets.properties | ||
common/infra | ||
common-check-test: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-common-check-test | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./common/infra/credentials-gcp-infra.json | ||
echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json | ||
echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties | ||
- name: Test | ||
run: | | ||
set -o pipefail && | ||
cd common && | ||
./gradlew --no-daemon --continue jsTest && | ||
cd .. | ||
- name: Generate test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() # Ensure all test reports are collected, even after errors | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
check_name: 'common-check-test-results' | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Tests | ||
path: '**/build/test-results/**/TEST-*.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: common-deploy | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- 'common/**' | ||
|
||
env: | ||
JAVA_VERSION: "15" | ||
JAVA_DISTRIBUTION: "zulu" | ||
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }} | ||
GCP_SA_KEY_APP: ${{ secrets.GCP_SA_KEY_APP }} | ||
MONITORING_SLACK_URL: ${{ secrets.MONITORING_SLACK_URL }} | ||
|
||
jobs: | ||
common-deploy-build: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-common-deploy-build | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./common/infra/credentials-gcp-infra.json | ||
echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json | ||
echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties | ||
- name: Build project | ||
run: | | ||
set -o pipefail && | ||
cd common && | ||
./gradlew --no-daemon assemble && | ||
cd .. | ||
- name: Deploy infrastructure | ||
uses: pulumi/actions@v5 | ||
with: | ||
command: up | ||
stack-name: prod | ||
work-dir: common/infra | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Build | ||
path: | | ||
**/build | ||
**/secrets.properties | ||
common/infra | ||
common-deploy-test: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-common-deploy-test | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./common/infra/credentials-gcp-infra.json | ||
echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json | ||
echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties | ||
- name: Test | ||
run: | | ||
set -o pipefail && | ||
cd common && | ||
./gradlew --no-daemon --continue jsTest && | ||
cd .. | ||
- name: Generate test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() # Ensure all test reports are collected, even after errors | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
check_name: 'common-deploy-test-results' | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Tests | ||
path: '**/build/test-results/**/TEST-*.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: landing-page-web-service-check | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- 'landing-page-web/**' | ||
|
||
env: | ||
JAVA_VERSION: "15" | ||
JAVA_DISTRIBUTION: "zulu" | ||
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }} | ||
|
||
jobs: | ||
landing-page-web-service-check-build: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-landing-page-web-service-check-build | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./landing-page-web/infra/credentials-gcp-infra.json | ||
- name: Build project | ||
run: | | ||
set -o pipefail && | ||
cd landing-page-web && | ||
./gradlew --no-daemon assemble && | ||
cd .. | ||
- name: Build container images | ||
run: | | ||
set -o pipefail && | ||
docker compose -f docker/landing-page-web-service-compose.yaml build | ||
- name: Preview infrastructure | ||
uses: pulumi/actions@v5 | ||
with: | ||
command: preview | ||
stack-name: prod | ||
work-dir: landing-page-web/infra | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Build | ||
path: | | ||
**/build | ||
**/secrets.properties | ||
landing-page-web/infra | ||
landing-page-web-service-check-test: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-landing-page-web-service-check-test | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./landing-page-web/infra/credentials-gcp-infra.json | ||
- name: Test | ||
run: | | ||
set -o pipefail && | ||
cd landing-page-web && | ||
./gradlew --no-daemon --continue jsTest && | ||
cd .. | ||
- name: Generate test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() # Ensure all test reports are collected, even after errors | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
check_name: 'landing-page-web-service-check-test-results' | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Tests | ||
path: '**/build/test-results/**/TEST-*.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: landing-page-web-service-deploy | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- 'landing-page-web/**' | ||
|
||
env: | ||
JAVA_VERSION: "15" | ||
JAVA_DISTRIBUTION: "zulu" | ||
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }} | ||
|
||
jobs: | ||
landing-page-web-service-deploy-build: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-landing-page-web-service-deploy-build | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./landing-page-web/infra/credentials-gcp-infra.json | ||
- name: Build project | ||
run: | | ||
set -o pipefail && | ||
cd landing-page-web && | ||
./gradlew --no-daemon assemble && | ||
cd .. | ||
- name: Deploy infrastructure | ||
uses: pulumi/actions@v5 | ||
with: | ||
command: up | ||
stack-name: prod | ||
work-dir: landing-page-web/infra | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Build | ||
path: | | ||
**/build | ||
**/secrets.properties | ||
landing-page-web/infra | ||
landing-page-web-service-deploy-test: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.ref }}-landing-page-web-service-deploy-test | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch | ||
- name: Set up secrets | ||
run: | | ||
echo "$GCP_SA_KEY_INFRA" >> ./landing-page-web/infra/credentials-gcp-infra.json | ||
- name: Test | ||
run: | | ||
set -o pipefail && | ||
cd landing-page-web && | ||
./gradlew --no-daemon --continue jsTest && | ||
cd .. | ||
- name: Generate test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() # Ensure all test reports are collected, even after errors | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
check_name: 'landing-page-web-service-deploy-test-results' | ||
- name: Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() # Ensure all artifacts are collected, even after errors | ||
with: | ||
name: Tests | ||
path: '**/build/test-results/**/TEST-*.xml' |
Oops, something went wrong.