-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlink build and release workflows from internal distribution process #261
Merged
dpotyralski
merged 3 commits into
main
from
feature/devx-2677-create-a-repo-specific-build-and-release-workflows-for-prop
Jul 9, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
version: v34.10.1 | ||
|
||
files: | ||
- .github/workflows/build-and-test.yaml | ||
- .github/workflows/codeql-analysis.yaml | ||
- .github/workflows/pr-help.yaml | ||
- .github/workflows/release.yaml | ||
- .github/workflows/renovate_dependency_management.yaml | ||
- .autorc.json | ||
- .github/.kodiak.toml | ||
|
||
values: | ||
sendOpsLevelDeployNotifications: true | ||
deploymentEnabled: false | ||
runWizCliDepsScan: false | ||
renovateCronjobSchedule: '25 6 * * 1-5' # This is UTC -> At 07:25 CET / 08:25 CEST on every day-of-week from Monday through Friday. |
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
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 |
---|---|---|
|
@@ -20,12 +20,7 @@ env: | |
publishNodeOpenAPIClient: true | ||
publishTypeScriptFrontendModels: false | ||
publishAdditionalProjects: false | ||
deploymentEnabled: false | ||
environmentTenant: product | ||
productionDeploymentEnabled: true | ||
generateChangelogUpdate: true | ||
forceReleaseOpenAPIDocument: | ||
RUN_WIZCLI_CONTAINER_SCAN: true | ||
|
||
jobs: | ||
determine-version: | ||
|
@@ -414,201 +409,3 @@ jobs: | |
SLACK_USERNAME: GitHub Actions | ||
SLACK_ICON_EMOJI: ":crashingrocket:" | ||
SLACK_FOOTER: "" | ||
|
||
publish-docker-image: | ||
name: Publish Docker image | ||
runs-on: ubuntu-latest-8-cores | ||
permissions: | ||
id-token: write | ||
contents: read | ||
timeout-minutes: 30 | ||
steps: | ||
# Checkout the code to publish. | ||
- name: Checkout code | ||
if: env.deploymentEnabled == 'true' | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
# Setup a JDK environment for running Gradle publishing tasks. | ||
- name: Setup JDK 17 | ||
if: env.deploymentEnabled == 'true' | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
# Build the project and generate Docker Image | ||
- name: Build project (Gradle) | ||
if: env.deploymentEnabled == 'true' | ||
run: ./gradlew build -x test --stacktrace | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_GRADLE_TOKEN }} | ||
GRADLE_USER: ${{ secrets.GITHUB_ACTOR }} | ||
GRADLE_READ_KEY: ${{ secrets.GH_REGISTRY_GRADLE_TOKEN }} | ||
JOB_RUNR_REPO_PASSWORD: ${{ secrets.JOB_RUNR_REPO_PASSWORD }} | ||
|
||
# Login to DockerHub for fetching and pushing Docker images. | ||
- name: Login to DockerHub | ||
if: env.deploymentEnabled == 'true' | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | ||
with: | ||
username: pleodeployments | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# Setup Buildx for Docker operations. | ||
- name: Setup Buildx | ||
if: env.deploymentEnabled == 'true' | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3 | ||
|
||
# Build Docker image and cache Docker image/layers. | ||
- name: Build Docker Image | ||
if: env.deploymentEnabled == 'true' | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5 | ||
with: | ||
context: . | ||
tags: ${{ github.sha }} | ||
load: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
github_sha=${{ github.sha }} | ||
GRADLE_USER=${{ secrets.GITHUB_ACTOR }} | ||
GRADLE_READ_KEY=${{ secrets.GH_REGISTRY_GRADLE_TOKEN }} | ||
|
||
- name: Scan Docker Image with Wiz-CLI | ||
if: ${{ env.deploymentEnabled == 'true' && env.RUN_WIZCLI_CONTAINER_SCAN == 'true' }} | ||
uses: pleo-io/reusable-actions/wizcli@main | ||
id: image_scan | ||
with: | ||
scan_container: ${{ env.RUN_WIZCLI_CONTAINER_SCAN }} | ||
container_tag: ${{ github.sha }} | ||
deps_policy: Pleo-Default-vulnerabilities-policy | ||
wiz_client_id: ${{ secrets.WIZ_CLIENT_ID }} | ||
wiz_client_secret: ${{ secrets.WIZ_CLIENT_SECRET }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure shared services AWS credentials | ||
if: ${{ env.deploymentEnabled == 'true' && steps.image_scan.outcome == 'success' }} | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
role-to-assume: arn:aws:iam::${{vars.AWS_ACCOUNT_ID_SHARED_SERVICES}}:role/github/repository/${{ github.event.repository.name }}-github-actions | ||
role-session-name: GitHubActions | ||
aws-region: eu-west-1 | ||
special-characters-workaround: true | ||
|
||
- name: Login to Amazon ECR shared-services | ||
if: ${{ env.deploymentEnabled == 'true' && steps.image_scan.outcome == 'success' }} | ||
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | ||
|
||
- name: Push Docker Image to AWS ECR shared services | ||
if: ${{ env.deploymentEnabled == 'true' && steps.image_scan.outcome == 'success' }} | ||
run: | | ||
ecr_repo_url="${{ vars.AWS_ACCOUNT_ID_SHARED_SERVICES }}.dkr.ecr.eu-west-1.amazonaws.com/pleo/${{ github.event.repository.name }}:${{ github.sha }}" | ||
docker tag ${{ github.sha }} ${ecr_repo_url} | ||
docker push ${ecr_repo_url} | ||
docker rmi -f ${ecr_repo_url} | ||
|
||
get-env-variables: | ||
name: Prepare env variables | ||
outputs: | ||
deploymentEnabled: ${{ steps.env-variables.outputs.deploymentEnabled }} | ||
environmentTenant: ${{ steps.env-variables.outputs.environmentTenant }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set output variables | ||
id: env-variables | ||
run: | | ||
echo "deploymentEnabled=${{ env.deploymentEnabled }}" >> "$GITHUB_OUTPUT" | ||
echo "environmentTenant=${{ env.environmentTenant }}" >> "$GITHUB_OUTPUT" | ||
|
||
trigger-deploy-gitops-product-dev: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is now no deployment to trigger. |
||
name: Trigger deployment (GitOps)- Update product-dev image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'product' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: product-dev | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} | ||
|
||
trigger-deploy-gitops-product-staging: | ||
name: Trigger deployment (GitOps)- Update product-staging image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'product' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: product-staging | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} | ||
|
||
trigger-deploy-gitops-tooling-production: | ||
name: Trigger deployment (GitOps)- Update tooling-production image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'tooling' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: tooling-production | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} | ||
|
||
trigger-deploy-gitops-data-integration-dev: | ||
name: Trigger deployment (GitOps)- Update data-integration-dev image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'data-integration' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: data-integration-dev | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} | ||
|
||
trigger-deploy-gitops-data-integration-staging: | ||
name: Trigger deployment (GitOps)- Update data-integration-dev image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'data-integration' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: data-integration-staging | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} | ||
|
||
trigger-deploy-gitops-data-integration-production: | ||
name: Trigger deployment (GitOps)- Update data-integration-dev image | ||
concurrency: update-image-tag | ||
needs: | ||
- publish-docker-image | ||
- get-env-variables | ||
if: needs.get-env-variables.outputs.deploymentEnabled == 'true' && needs.get-env-variables.outputs.environmentTenant == 'data-integration' | ||
uses: pleo-io/reusable-workflows/.github/workflows/update-image-tag.yaml@main | ||
with: | ||
environment: data-integration-production | ||
image_tag: ${{ github.sha }} | ||
secrets: | ||
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }} | ||
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to publish a Docker image from the library.