From 69582edf302a2dadb3c40d45446af9226c2a799c Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Fri, 10 May 2024 15:54:55 -0400 Subject: [PATCH 1/5] fix(ci): Create initial account --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fddeafc..f6656a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,8 @@ jobs: # When writing back to the repo, we write to directories based # on the bindplane version. bindplane_versions: - - 1.37.0 - 1.45.0 + - 1.55.0 - latest steps: - name: Checkout @@ -80,7 +80,6 @@ jobs: -e BINDPLANE_PASSWORD=admin \ -e BINDPLANE_REMOTE_URL=https://${MAIN_IP}:3001 \ -e BINDPLANE_SESSION_SECRET=2c23c9d3-850f-4062-a5c8-3f9b814ae144 \ - -e BINDPLANE_SECRET_KEY=8a5353f7-bbf4-4eea-846d-a6d54296b781 \ -e BINDPLANE_LOG_OUTPUT=stdout \ -e BINDPLANE_ACCEPT_EULA=true \ -e BINDPLANE_TLS_CERT=/bindplane.crt \ @@ -94,6 +93,12 @@ jobs: env: BINDPLANE_LICENSE: ${{ secrets.BINDPLANE_LICENSE }} + - name: Init BindPlane Account + run: | + curl \ + -u admin:admin http://localhost:3001/v1/accounts \ + -X POST -d '{"displayName": "init"}' -v + - name: Wait for BindPlane uses: nick-fields/retry@v2 with: From c3a1e8dad6ff35f41ccd7f20ef5edee665e2510c Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Fri, 10 May 2024 15:56:31 -0400 Subject: [PATCH 2/5] wait for bindplane --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6656a5..c5fd207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,15 @@ jobs: env: BINDPLANE_LICENSE: ${{ secrets.BINDPLANE_LICENSE }} + - name: Wait for BindPlane + uses: nick-fields/retry@v2 + with: + timeout_minutes: 1 + polling_interval_seconds: 1 + max_attempts: 10 + shell: bash + command: docker exec bindplane /bindplane get agent --tls-ca /ca.crt + - name: Init BindPlane Account run: | curl \ From 4b044caba90467e050c2c9862e75fac651a84e12 Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Fri, 10 May 2024 15:58:14 -0400 Subject: [PATCH 3/5] use init curl command in retry loop --- .github/workflows/ci.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5fd207..7f99dc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,29 +93,17 @@ jobs: env: BINDPLANE_LICENSE: ${{ secrets.BINDPLANE_LICENSE }} - - name: Wait for BindPlane - uses: nick-fields/retry@v2 - with: - timeout_minutes: 1 - polling_interval_seconds: 1 - max_attempts: 10 - shell: bash - command: docker exec bindplane /bindplane get agent --tls-ca /ca.crt - - name: Init BindPlane Account - run: | - curl \ - -u admin:admin http://localhost:3001/v1/accounts \ - -X POST -d '{"displayName": "init"}' -v - - - name: Wait for BindPlane uses: nick-fields/retry@v2 with: timeout_minutes: 1 polling_interval_seconds: 2 max_attempts: 3 shell: bash - command: docker exec bindplane /bindplane get agent --tls-ca /ca.crt + command: | + curl \ + -u admin:admin http://localhost:3001/v1/accounts \ + -X POST -d '{"displayName": "init"}' -v - name: Run BindPlane Action # This should be replaced with a release action. From d1c451bd5b53de85eec353f8368c08dc44889389 Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Fri, 10 May 2024 16:09:20 -0400 Subject: [PATCH 4/5] use tls --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f99dc9..e13185c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,8 +101,8 @@ jobs: max_attempts: 3 shell: bash command: | - curl \ - -u admin:admin http://localhost:3001/v1/accounts \ + curl -kv \ + -u admin:admin https://localhost:3001/v1/accounts \ -X POST -d '{"displayName": "init"}' -v - name: Run BindPlane Action From 06ba43fe68ef356fcdb281ed11575481b738a75a Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Fri, 10 May 2024 16:14:49 -0400 Subject: [PATCH 5/5] use client keypair for curl mtls auth --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e13185c..5cc77e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,9 @@ jobs: command: | curl -kv \ -u admin:admin https://localhost:3001/v1/accounts \ - -X POST -d '{"displayName": "init"}' -v + -X POST -d '{"displayName": "init"}' -v \ + --key step/bindplane.key \ + --cert step/bindplane.crt - name: Run BindPlane Action # This should be replaced with a release action.