Skip to content

Commit fdf4c06

Browse files
author
Shruti
committed
changed the service account and updated airflow script to use gcloud storage
1 parent 93ae36d commit fdf4c06

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

.github/workflows/push-to-airflow.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,23 @@ jobs:
77
push_to_airflow:
88
name: Run push_to_airflow.sh
99
runs-on: ubuntu-latest
10-
1110
permissions:
12-
contents: 'read' # lets the workflow read our code
13-
id-token: 'write' # lets the workflow ask GitHub for a temporary token to log in to Google Cloud
14-
11+
contents: read # lets the workflow read this code
12+
id-token: write # lets the workflow ask GitHub for an OIDC token
1513
steps:
1614
- name: Checkout repo
1715
uses: actions/checkout@v4
1816

17+
# Requests a GH token and exchanges it with GCP. GCP sends back a temp access token for the eto-cd-github service account
1918
- name: Authenticate to Google Cloud
20-
id: auth
21-
uses: google-github-actions/auth@v2 # takes the Github token and gets a Google token
19+
id: 'auth'
20+
uses: google-github-actions/auth@v2
2221
with:
2322
workload_identity_provider: 'projects/855475113448/locations/global/workloadIdentityPools/eto-github/providers/eto-github'
24-
service_account: 'eto-artifact-registry[email protected]'
23+
service_account: 'eto-cd[email protected]'
2524
token_format: 'access_token'
2625

27-
- name: Testing Authentication (temporary will delete later)
28-
env:
29-
GOOGLE_OAUTH_ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }} # gsutil will use the Google token to authenticate
30-
run: |
31-
echo "Testing auth"
32-
gcloud auth list
33-
echo "Dags folder:"
34-
gsutil ls gs://us-east1-production-cc2-202-b42a7a54-bucket
35-
3626
- name: Run push_to_airflow.sh
37-
env:
38-
GOOGLE_OAUTH_ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }} # gsutil will use the Google token to authenticate
3927
run: |
4028
chmod +x ./push_to_airflow.sh
4129
./push_to_airflow.sh

push_to_airflow.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
gsutil rm -r gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_scripts
2-
gsutil -m cp -r airtable_scripts gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
3-
gsutil cp bq_to_airtable.py gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
4-
gsutil cp airtable_to_bq.py gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
5-
gsutil cp -r examples/multi_airtable_to_bq_test gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_to_bq_config/
6-
gsutil cp examples/single_airtable_to_bq_test.json gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_to_bq_config/
7-
gsutil cp examples/single_bq_to_airtable_test.json gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/bq_to_airtable_config/
8-
gsutil cp -r examples/multi_bq_to_airtable_test gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/bq_to_airtable_config/
9-
gsutil cp examples/sql/* gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/airtable_to_bq/multi_airtable_to_bq_test/
10-
gsutil cp examples/sql/* gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/bq_to_airtable/multi_bq_to_airtable_test/
11-
gsutil cp examples/sql/base2_table1_input.sql gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/bq_to_airtable/single_bq_to_airtable_test/
12-
gsutil cp examples/sql/default_merge.sql gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/airtable_to_bq/single_airtable_to_bq_test/
13-
gsutil cp examples/schemas/* gs://airflow-data-exchange-development/schemas/airtable_to_bq/multi_airtable_to_bq_test/
14-
gsutil cp examples/schemas/default.json gs://airflow-data-exchange-development/schemas/airtable_to_bq/single_airtable_to_bq_test/
1+
gcloud storage rm -r gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_scripts
2+
gcloud storage cp -r airtable_scripts gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
3+
gcloud storage cp bq_to_airtable.py gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
4+
gcloud storage cp airtable_to_bq.py gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/
5+
gcloud storage cp -r examples/multi_airtable_to_bq_test gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_to_bq_config/
6+
gcloud storage cp examples/single_airtable_to_bq_test.json gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/airtable_to_bq_config/
7+
gcloud storage cp examples/single_bq_to_airtable_test.json gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/bq_to_airtable_config/
8+
gcloud storage cp -r examples/multi_bq_to_airtable_test gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/bq_to_airtable_config/
9+
gcloud storage cp examples/sql/* gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/airtable_to_bq/multi_airtable_to_bq_test/
10+
gcloud storage cp examples/sql/* gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/bq_to_airtable/multi_bq_to_airtable_test/
11+
gcloud storage cp examples/sql/base2_table1_input.sql gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/bq_to_airtable/single_bq_to_airtable_test/
12+
gcloud storage cp examples/sql/default_merge.sql gs://us-east1-production-cc2-202-b42a7a54-bucket/dags/sql/airtable_to_bq/single_airtable_to_bq_test/
13+
gcloud storage cp examples/schemas/* gs://airflow-data-exchange-development/schemas/airtable_to_bq/multi_airtable_to_bq_test/
14+
gcloud storage cp examples/schemas/default.json gs://airflow-data-exchange-development/schemas/airtable_to_bq/single_airtable_to_bq_test/

0 commit comments

Comments
 (0)