From 772ea7ad3e94d5b76677a1d08fa98c902c3197b1 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 08:56:09 -0700 Subject: [PATCH 1/8] Create main.yml --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6117f4f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: AZ_TEST + +on: + pull_request: + +permissions: + id-token: write + contents: read + +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - name: Log into Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Verify + run: | + az account show + + From e6fce6f6210f60ab5bd2f28c8a876dfb732f75dd Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:09:16 -0700 Subject: [PATCH 2/8] test access Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6117f4f..38b79e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,6 @@ jobs: - name: Verify run: | - az account show + az keyvault secret list --vault-name "bpfperformacesecrets" From ef9f3e9a54cdd155ff46194334e0ebf7ffcf120f Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:15:52 -0700 Subject: [PATCH 3/8] Test postgres access Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38b79e1..20d0fe1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,8 +18,16 @@ jobs: tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Verify + - name: Fetch secrets run: | - az keyvault secret list --vault-name "bpfperformacesecrets" + echo "PGDATABASE=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value)" >> $GITHUB_ENV + echo "PGHOST=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value)" >> $GITHUB_ENV + echo "PGUSER=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value)" >> $GITHUB_ENV + echo "PGPASSWORD=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value)" >> $GITHUB_ENV + echo "PGPORT=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value)" >> $GITHUB_ENV + + - name: Test POSTGRES access + run: | + psql -c "SELECT * FROM BenchmarkResults LIMIT 50" From 5ef748dcb5a2d30d80e0430df2a8b5eb043c009f Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:19:41 -0700 Subject: [PATCH 4/8] Test Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20d0fe1..86a5ab7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,14 +20,19 @@ jobs: - name: Fetch secrets run: | - echo "PGDATABASE=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value)" >> $GITHUB_ENV - echo "PGHOST=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value)" >> $GITHUB_ENV - echo "PGUSER=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value)" >> $GITHUB_ENV - echo "PGPASSWORD=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value)" >> $GITHUB_ENV - echo "PGPORT=$(az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value)" >> $GITHUB_ENV + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value >> ${{env.workspace}}/PGDATABASE + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value >> ${{env.workspace}}/PGDATABASE + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value >> ${{env.workspace}}/PGUSER + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value >> ${{env.workspace}}/PGPASSWORD + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value" >> ${{env.workspace}}/PGPORT - name: Test POSTGRES access run: | + export PGPASSWORD=$(cat ${{env.workspace}}/PGPASSWORD) + export PGHOST=$(cat ${{env.workspace}}/PGHOST) + export PGUSER=$(cat ${{env.workspace}}/PGUSER) + export PGPORT=$(cat ${{env.workspace}}/PGPORT) + export PGDATABASE=$(cat ${{env.workspace}}/PGDATABASE) psql -c "SELECT * FROM BenchmarkResults LIMIT 50" From ed8f55eb329f3fd6f9b760b27f338f908d4d8cdd Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:21:05 -0700 Subject: [PATCH 5/8] Test Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86a5ab7..07c3495 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,19 +20,19 @@ jobs: - name: Fetch secrets run: | - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value >> ${{env.workspace}}/PGDATABASE - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value >> ${{env.workspace}}/PGDATABASE - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value >> ${{env.workspace}}/PGUSER - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value >> ${{env.workspace}}/PGPASSWORD - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value" >> ${{env.workspace}}/PGPORT + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value >> ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value >> ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value >> ${{github.workspace}}/PGUSER + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value >> ${{github.workspace}}/PGPASSWORD + az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value" >> ${{github.workspace}}/PGPORT - name: Test POSTGRES access run: | - export PGPASSWORD=$(cat ${{env.workspace}}/PGPASSWORD) - export PGHOST=$(cat ${{env.workspace}}/PGHOST) - export PGUSER=$(cat ${{env.workspace}}/PGUSER) - export PGPORT=$(cat ${{env.workspace}}/PGPORT) - export PGDATABASE=$(cat ${{env.workspace}}/PGDATABASE) + export PGPASSWORD=$(cat ${{github.workspace}}/PGPASSWORD) + export PGHOST=$(cat ${{github.workspace}}/PGHOST) + export PGUSER=$(cat ${{github.workspace}}/PGUSER) + export PGPORT=$(cat ${{github.workspace}}/PGPORT) + export PGDATABASE=$(cat ${{github.workspace}}/PGDATABASE) psql -c "SELECT * FROM BenchmarkResults LIMIT 50" From 788982860569fefe419e5f0924e1092dc07fc1a7 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:23:26 -0700 Subject: [PATCH 6/8] Test Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07c3495..9ca7b10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,11 +20,11 @@ jobs: - name: Fetch secrets run: | - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGDATABASE" --query value >> ${{github.workspace}}/PGDATABASE - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGHOST" --query value >> ${{github.workspace}}/PGDATABASE - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGUSER" --query value >> ${{github.workspace}}/PGUSER - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPASSWORD" --query value >> ${{github.workspace}}/PGPASSWORD - az keyvault secret show --vault-name "bpfperformacesecrets" --name "PGPORT" --query value" >> ${{github.workspace}}/PGPORT + az keyvault secret show --vault-name bpfperformacesecrets --name PGDATABASE --query value > ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value > ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGUSER --query value > ${{github.workspace}}/PGUSER + az keyvault secret show --vault-name bpfperformacesecrets --name PGPASSWORD --query value > ${{github.workspace}}/PGPASSWORD + az keyvault secret show --vault-name bpfperformacesecrets --name PGPORT --query value > ${{github.workspace}}/PGPORT - name: Test POSTGRES access run: | From 73bdb6ca866d4f086b7a4a08d26b571aafc17fae Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:30:22 -0700 Subject: [PATCH 7/8] test Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ca7b10..b3d6c3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,11 +20,11 @@ jobs: - name: Fetch secrets run: | - az keyvault secret show --vault-name bpfperformacesecrets --name PGDATABASE --query value > ${{github.workspace}}/PGDATABASE - az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value > ${{github.workspace}}/PGDATABASE - az keyvault secret show --vault-name bpfperformacesecrets --name PGUSER --query value > ${{github.workspace}}/PGUSER - az keyvault secret show --vault-name bpfperformacesecrets --name PGPASSWORD --query value > ${{github.workspace}}/PGPASSWORD - az keyvault secret show --vault-name bpfperformacesecrets --name PGPORT --query value > ${{github.workspace}}/PGPORT + az keyvault secret show --vault-name bpfperformacesecrets --name PGDATABASE --query value | sed 's/"//g' > ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value | sed 's/"//g' >> ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGUSER --query value | sed 's/"//g' >> ${{github.workspace}}/PGUSER + az keyvault secret show --vault-name bpfperformacesecrets --name PGPASSWORD --query value | sed 's/"//g' >> ${{github.workspace}}/PGPASSWORD + az keyvault secret show --vault-name bpfperformacesecrets --name PGPORT --query value | sed 's/"//g' >> ${{github.workspace}}/PGPORT - name: Test POSTGRES access run: | From 80c6c004a7fbeb59a8fd45ee3728077a8f4b8a46 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Thu, 14 Sep 2023 09:31:41 -0700 Subject: [PATCH 8/8] test Signed-off-by: Alan Jowett --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3d6c3a..f2e0d5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: - name: Fetch secrets run: | az keyvault secret show --vault-name bpfperformacesecrets --name PGDATABASE --query value | sed 's/"//g' > ${{github.workspace}}/PGDATABASE - az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value | sed 's/"//g' >> ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value | sed 's/"//g' >> ${{github.workspace}}/PGHOST az keyvault secret show --vault-name bpfperformacesecrets --name PGUSER --query value | sed 's/"//g' >> ${{github.workspace}}/PGUSER az keyvault secret show --vault-name bpfperformacesecrets --name PGPASSWORD --query value | sed 's/"//g' >> ${{github.workspace}}/PGPASSWORD az keyvault secret show --vault-name bpfperformacesecrets --name PGPORT --query value | sed 's/"//g' >> ${{github.workspace}}/PGPORT