diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 185284e108e..00000000000 --- a/.drone.yml +++ /dev/null @@ -1,267 +0,0 @@ ---- -kind: pipeline -name: test - -trigger: - event: - - push - - tag - -platform: - os: linux - arch: amd64 - -steps: -- name: test - pull: default - image: node:14 - commands: - - scripts/ci - ---- -kind: pipeline -name: hosted-master - -depends_on: -- test - -trigger: - ref: - - "refs/heads/master" - event: - - push - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - commands: - - ./scripts/build-hosted - -- name: upload-gate - pull: default - image: node:14 - commands: - - ./scripts/build-upload-gate - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/latest - target: releases.rancher.com/dashboard/latest - token: - from_secret: google_auth_key - ---- -kind: pipeline -name: hosted-branch - -depends_on: -- test - -trigger: - ref: - - "refs/heads/*-dev" - - "refs/heads/release-*" - event: - - push - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - commands: - - ./scripts/build-hosted - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_BRANCH} - target: releases.rancher.com/dashboard/${DRONE_BRANCH} - token: - from_secret: google_auth_key - ---- -kind: pipeline -name: hosted-tag - -depends_on: -- test - -trigger: - event: - - tag - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - commands: - - ./scripts/build-hosted - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_TAG} - target: releases.rancher.com/dashboard/${DRONE_TAG} - token: - from_secret: google_auth_key - ---- -kind: pipeline -name: embedded-master - -depends_on: -- test - -trigger: - ref: - - "refs/heads/master" - event: - - push - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - environment: - EMBED_PKG: https://releases.rancher.com/harvester-ui/plugin/harvester-1.0.3.tar.gz - commands: - - ./scripts/build-embedded - -- name: upload-gate - pull: default - image: node:14 - commands: - - ./scripts/build-upload-gate - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_BRANCH}.tar.gz - target: releases.rancher.com/dashboard/latest.tar.gz - token: - from_secret: google_auth_key - ---- -kind: pipeline -name: embedded-branch - -depends_on: -- test - -trigger: - ref: - - "refs/heads/*-dev" - - "refs/heads/release-*" - event: - - push - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - environment: - EMBED_PKG: https://releases.rancher.com/harvester-ui/plugin/harvester-1.0.3.tar.gz - commands: - - ./scripts/build-embedded - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_BRANCH}.tar.gz - target: releases.rancher.com/dashboard/${DRONE_BRANCH}.tar.gz - token: - from_secret: google_auth_key - ---- -kind: pipeline -name: embedded-tag - -depends_on: -- test - -trigger: - event: - - tag - -platform: - os: linux - arch: amd64 - -steps: -- name: build - pull: default - image: node:14 - environment: - EMBED_PKG: https://releases.rancher.com/harvester-ui/plugin/harvester-1.0.3.tar.gz - commands: - - ./scripts/build-embedded - -- name: upload - pull: default - image: plugins/gcs - settings: - acl: - - allUsers:READER - cache_control: "no-cache,must-revalidate" - source: dist/${DRONE_TAG}.tar.gz - target: releases.rancher.com/dashboard/${DRONE_TAG}.tar.gz - token: - from_secret: google_auth_key - -# --- - -# kind: pipeline -# name: fossa - -# steps: -# - name: fossa -# image: rancher/drone-fossa:latest -# failure: ignore -# settings: -# api_key: -# from_secret: FOSSA_API_KEY -# when: -# instance: -# - drone-publish.rancher.io \ No newline at end of file diff --git a/.github/actions/i18n-lint/action.yaml b/.github/actions/i18n-lint/action.yaml new file mode 100644 index 00000000000..2464bc926d5 --- /dev/null +++ b/.github/actions/i18n-lint/action.yaml @@ -0,0 +1,12 @@ +name: Run i18n Lint +description: Run i18n Lint + +runs: + using: 'composite' + steps: + - name: Setup env + uses: ./.github/actions/setup + + - name: Run i18n linters + shell: bash + run: yarn lint-l10n diff --git a/.github/actions/lint/action.yaml b/.github/actions/lint/action.yaml new file mode 100644 index 00000000000..77895a3cf3c --- /dev/null +++ b/.github/actions/lint/action.yaml @@ -0,0 +1,12 @@ +name: Run Lint +description: Run Lint + +runs: + using: 'composite' + steps: + - name: Setup env + uses: ./.github/actions/setup + + - name: Run linters + shell: bash + run: yarn lint diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 00000000000..53b8ef4abc1 --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -0,0 +1,14 @@ +name: Setup UI Env +description: Setup node, python and call bootstrap script + +runs: + using: 'composite' + steps: + - uses: actions/setup-node@v3 + with: + node-version: '14.x' + cache: 'yarn' + + - name: Install packages + shell: bash + run: yarn install:ci diff --git a/.github/actions/unit-tests/action.yaml b/.github/actions/unit-tests/action.yaml new file mode 100644 index 00000000000..a7ad8b8346f --- /dev/null +++ b/.github/actions/unit-tests/action.yaml @@ -0,0 +1,14 @@ +name: Run Unit Tests +description: Run Unit Tests + +runs: + using: 'composite' + steps: + - name: Setup env + uses: ./.github/actions/setup + + - name: Run tests + shell: bash + run: | + yarn test:ci + \ No newline at end of file diff --git a/.github/workflows/build-and-upload-branch.yaml b/.github/workflows/build-and-upload-branch.yaml new file mode 100644 index 00000000000..c937ae15efe --- /dev/null +++ b/.github/workflows/build-and-upload-branch.yaml @@ -0,0 +1,21 @@ +name: Build Dashboard (Branch) +on: + push: + branches: + - 'release-2.8*' + - '*-dev' + +jobs: + build-validation: + name: Build Test + uses: ./.github/workflows/build-test.yaml + build: + name: Build and Upload + uses: ./.github/workflows/build-and-upload.yaml + needs: + - build-validation + permissions: + contents: 'read' + id-token: 'write' + with: + CI_BRANCH: ${{github.ref_name}} diff --git a/.github/workflows/build-and-upload-release-2-8.yaml b/.github/workflows/build-and-upload-release-2-8.yaml new file mode 100644 index 00000000000..79bdb02031e --- /dev/null +++ b/.github/workflows/build-and-upload-release-2-8.yaml @@ -0,0 +1,20 @@ +name: Build Dashboard 2.8 (Release) +on: + push: + tags: + - v2.8.* + +jobs: + build-validation: + name: Validate Code + uses: ./.github/workflows/build-test.yaml + build: + name: Build and Upload + uses: ./.github/workflows/build-and-upload.yaml + needs: + - build-validation + permissions: + contents: 'read' + id-token: 'write' + with: + CI_BUILD_TAG: ${{github.ref_name}} diff --git a/.github/workflows/build-and-upload.yaml b/.github/workflows/build-and-upload.yaml new file mode 100644 index 00000000000..1d09571449c --- /dev/null +++ b/.github/workflows/build-and-upload.yaml @@ -0,0 +1,111 @@ +name: Build Dashboard and Upload + +on: + workflow_call: + inputs: + CI_BRANCH: + required: false + type: string + CI_BUILD_TAG: + required: false + type: string + +env: + CI_BUILD_TAG: ${{inputs.CI_BUILD_TAG}} + CI_BRANCH: ${{inputs.CI_BRANCH}} + GIT_REPO: ${{github.repository}} + GIT_COMMIT: ${{github.sha}} + REPO: ${{github.event.repository.name || ''}} + +jobs: + build-and-upload-hosted: + name: Build & Upload Hosted + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + # Note - Cannot use the setup action here as it uses a different yarn install arg + - uses: actions/setup-node@v3 + with: + node-version: '14.x' + cache: 'yarn' + + # Build a directory containing the dashboard that can be used with ui-dashboard-index + - id: build-hosted + name: Build Hosted + run: ./scripts/build-hosted + + - id: upload-gate + name: Upload Gate (superceded by a newer build?) + run: ./scripts/build-upload-gate + + - name: Get gcs auth + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH + + - name: Apply gcs auth + # https://github.com/google-github-actions/auth + uses: 'google-github-actions/auth@v2' + with: + credentials_json: "${{ env.GOOGLE_AUTH }}" + + - name: Upload build + uses: 'google-github-actions/upload-cloud-storage@v2' + # https://github.com/google-github-actions/upload-cloud-storage + with: + path: ${{steps.build-hosted.outputs.BUILD_HOSTED_DIR}} + # Example - https://releases.rancher.com/ui/2.8.0/... + destination: releases.rancher.com/${{ env.REPO }}/${{ steps.build-hosted.outputs.BUILD_HOSTED_LOCATION }} + parent: false + headers: |- + cache-control: no-cache,must-revalidate + process_gcloudignore: false + + build-and-upload-embedded: + name: Build & Upload Embedded + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + # Note - Cannot use the setup action here as it uses a different yarn install arg + - uses: actions/setup-node@v3 + with: + node-version: '14.x' + cache: 'yarn' + + # Build a tar that will be picked up by rancher builds and embedded into it + - id: build-embedded + name: Build Embedded + run: ./scripts/build-embedded + env: + EMBED_PKG: https://releases.rancher.com/harvester-ui/plugin/harvester-1.0.3.tar.gz + + - name: Get gcs auth + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH + + - name: Apply gcs auth + # https://github.com/google-github-actions/auth + uses: 'google-github-actions/auth@v2' + with: + credentials_json: "${{ env.GOOGLE_AUTH }}" + + - name: Upload tar + uses: 'google-github-actions/upload-cloud-storage@v2' + with: + path: ${{steps.build-embedded.outputs.BUILD_EMBEDED_TGZ}} + # Example - https://releases.rancher.com/ui/2.8.0.tar.gz + destination: releases.rancher.com/${{ env.REPO }} + parent: false + headers: |- + cache-control: no-cache,must-revalidate + process_gcloudignore: false + \ No newline at end of file diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml new file mode 100644 index 00000000000..b8ba454680f --- /dev/null +++ b/.github/workflows/build-test.yaml @@ -0,0 +1,37 @@ +# Validation steps required before a build occurs. Not designed to replace the CI test workflow +name: Build Test + +on: + # This tells GH that the workflow is reusable + workflow_call: + +jobs: + unit-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Run tests + uses: ./.github/actions/unit-tests + + i18n: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Run i18n lint + uses: ./.github/actions/i18n-lint + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Run lint + uses: ./.github/actions/lint diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c081376198b..1eca4b7396f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,18 +2,17 @@ name: Tests on: push: branches: - - master - - 'release-*' + - 'release-2.8*' pull_request: - branches: - - master - - 'release-*' + branches: + - 'release-2.8*' workflow_dispatch: - environment: - description: 'Environment to run tests against' - type: environment - required: true - + inputs: + environment: + description: 'Environment to run tests against' + type: environment + required: true + env: TEST_USERNAME: admin TEST_PASSWORD: password @@ -26,9 +25,42 @@ env: # Build the dashboard to use in tests. When set to false it will grab `latest` from CDN (useful for running e2e tests quickly) BUILD_DASHBOARD: true + E2E_BUILD_DIST_NAME: dist + E2E_BUILD_DIST_DIR: dist + E2E_BUILD_DIST_EMBER_NAME: dist_ember + E2E_BUILD_DIST_EMBER_DIR: dist_ember + jobs: + e2e-ui-build: + if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Setup env + uses: ./.github/actions/setup + - name: Build e2e + run: yarn e2e:build + - name: Upload e2e build + uses: actions/upload-artifact@v4 + with: + name: ${{ env.E2E_BUILD_DIST_NAME }} + path: ${{ env.E2E_BUILD_DIST_DIR }}/ + if-no-files-found: error + retention-days: 10 + compression-level: 9 + - name: Upload e2e build ember + uses: actions/upload-artifact@v4 + with: + name: ${{ env.E2E_BUILD_DIST_EMBER_NAME }} + path: ${{ env.E2E_BUILD_DIST_EMBER_DIR }}/ + if-no-files-found: error + retention-days: 10 + compression-level: 9 e2e-test: if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')" + needs: e2e-ui-build strategy: fail-fast: false matrix: @@ -50,9 +82,8 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: actions/setup-node@v3 - with: - node-version: '14.x' + - name: Setup env + uses: ./.github/actions/setup # Installing fixed version of Chrome since latest version does not work (117-118 didn't work) # Leaving this here again in case we need to pin to a specific Chrome version in the future @@ -64,11 +95,19 @@ jobs: # sudo apt-get install -y --allow-downgrades ./google-chrome-stable_116.0.5845.187-1_amd64.deb # google-chrome --version - - name: Install packages - run: yarn install:ci + - name: Download e2e build + uses: actions/download-artifact@v4 + with: + name: ${{ env.E2E_BUILD_DIST_NAME }} + path: ${{ env.E2E_BUILD_DIST_DIR }} + - name: Download e2e build ember + uses: actions/download-artifact@v4 + with: + name: ${{ env.E2E_BUILD_DIST_EMBER_NAME }} + path: ${{ env.E2E_BUILD_DIST_EMBER_DIR }} - - name: Prepare build - run: yarn e2e:pre-prod + - name: Run Rancher + run: yarn e2e:docker - name: Setup Rancher and user run: | @@ -100,16 +139,12 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: actions/setup-node@v3 - with: - node-version: '14.x' - - - name: Install packages - run: yarn install:ci - name: Run tests + uses: ./.github/actions/unit-tests + + - name: Collect Coverage run: | - yarn test:ci mkdir -p coverage-artifacts/coverage cp coverage/unit/coverage-final.json coverage-artifacts/coverage/coverage-unit.json cp -r coverage/unit/ coverage-artifacts/coverage/unit/ @@ -126,15 +161,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: actions/setup-node@v3 - with: - node-version: '14.x' - - - name: Install packages - run: yarn install:ci - - - name: Run i18n linters - run: yarn lint-l10n + + - name: Run i18n lint + uses: ./.github/actions/i18n-lint lint: runs-on: ubuntu-latest @@ -142,15 +171,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: actions/setup-node@v3 - with: - node-version: '14.x' - - - name: Install packages - run: yarn install:ci - - - name: Run linters - run: yarn lint + + - name: Run tests + uses: ./.github/actions/lint coverage: runs-on: ubuntu-latest diff --git a/README.md b/README.md index e75b41a774c..5a42fc41111 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Developer documentation and documentation for our UI components is available her Rancher Dashboard supports an extension mechanism that allows developers to build there own extensions that can be developed independently of Rancher and loaded into a deployed Rancher installation to extend its functionality. You can learn more from our [Rancher Extensions Docs](https://rancher.github.io/dashboard/extensions/introduction). - # What is it? Rancher Dashboard provides a sophisticated UI for managing Kubernetes clusters and Workloads. diff --git a/package.json b/package.json index f255177576c..d247b948f26 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "cy:open": "cypress open", "cy:run": "cypress run --browser chrome", "cy:run:sorry": "./scripts/e2e", - "e2e:pre-dev": "yarn docker:local:stop && yarn docker:local:start && NODE_ENV=dev TEST_INSTRUMENT=true yarn build", + "e2e:build": "mkdir dist && TEST_INSTRUMENT=true ./scripts/build-e2e", + "e2e:docker": "yarn docker:local:stop && ./scripts/e2e-docker-start ", "e2e:dev": "START_SERVER_AND_TEST_INSECURE=1 server-test start:dev https-get://localhost:8005 cy:run:sorry", "e2e:pre-prod": "yarn docker:local:stop && mkdir dist && TEST_INSTRUMENT=true ./scripts/build-e2e && ./scripts/e2e-docker-start ", "e2e:prod": "BUILD_DASHBOARD=$BUILD_DASHBOARD GREP_TAGS=$GREP_TAGS TEST_USERNAME=$TEST_USERNAME TEST_BASE_URL=https://127.0.0.1/dashboard yarn cy:run:sorry", @@ -208,4 +209,4 @@ "follow-redirects": ">=1.14.7", "merge": ">=2.1.1" } -} +} \ No newline at end of file diff --git a/scripts/build-e2e b/scripts/build-e2e index 40cb8e30612..6c6162841d2 100755 --- a/scripts/build-e2e +++ b/scripts/build-e2e @@ -24,7 +24,7 @@ source scripts/version echo "BRANCH: ${COMMIT_BRANCH:-}" echo "TAG: ${GIT_TAG:-}" -OUTPUT_DIR=dist +OUTPUT_DIR="${E2E_BUILD_DIST_DIR:-dist}" echo "Building..." COMMIT=${COMMIT} VERSION=${VERSION} OUTPUT_DIR=$OUTPUT_DIR ROUTER_BASE='/dashboard/' RESOURCE_BASE='/dashboard/' yarn run build @@ -33,7 +33,7 @@ COMMIT=${COMMIT} VERSION=${VERSION} OUTPUT_DIR=$OUTPUT_DIR ROUTER_BASE='/dashboa # Note - We can't pull the `latest2` directory from CDN and we don't build a tar.gz for latest builds... # ..so just fetch the latest index.html which references latest CDN bits -OUTPUT_EMBER_DIR=dist_ember +OUTPUT_EMBER_DIR="${E2E_BUILD_DIST_EMBER_DIR:-dist_ember}" echo "Pulling latest rancher/ui" mkdir $OUTPUT_EMBER_DIR diff --git a/scripts/build-embedded b/scripts/build-embedded index 14ebb7b63cc..6e673b61853 100755 --- a/scripts/build-embedded +++ b/scripts/build-embedded @@ -45,8 +45,13 @@ find $OUTPUT_DIR -name "index.html" -mindepth 2 -exec rm {} \; find $OUTPUT_DIR -type d -empty -depth -exec rmdir {} \; TARBALL=${DIR}.tar.gz +TARBALL_FILE_PATH=dist/${TARBALL} + +ENV_OUTPUT="${GITHUB_OUTPUT:-"temp-env"}" +echo "BUILD_EMBEDED_TGZ=${TARBALL_FILE_PATH}" >> "$ENV_OUTPUT" + echo "Compressing to ${TARBALL}..." -tar -czf dist/${TARBALL} $OUTPUT_DIR/ +tar -czf ${TARBALL_FILE_PATH} $OUTPUT_DIR/ echo "Cleaning up..." rm -r $OUTPUT_DIR diff --git a/scripts/build-hosted b/scripts/build-hosted index 865347804ff..0d58d1775ab 100755 --- a/scripts/build-hosted +++ b/scripts/build-hosted @@ -25,4 +25,10 @@ BASE=${BASE:-https://releases.rancher.com/dashboard/${DIR}} echo "Building for ${BASE}..." -COMMIT=${COMMIT} VERSION=${VERSION} OUTPUT_DIR=dist/${DIR} ROUTER_BASE="/dashboard/" RESOURCE_BASE="${BASE}" yarn run build +OUTPUT_DIR=dist/${DIR} + +ENV_OUTPUT="${GITHUB_OUTPUT:-"temp-env"}" +echo "BUILD_HOSTED_DIR=${OUTPUT_DIR}" >> "$ENV_OUTPUT" +echo "BUILD_HOSTED_LOCATION=${DIR}" >> "$ENV_OUTPUT" + +COMMIT=${COMMIT} VERSION=${VERSION} OUTPUT_DIR=${OUTPUT_DIR} ROUTER_BASE="/dashboard/" RESOURCE_BASE="${BASE}" yarn run build diff --git a/scripts/build-upload-gate b/scripts/build-upload-gate index 4317abda405..13c494d1769 100755 --- a/scripts/build-upload-gate +++ b/scripts/build-upload-gate @@ -9,32 +9,32 @@ if [[ -n "${BUILD_DEBUG}" ]]; then env fi -if [[ -n "$DRONE_TAG" ]]; then +if [[ -n "$CI_BUILD_TAG" ]]; then echo "Build has been triggered by a tag. Skipping gate" exit 0 fi -if [[ -z "$DRONE_BRANCH" ]]; then +if [[ -z "$CI_BRANCH" ]]; then echo "No branch detected. Skipping gate" exit 0 fi -if [[ -z "$DRONE_REPO" ]]; then +if [[ -z "$GIT_REPO" ]]; then echo "No repository detected. Unable to gate" exit 1 fi -if [[ -z "$DRONE_COMMIT" ]]; then +if [[ -z "$GIT_COMMIT" ]]; then echo "No commit detected. Unable to gate" exit 1 fi -echo "Repo: $DRONE_REPO" -echo "Branch: $DRONE_BRANCH" -echo "Build Commit: $DRONE_COMMIT" +echo "Repo: $GIT_REPO" +echo "Branch: $CI_BRANCH" +echo "Build Commit: $GIT_COMMIT" tmp=$(mktemp -u) -STATUS_CODE=$(curl -w "%{http_code}" -s -o $tmp https://api.github.com/repos/$DRONE_REPO/branches/$DRONE_BRANCH) +STATUS_CODE=$(curl -w "%{http_code}" -s -o $tmp https://api.github.com/repos/$GIT_REPO/branches/$CI_BRANCH) if [ "$STATUS_CODE" == "403" ]; then RATE_LIMIT_REMAINING=$(curl -s https://api.github.com/rate_limit | ./scripts/jq-nano - rate remaining) @@ -55,7 +55,7 @@ if [ -z "$LATEST_BRANCH_COMMIT" ]; then exit 1 fi -if [ "$LATEST_BRANCH_COMMIT" == "$DRONE_COMMIT" ]; then +if [ "$LATEST_BRANCH_COMMIT" == "$GIT_COMMIT" ]; then echo "Build was created from latest commit, passed upload gate" else echo "Build was not created from latest commit, failing gate" diff --git a/scripts/ci b/scripts/ci deleted file mode 100755 index 6848c5258b1..00000000000 --- a/scripts/ci +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -BUILD_DEBUG="${BUILD_DEBUG:-}" -if [[ -n "${BUILD_DEBUG}" ]]; then - set -x - env -fi - -cd $(dirname $0)/.. - -echo "Bootstrapping..." -yarn --pure-lockfile install - -echo "Linting..." -yarn run lint - -echo "Linting translations..." -yarn run lint-l10n - -echo "Testing..." -yarn run test:ci - -echo "Building..." -yarn run build diff --git a/scripts/version b/scripts/version index c1eee348da8..d4af4084bdf 100755 --- a/scripts/version +++ b/scripts/version @@ -8,7 +8,7 @@ fi COMMIT=$(git rev-parse --short HEAD) COMMIT_DATE=$(git --no-pager log -1 --format='%ct') COMMIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed -E 's/[^a-zA-Z0-9.-]+/-/g') -GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)} +GIT_TAG=${CI_BUILD_TAG:-$(git tag -l --contains HEAD | head -n 1)} LAST_TAG=${GIT_TAG:-'v0.0.0'} if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then