Skip to content

pass additional variables for preview deployments #101

@sakethsomaraju

Description

@sakethsomaraju

Provide a way to pass additional variables for preview deployments.

Use case: In case, if parent deployment is configured with secrets backend, AIRFLOW__SECRETS__BACKEND_KWARGS⁠⁠⁠⁠⁠⁠⁠ will not be copied from parent deployment to preview deployment ( since it is a secret variable ). So passing it explicitly can help configuring the secret backend for preview deployment.

Workaround for this issue to create the variable in a separate step post deployment creation :


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Deploy to Astro DAGS
      id: deploy_to_astro
      continue-on-error: true
      # if: ${{ github.event.inputs.deploy_type == 'DAGS' }}
      uses: astronomer/deploy-action@v0.8.0
      with:
        action: create-deployment-preview
        deployment-id: ${{ env.DEPLOYMENT_ID }}
    - name: add backend kwargs
      id: export-env
      run: |
        # install the Astro CLI
        curl -sSL https://install.astronomer.io | sudo bash -s

        # update variables
        astro deployment variable create --deployment-id ${{ steps.deploy_to_astro.outputs.preview-id	 }} AIRFLOW__SECRETS__BACKEND_KWARGS=${{ secrets.HCV_KWARGS }} --secret


The fix for this issue should enable passing variables while using action: create-deployment-preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions