From 64dff46d8ee2f41d1b67a6f4c7e410165a304736 Mon Sep 17 00:00:00 2001 From: spaliwal Date: Mon, 16 Aug 2021 16:55:05 +0530 Subject: [PATCH] Add required env vars for build and deploy for extension registry Move Auth generation before build as build also requires token Reference latest aio apps action 2.0.1 --- .../add-ci/.github/workflows/deploy_prod.yml | 24 ++++++++++++------- .../add-ci/.github/workflows/deploy_stage.yml | 24 ++++++++++++------- .../add-ci/.github/workflows/pr_test.yml | 15 ++++++++++-- test/generators/add-ci/index.test.js | 6 ++--- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/generators/add-ci/.github/workflows/deploy_prod.yml b/generators/add-ci/.github/workflows/deploy_prod.yml index 46b0b260..7ea828c6 100644 --- a/generators/add-ci/.github/workflows/deploy_prod.yml +++ b/generators/add-ci/.github/workflows/deploy_prod.yml @@ -26,15 +26,8 @@ jobs: with: os: ${{ matrix.os }} version: 8.x.x - - name: Build - env: - AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }} - uses: adobe/aio-apps-action@2.0.0 - with: - os: ${{ matrix.os }} - command: build - name: Auth - uses: adobe/aio-apps-action@2.0.0 + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: auth @@ -44,11 +37,24 @@ jobs: IMSORGID: ${{ secrets.IMSORGID_PROD }} SCOPES: ${{ secrets.SCOPES_PROD }} KEY: ${{ secrets.KEY_PROD }} + - name: Build + env: + AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }} + uses: adobe/aio-apps-action@2.0.1 + with: + os: ${{ matrix.os }} + command: build - name: Deploy env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }} AIO_RUNTIME_AUTH: ${{ secrets.AIO_RUNTIME_AUTH_PROD }} - uses: adobe/aio-apps-action@2.0.0 + AIO_PROJECT_ID: ${{ secrets.AIO_PROJECT_ID_PROD }} + AIO_PROJECT_NAME: ${{ secrets.AIO_PROJECT_NAME_PROD }} + AIO_PROJECT_ORG_ID: ${{ secrets.AIO_PROJECT_ORG_ID_PROD }} + AIO_PROJECT_WORKSPACE_ID: ${{ secrets.AIO_PROJECT_WORKSPACE_ID_PROD }} + AIO_PROJECT_WORKSPACE_NAME: ${{ secrets.AIO_PROJECT_WORKSPACE_NAME_PROD }} + AIO_PROJECT_WORKSPACE_DETAILS_SERVICES: ${{ secrets.AIO_PROJECT_WORKSPACE_DETAILS_SERVICES_PROD }} + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: deploy diff --git a/generators/add-ci/.github/workflows/deploy_stage.yml b/generators/add-ci/.github/workflows/deploy_stage.yml index a5f4b12e..7c4fd594 100644 --- a/generators/add-ci/.github/workflows/deploy_stage.yml +++ b/generators/add-ci/.github/workflows/deploy_stage.yml @@ -27,15 +27,8 @@ jobs: with: os: ${{ matrix.os }} version: 8.x.x - - name: Build - env: - AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} - uses: adobe/aio-apps-action@2.0.0 - with: - os: ${{ matrix.os }} - command: build - name: Auth - uses: adobe/aio-apps-action@2.0.0 + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: auth @@ -45,11 +38,24 @@ jobs: IMSORGID: ${{ secrets.IMSORGID_STAGE }} SCOPES: ${{ secrets.SCOPES_STAGE }} KEY: ${{ secrets.KEY_STAGE }} + - name: Build + env: + AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} + uses: adobe/aio-apps-action@2.0.1 + with: + os: ${{ matrix.os }} + command: build - name: Deploy env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} AIO_RUNTIME_AUTH: ${{ secrets.AIO_RUNTIME_AUTH_STAGE }} - uses: adobe/aio-apps-action@2.0.0 + AIO_PROJECT_ID: ${{ secrets.AIO_PROJECT_ID_STAGE }} + AIO_PROJECT_NAME: ${{ secrets.AIO_PROJECT_NAME_STAGE }} + AIO_PROJECT_ORG_ID: ${{ secrets.AIO_PROJECT_ORG_ID_STAGE }} + AIO_PROJECT_WORKSPACE_ID: ${{ secrets.AIO_PROJECT_WORKSPACE_ID_STAGE }} + AIO_PROJECT_WORKSPACE_NAME: ${{ secrets.AIO_PROJECT_WORKSPACE_NAME_STAGE }} + AIO_PROJECT_WORKSPACE_DETAILS_SERVICES: ${{ secrets.AIO_PROJECT_WORKSPACE_DETAILS_SERVICES_STAGE }} + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: deploy diff --git a/generators/add-ci/.github/workflows/pr_test.yml b/generators/add-ci/.github/workflows/pr_test.yml index 36e31861..35dbc529 100644 --- a/generators/add-ci/.github/workflows/pr_test.yml +++ b/generators/add-ci/.github/workflows/pr_test.yml @@ -23,15 +23,26 @@ jobs: with: os: ${{ matrix.os }} version: 8.x.x + - name: Auth + uses: adobe/aio-apps-action@2.0.1 + with: + os: ${{ matrix.os }} + command: auth + CLIENTID: ${{ secrets.CLIENTID_STAGE }} + CLIENTSECRET: ${{ secrets.CLIENTSECRET_STAGE }} + TECHNICALACCOUNTID: ${{ secrets.TECHNICALACCID_STAGE }} + IMSORGID: ${{ secrets.IMSORGID_STAGE }} + SCOPES: ${{ secrets.SCOPES_STAGE }} + KEY: ${{ secrets.KEY_STAGE }} - name: Build env: AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_STAGE }} - uses: adobe/aio-apps-action@2.0.0 + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: build - name: Test - uses: adobe/aio-apps-action@2.0.0 + uses: adobe/aio-apps-action@2.0.1 with: os: ${{ matrix.os }} command: test diff --git a/test/generators/add-ci/index.test.js b/test/generators/add-ci/index.test.js index d3ba0374..95b82a2e 100644 --- a/test/generators/add-ci/index.test.js +++ b/test/generators/add-ci/index.test.js @@ -47,12 +47,12 @@ describe('run', () => { // added files assert.file('.github/workflows/pr_test.yml') assert.fileContent('.github/workflows/pr_test.yml', 'version: 8.x.x') - assert.fileContent('.github/workflows/pr_test.yml', 'adobe/aio-apps-action@2.0.0') + assert.fileContent('.github/workflows/pr_test.yml', 'adobe/aio-apps-action@2.0.1') assert.file('.github/workflows/deploy_prod.yml') assert.fileContent('.github/workflows/deploy_prod.yml', 'version: 8.x.x') - assert.fileContent('.github/workflows/deploy_prod.yml', 'adobe/aio-apps-action@2.0.0') + assert.fileContent('.github/workflows/deploy_prod.yml', 'adobe/aio-apps-action@2.0.1') assert.file('.github/workflows/deploy_stage.yml') assert.fileContent('.github/workflows/deploy_stage.yml', 'version: 8.x.x') - assert.fileContent('.github/workflows/deploy_stage.yml', 'adobe/aio-apps-action@2.0.0') + assert.fileContent('.github/workflows/deploy_stage.yml', 'adobe/aio-apps-action@2.0.1') }) })