From c1294a6e2de1e0b95e3ef261cec97402cc7940bd Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Thu, 30 Jul 2026 18:04:01 -0300 Subject: [PATCH 1/5] Added harness ci --- .../javascript_browser_client_ci.yaml | 208 ++++++++++++++++++ .../javascript_browser_client_ci_pr.yaml | 14 ++ .../javascript_browser_client_ci_push.yaml | 14 ++ 3 files changed, 236 insertions(+) create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml new file mode 100644 index 0000000..cf1731b --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml @@ -0,0 +1,208 @@ +pipeline: + name: javascript-browser-client-ci + identifier: javascript_browser_client_ci + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: + fme-sdk: "" + team: SDK + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: javascript-browser-client + build: <+input> + depth: 0 + stages: + - stage: + name: Build and Test + identifier: Build_and_Test + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: true + override: true + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: + size: flex + execution: + steps: + - step: + type: Run + name: Install Node + identifier: Install_Node + spec: + shell: Bash + command: |- + curl https://mise.run | sh + export PATH="$HOME/.local/bin:$PATH" + mise use --global node@lts + node --version + npm --version + - step: + type: Run + name: Install Chrome + identifier: Install_Chrome + spec: + shell: Bash + # puppeteer e2e tests require a real Chrome binary; version pinned to match GHA (125) + command: |- + export PUPPETEER_SKIP_DOWNLOAD=true + curl -fsSL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/chrome.deb + apt-get update -qq && apt-get install -y -qq /tmp/chrome.deb || true + # Fallback: install via chromium if exact version not available + which google-chrome-stable || apt-get install -y -qq chromium-browser + CHROME_BIN=$(which google-chrome-stable || which chromium-browser || which chromium) + echo "CHROME_BIN=$CHROME_BIN" + export CHROME_BIN + - step: + type: Run + name: Install Dependencies + identifier: Install_Dependencies + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + export PUPPETEER_SKIP_DOWNLOAD=true + npm ci + - step: + type: Run + name: Check TypeScript Declarations + identifier: Check_TypeScript_Declarations + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + npm run test-ts-decls + - step: + type: Run + name: Check Lint and Types + identifier: Check_Lint_and_Types + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + npm run check + - step: + type: Run + name: Run Tests + identifier: Run_Tests + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + CHROME_BIN=$(which google-chrome-stable || which chromium-browser || which chromium) + export CHROME_BIN + export PUPPETEER_SKIP_DOWNLOAD=true + npm run test + - step: + type: Run + name: Build + identifier: Build + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + BUILD_BRANCH=<+codebase.branch> npm run build + - step: + type: Run + name: SonarQube Scan + identifier: SonarQube_Scan + when: + stageStatus: Success + spec: + shell: Sh + command: |- + export SONAR_SCANNER_VERSION=5.0.1.3006 + curl -sSLo sonar-scanner.zip \ + "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" + unzip -q sonar-scanner.zip + export PATH="$PWD/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:$PATH" + apt-get install -y openjdk-17-jdk -qq + + VERSION=$(node -e "console.log(require('./package.json').version)") + + if [ "<+codebase.build.type>" = "PR" ]; then + sonar-scanner \ + -Dsonar.projectKey=javascript-browser-client \ + -Dsonar.projectName=javascript-browser-client \ + -Dsonar.sources=src \ + -Dsonar.host.url=https://sonar.harness.io \ + -Dsonar.token=<+secrets.getValue("sonarqube-token")> \ + -Dsonar.exclusions="**/node_modules/**,**/umd/**,**/cjs/**,**/esm/**" \ + -Dsonar.projectVersion="${VERSION}" \ + -Dsonar.pullrequest.key=<+codebase.prNumber> \ + -Dsonar.pullrequest.branch=<+codebase.branch> \ + -Dsonar.pullrequest.base=<+codebase.targetBranch> + else + sonar-scanner \ + -Dsonar.projectKey=javascript-browser-client \ + -Dsonar.projectName=javascript-browser-client \ + -Dsonar.sources=src \ + -Dsonar.host.url=https://sonar.harness.io \ + -Dsonar.token=<+secrets.getValue("sonarqube-token")> \ + -Dsonar.exclusions="**/node_modules/**,**/umd/**,**/cjs/**,**/esm/**" \ + -Dsonar.projectVersion="${VERSION}" \ + -Dsonar.branch.name=<+codebase.branch> + fi + - step: + type: Run + name: Post Quality Gate + identifier: Post_Quality_Gate + when: + stageStatus: Success + spec: + shell: Bash + command: |- + #!/bin/bash + set -e + + SONAR_TOKEN="<+secrets.getValue("sonarqube-token")>" + SONAR_URL="https://sonar.harness.io" + SONAR_PROJECT_KEY="javascript-browser-client" + GITHUB_TOKEN="<+secrets.getValue("github-devops-token")>" + GITHUB_REPO="javascript-browser-client" + COMMIT_SHA="<+codebase.commitSha>" + + STATUS_JSON=$(curl -sf \ + -H "Authorization: Bearer ${SONAR_TOKEN}" \ + "${SONAR_URL}/api/qualitygates/project_status?projectKey=${SONAR_PROJECT_KEY}") + + QG_STATUS=$(echo "$STATUS_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['projectStatus']['status'])") + + case "$QG_STATUS" in + OK) GH_STATE="success"; DESCRIPTION="Quality gate passed" ;; + ERROR) GH_STATE="failure"; DESCRIPTION="Quality gate failed" ;; + WARN) GH_STATE="success"; DESCRIPTION="Quality gate passed with warnings" ;; + *) GH_STATE="pending"; DESCRIPTION="Quality gate status unknown" ;; + esac + + TARGET_URL="${SONAR_URL}/dashboard?id=${SONAR_PROJECT_KEY}" + + curl -sf -X POST \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Content-Type: application/json" \ + -d "{\"state\":\"${GH_STATE}\",\"description\":\"${DESCRIPTION}\",\"context\":\"sonarqube/quality-gate\",\"target_url\":\"${TARGET_URL}\"}" \ + "https://api.github.com/repos/splitio/${GITHUB_REPO}/statuses/${COMMIT_SHA}" + + echo "Posted SonarQube quality gate status: ${GH_STATE}" + # VERIFY: S3 upload steps require an AWS connector with write access to split-public-stage / split-public buckets. + # The GHA workflow used OIDC role assumption (arn:aws:iam:::role/gha-public-assets-role). + # Check with the team whether an equivalent Harness AWS connector exists, or if S3 upload + # should remain in GitHub Actions / move to a separate CD pipeline. + # Once confirmed, add steps here: + # + # On push to development → upload umd/ to s3://split-public-stage/sdk/ + # On push to main → upload umd/ to s3://split-public/sdk/ diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml new file mode 100644 index 0000000..c836f5b --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml @@ -0,0 +1,14 @@ +inputSet: + identifier: javascript_browser_client_ci_pr + name: javascript-browser-client-ci-pr + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: javascript_browser_client_ci + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml new file mode 100644 index 0000000..9b5b360 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml @@ -0,0 +1,14 @@ +inputSet: + identifier: javascript_browser_client_ci_push + name: javascript-browser-client-ci-push + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: javascript_browser_client_ci + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> From af34f30ef0e433a10d20afe2dd3c5b4d11c35b9a Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 10:48:01 -0300 Subject: [PATCH 2/5] Update input set names --- .../input_sets/javascript_browser_client_ci_pr.yaml | 2 +- .../input_sets/javascript_browser_client_ci_push.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml index c836f5b..1b15ab7 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_pr.yaml @@ -1,6 +1,6 @@ inputSet: identifier: javascript_browser_client_ci_pr - name: javascript-browser-client-ci-pr + name: javascript_browser_client_ci_pr orgIdentifier: PROD projectIdentifier: Harness_Split pipeline: diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml index 9b5b360..aa02abe 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci/input_sets/javascript_browser_client_ci_push.yaml @@ -1,6 +1,6 @@ inputSet: identifier: javascript_browser_client_ci_push - name: javascript-browser-client-ci-push + name: javascript_browser_client_ci_push orgIdentifier: PROD projectIdentifier: Harness_Split pipeline: From 4bea9a5582f37059ee9a144940613e01e667f51a Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 10:56:48 -0300 Subject: [PATCH 3/5] chore: empty commit to test Harness CI trigger AI-Session-Id: d7660bd1-362a-4ae1-8032-1c200f5f8fe5 AI-Tool: claude-code AI-Model: unknown From 1c6c3cfca2a29824bca42fb54c2935017e61d24f Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 11:09:54 -0300 Subject: [PATCH 4/5] Remove github actions --- .github/CODEOWNERS | 1 - .github/pull_request_template.md | 7 -- .github/workflows/ci-cd.yml | 142 ----------------------- .github/workflows/sonar-scan.yml | 66 ----------- .github/workflows/update-notice-year.yml | 45 ------- 5 files changed, 261 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/ci-cd.yml delete mode 100644 .github/workflows/sonar-scan.yml delete mode 100644 .github/workflows/update-notice-year.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9e31981..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @splitio/sdk diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 6e9fc04..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,7 +0,0 @@ -# JavaScript Browser SDK - -## What did you accomplish? - -## How do we test the changes introduced in this PR? - -## Extra Notes diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml deleted file mode 100644 index 57b1865..0000000 --- a/.github/workflows/ci-cd.yml +++ /dev/null @@ -1,142 +0,0 @@ -name: ci-cd -on: - pull_request: - branches: - - main - - development - push: - branches: - - '*' - -env: - PUPPETEER_SKIP_DOWNLOAD: 'true' - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - id-token: write - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: npm ci - run: npm ci - - - name: Setup Chrome - uses: browser-actions/setup-chrome@19ae4b339ee18925ab85cf12c1041150ea4a44c8 # v1 - with: - chrome-version: '125' - - name: Set CHROME_BIN - run: echo "CHROME_BIN=$(which chrome)" >> $GITHUB_ENV - - - name: npm test-ts-decls - run: npm run test-ts-decls - - - name: npm check - run: npm run check - - - name: npm test - run: npm run test - - - name: npm build - run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - - - name: Store assets - if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }} - uses: actions/upload-artifact@v5 - with: - name: assets - path: umd/ - retention-days: 1 - - upload-stage: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} - strategy: - matrix: - environment: - - stage - include: - - environment: stage - account_id: "079419646996" - bucket: split-public-stage - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public - - upload-prod: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - strategy: - matrix: - environment: - - prod - include: - - environment: prod - account_id: "825951051969" - bucket: split-public - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml deleted file mode 100644 index a81b328..0000000 --- a/.github/workflows/sonar-scan.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: sonar-scan -on: - pull_request: - branches: - - main - - development - push: - branches: - - main - - development - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: npm CI - run: npm ci - - - name: npm Check - run: npm run check - - - name: npm Build - run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - - - name: SonarQube Scan (Push) - if: github.event_name == 'push' - uses: SonarSource/sonarqube-scan-action@v6 - env: - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - with: - projectBaseDir: . - args: > - -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} - -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" - -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" - - - name: SonarQube Scan (Pull Request) - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository - uses: SonarSource/sonarqube-scan-action@v6 - env: - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - with: - projectBaseDir: . - args: > - -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} - -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" - -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} - -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} - -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} diff --git a/.github/workflows/update-notice-year.yml b/.github/workflows/update-notice-year.yml deleted file mode 100644 index 440dacb..0000000 --- a/.github/workflows/update-notice-year.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Update Notice Year - -on: - schedule: - - cron: "0 3 1 1 *" # 03:00 AM on January 1 - -permissions: - contents: write - pull-requests: write - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set Current year - run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV" - - - name: Set Previous Year - run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV" - - - name: Update NOTICE - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: ${{ env.PREVIOUS }} - replace: ${{ env.CURRENT }} - include: "NOTICE" - regex: false - - - name: Commit files - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m "Updated Notice Year" -a - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Update Notice Year - branch: update-notice From 0b50cc395fae52e755b9c6b0019f36d03b3dda14 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 11:57:12 -0300 Subject: [PATCH 5/5] Added s3 --- .../javascript_browser_client_ci.yaml | 112 ++++++++++++++++-- 1 file changed, 104 insertions(+), 8 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml index cf1731b..9791462 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/javascript_browser_client_ci.yaml @@ -198,11 +198,107 @@ pipeline: "https://api.github.com/repos/splitio/${GITHUB_REPO}/statuses/${COMMIT_SHA}" echo "Posted SonarQube quality gate status: ${GH_STATE}" - # VERIFY: S3 upload steps require an AWS connector with write access to split-public-stage / split-public buckets. - # The GHA workflow used OIDC role assumption (arn:aws:iam:::role/gha-public-assets-role). - # Check with the team whether an equivalent Harness AWS connector exists, or if S3 upload - # should remain in GitHub Actions / move to a separate CD pipeline. - # Once confirmed, add steps here: - # - # On push to development → upload umd/ to s3://split-public-stage/sdk/ - # On push to main → upload umd/ to s3://split-public/sdk/ + - stage: + name: Deploy to S3 Stage + identifier: Deploy_to_S3_Stage + type: CI + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build UMD Assets + identifier: Build_UMD_Assets + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: |- + export PUPPETEER_SKIP_DOWNLOAD=true + npm ci + BUILD_BRANCH=<+codebase.branch> npm run build:umd + - step: + type: Run + name: Deploy to S3 Stage + identifier: Deploy_to_S3_Stage + spec: + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 + shell: Bash + command: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS + envVariables: + BUCKET: split-public-stage + SOURCE_DIR: ./umd + DEST_DIR: sdk + ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1stage1cd + namespace: harness-delegate + # VERIFY: service account needs IRSA binding to the equivalent of arn:aws:iam::079419646996:role/gha-public-assets-role + serviceAccountName: use1-stage-1-javascript-browser-client-s3 + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-stage-1-cd + when: + pipelineStatus: Success + condition: <+trigger.event> == "PUSH" && <+codebase.branch> == "development" + - stage: + name: Deploy to S3 Prod + identifier: Deploy_to_S3_Prod + type: CI + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build UMD Assets + identifier: Build_UMD_Assets + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: |- + export PUPPETEER_SKIP_DOWNLOAD=true + npm ci + BUILD_BRANCH=<+codebase.branch> npm run build:umd + - step: + type: Run + name: Deploy to S3 Prod + identifier: Deploy_to_S3_Prod + spec: + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 + shell: Bash + command: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS + envVariables: + BUCKET: split-public + SOURCE_DIR: ./umd + DEST_DIR: sdk + ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1prod1cd + namespace: harness-delegate + # VERIFY: service account needs IRSA binding to the equivalent of arn:aws:iam::825951051969:role/gha-public-assets-role + serviceAccountName: use1-prod-1-javascript-browser-client-s3 + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-prod-1-cd + when: + pipelineStatus: Success + condition: <+trigger.event> == "PUSH" && <+codebase.branch> == "main"