Skip to content
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

[LOTP] Add gcloud #24

Open
fproulx-boostsecurity opened this issue Feb 28, 2024 · 0 comments
Open

[LOTP] Add gcloud #24

fproulx-boostsecurity opened this issue Feb 28, 2024 · 0 comments
Labels
good first issue Good for newcomers idea

Comments

@fproulx-boostsecurity
Copy link
Contributor

Description of the LOTP tool

gcloud is Google Cloud management tool which has a lot of plugins and dozens (if not hundreds) of commands.

Configuration files

gcloud builds submit will submit cloudbuild.yaml by default (which often can be overriden)

Real-world example

name: prod release
on:
  workflow_run:
    workflows: ["Unit Tests"]
    types:
      - completed
    branches:
      - master

permissions:
  id-token: write

jobs:
  docker:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - name: checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.event.workflow_run.head_branch }}

      - name: authenticate to google cloud
        id: "auth"
        uses: google-github-actions/auth@v0
        with:
          workload_identity_provider: "${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}"
          service_account: "${{ secrets.RUN_SA_EMAIL }}"

      - name: "setup gcloud sdk"
        uses: google-github-actions/setup-gcloud@v0

      - name: Build and push images
        run: |-
          gcloud builds submit --quiet --substitutions="COMMIT_SHA=${{ github.event.workflow_run.head_sha }},_CUSTOM_BRANCH_TAG=gcloud-prod"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers idea
Projects
None yet
Development

No branches or pull requests

1 participant