Skip to content

feat(serverless): support wait flag #242

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

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Conversation

v1v
Copy link
Member

@v1v v1v commented Feb 26, 2025

Similarly done in the past with #226

What

  • Support wait so it can be used in conjunction with oblt-cli/cluster-credentials
  • Output the cluster-name

Usage

      - name: Get token
        id: get_token
        uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
        with:
          app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
          private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
          permissions: >-
            {
              "contents": "write",
              "pull_requests": "read",
              "checks": "read"
            }
          repositories: >-
            ["observability-test-environments"]

      - uses: elastic/oblt-actions/git/setup@v1
        with:
          github-token: ${{ steps.get_token.outputs.token }}

      - name: Setup ephemeral cluster
        uses: elastic/oblt-actions/oblt-cli/cluster-create-serverless@v1
        id: cluster_create
        with:
          github-token: ${{ steps.get_token.outputs.token }}
          wait: 15
          [..]

      - name: Setup credentials for the ephemeral cluster
        uses: elastic/oblt-actions/oblt-cli/cluster-credentials@v1
        with:
          cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}
          github-token: ${{ steps.get_token.outputs.token }}

[..]


      - name: Tear down ephemeral cluster
        uses: elastic/oblt-actions/oblt-cli/cluster-destroy@v1
        if: always()
        continue-on-error: true
        with:
          github-token: ${{ steps.get_token.outputs.token }}
          cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}

@v1v v1v added the changelog:enhancement When you enhance an existing feature label Feb 26, 2025
@v1v v1v self-assigned this Feb 26, 2025
@v1v v1v requested a review from constanca-m February 26, 2025 17:01
@v1v v1v requested a review from a team February 26, 2025 17:40
Comment on lines +42 to +46
outputs:
cluster-name:
description: 'The cluster name that has been created'
value: ${{ steps.info.outputs.cluster-name }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this!

@v1v v1v added this pull request to the merge queue Feb 27, 2025
Merged via the queue into main with commit 8456da5 Feb 27, 2025
7 checks passed
@v1v v1v deleted the feature/wait-for-serverlss-too branch February 27, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:enhancement When you enhance an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants