From 93037b7960692a29b9a57046abfc73c85b3215b3 Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Thu, 5 Sep 2024 12:03:34 +0530 Subject: [PATCH 01/19] SIGINT-2010: automate QAExt and Prod release process --- .github/workflows/check-coverage.yml | 1 + .github/workflows/check-dist.yml | 1 + .github/workflows/deploy-Extension.yml | 42 +++++++ .github/workflows/publish-QAExtension.yml | 130 ++++++++++++++++++++++ extension_version.txt | 1 + 5 files changed, 175 insertions(+) create mode 100644 .github/workflows/deploy-Extension.yml create mode 100644 .github/workflows/publish-QAExtension.yml create mode 100644 extension_version.txt diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml index 9597d688..080f8b7c 100644 --- a/.github/workflows/check-coverage.yml +++ b/.github/workflows/check-coverage.yml @@ -15,6 +15,7 @@ on: jobs: code-coverage: + if: "!contains(github.event.commits[0].message, '[skip ci]')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index f9dcd3e8..b254e4bc 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -20,6 +20,7 @@ on: jobs: check-dist: + if: "!contains(github.event.commits[0].message, '[skip ci]')" runs-on: ubuntu-latest steps: diff --git a/.github/workflows/deploy-Extension.yml b/.github/workflows/deploy-Extension.yml new file mode 100644 index 00000000..320dee9f --- /dev/null +++ b/.github/workflows/deploy-Extension.yml @@ -0,0 +1,42 @@ +name: deploy-synopsys-extension + +on: + workflow_dispatch: + +jobs: + deploy-synopsys-extension: + if: "!contains(github.event.commits[0].message, '[skip ci]')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: deploy-extension + id: deploy-extension + env: + DEPLOY_PUBLISHER_NAME: ${{ secrets.DEPLOY_PUBLISHER_NAME }} + DEPLOY_ORGANIZATION_NAME: ${{ secrets.DEPLOY_ORG_NAME }} + USER_TOKEN: ${{ secrets.DEPLOY_USER_TOKEN }} #personal_access_token of azure devops account + run: | + vss_extension=$(cat vss-extension.json) + extension_name=$(echo $vss_extension | jq -r '.name' ) + echo "Extension Name:" $extension_name + extension_version=$(echo $vss_extension | jq -r '.version') + echo "Extension Version:" $extension_version + echo "Install dependencies && Rebuild the dist/ directory" + cd synopsys-task && npm ci && npm run build && npm run package + cd ../ + echo "Installing tfx-cli..." + npm i -g tfx-cli + echo "Creating extension $extension_name with version $extension_version" + npx tfx-cli extension create --manifest-globs vss-extension.json + echo "Extension $extension_name created successfully!" + echo "Publishing extension $extension_name with version $extension_version" +# tfx extension publish --publisher ${DEPLOY_PUBLISHER_NAME} --manifest-globs vss-extension.json --token ${USER_TOKEN} | tee tfx_output.log +# publish_exit_code=${PIPESTATUS[0]} +# if [ $publish_exit_code -eq 0 ]; then +# echo "Extension $extension_name with version $extension_version published successfully!" +# else +# echo "Failed to publish the extension $extension_name with version $extension_version." +# exit 1 +# fi + diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml new file mode 100644 index 00000000..628716ee --- /dev/null +++ b/.github/workflows/publish-QAExtension.yml @@ -0,0 +1,130 @@ +name: publish-QAExtension + +on: + workflow_dispatch: + +jobs: + publish-QAExtension: + if: "!contains(github.event.commits[0].message, '[skip ci]')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + + with: + node-version: 20.x + + - name: versioning + id: version-update + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + run: | + vss_extension_dev=$(cat vss-extension-dev.json) + extension_name=$(echo $vss_extension_dev | jq -r '.name' ) + echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV + echo "EXTENSION NAME: "$extension_name + current_extension_version=$(echo $vss_extension_dev | jq -r '.version') + echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV + echo "CURRENT QAEXTENSION VERSION: " $current_extension_version + previous_published_qaextension_version=$(grep 'published_qaextension_version' extension_version.txt | cut -d '=' -f 2) + echo "PREVIOUS PUBLISHED QAEXTENSION VERSION: " $previous_published_qaextension_version + previous_major=$(echo $previous_published_qaextension_version | awk -F. '{print $1}') + previous_minor=$(echo $previous_published_qaextension_version | awk -F. '{print $2}') + current_major=$(echo $current_extension_version | awk -F. '{print $1}') + current_minor=$(echo $current_extension_version | awk -F. '{print $2}') + current_patch=$(echo $current_extension_version | awk -F. '{print $3}') + if [ "$previous_major" -eq "$current_major" ] && [ "$previous_minor" -eq "$current_minor" ]; then + current_patch=$((current_patch+1)) + new_version=$current_major.$current_minor.$current_patch + echo "Updating extension version to: ${new_version}" + + echo "Updating vss-extension-dev.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json + echo "Updated vss-extension-dev.json file" + cat vss-extension-dev.json + echo + else + new_version=$current_extension_version + echo "Extension version will not be updating automatically. Current version: ${new_version}" + fi + + echo "Updating extension_version.txt with the new version: ${new_version}" + sed -i "s/published_extension_version=.*/published_extension_version=$new_version/" extension_version.txt + cat extension_version.txt + echo + echo "Updated extension_version.txt file" + + cd synopsys-task + echo "Updating package.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json + cat package.json + echo "Updated package.json file" + echo + + echo "Updating package-lock.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '(.version = $new_version) | (.packages[""].version = $new_version)' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json + echo "Updated package-lock.json file" + echo + + echo "Updating task.json with the new version: ${new_version}" + jq --argjson major "$current_major" --argjson minor "$current_minor" --argjson patch "$current_patch" '(.version.Major = $major) | (.version.Minor = $minor) | (.version.Patch = $patch)' task.json > task.json.tmp && mv task.json.tmp task.json + echo "Updated task.json file" + + echo "NEW_VERSION=$new_version" >> $GITHUB_ENV + - name: publish-QAExtension + id: publish-qaextension + if: ${{ steps.version-update.conclusion == 'success' }} + env: + PUBLISHER_NAME: ${{ secrets.PUBLISHER_NAME }} + ORGANIZATION_NAME: ${{ secrets.ORG_NAME }} + USER_TOKEN: ${{ secrets.USER_TOKEN }} #personal_access_token of azure devops account + run: | + vss_extension_dev=$(cat vss-extension-dev.json) + extension_name=$(echo $vss_extension_dev | jq -r '.name' ) + echo "Extension Name:" $extension_name + extension_version=$(echo $vss_extension_dev | jq -r '.version') + echo "Extension Version:" $extension_version + echo "Install dependencies && Rebuild the dist/ directory" + cd synopsys-task && npm ci && npm run build && npm run package + cd ../ + echo "Installing tfx-cli..." + npm i -g tfx-cli + echo "Creating extension $extension_name with version $extension_version" + npx tfx-cli extension create --manifest-globs vss-extension-dev.json + echo "Extension $extension_name created successfully!" + echo "Publishing extension $extension_name with version $extension_version" + publish_exit_code=${PIPESTATUS[0]} + if [ $publish_exit_code -eq 0 ]; then + echo "Extension $extension_name with version $extension_version published successfully!" + else + echo "Failed to publish the extension $extension_name with version $extension_version." + exit 1 + fi + + # npm i -g tfx-cli + # tfx extension publish --publisher ${PUBLISHER_NAME} --manifest-globs vss-extension-dev.json --share-with ${ORGANIZATION_NAME} --token ${USER_TOKEN} | tee tfx_output.log + # tfx extension publish --publisher TestCIPub --manifest-globs vss-extension-dev.json --token ${USER_TOKEN} | tee tfx_output.log + + - name: update extension version in file + id: update-extension-version + if: ${{ steps.publish-qaextension.conclusion == 'success' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + run: | + echo "Updating extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file" + git config --local user.name "$(git log -n 1 --pretty=format:%an)" + git config --local user.email "$(git log -n 1 --pretty=format:%ae)" + git add vss-extension-dev.json extension_version.txt + cd synopsys-task + git add package.json package-lock.json task.json + git commit -m "update extension version [skip ci]" + git push origin main + echo "Successful updated extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file..." + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.EXTENSION_NAME }}-${{ env.NEW_VERSION }}.vsix + path: "*.vsix" \ No newline at end of file diff --git a/extension_version.txt b/extension_version.txt new file mode 100644 index 00000000..7fcafe85 --- /dev/null +++ b/extension_version.txt @@ -0,0 +1 @@ +published_qaextension_version=1.9.0 \ No newline at end of file From b57ab63d6c6e62217855266a62a746527b6964de Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Mon, 9 Sep 2024 10:49:24 +0530 Subject: [PATCH 02/19] SIGINT-2010: automate QAExt and Prod release process --- .github/workflows/deploy-Extension.yml | 16 ++++++++-------- .github/workflows/publish-QAExtension.yml | 7 ++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-Extension.yml b/.github/workflows/deploy-Extension.yml index 320dee9f..e387c8ca 100644 --- a/.github/workflows/deploy-Extension.yml +++ b/.github/workflows/deploy-Extension.yml @@ -31,12 +31,12 @@ jobs: npx tfx-cli extension create --manifest-globs vss-extension.json echo "Extension $extension_name created successfully!" echo "Publishing extension $extension_name with version $extension_version" -# tfx extension publish --publisher ${DEPLOY_PUBLISHER_NAME} --manifest-globs vss-extension.json --token ${USER_TOKEN} | tee tfx_output.log -# publish_exit_code=${PIPESTATUS[0]} -# if [ $publish_exit_code -eq 0 ]; then -# echo "Extension $extension_name with version $extension_version published successfully!" -# else -# echo "Failed to publish the extension $extension_name with version $extension_version." -# exit 1 -# fi + tfx extension publish --publisher ${DEPLOY_PUBLISHER_NAME} --manifest-globs vss-extension.json --token ${DEPLOY_USER_TOKEN} | tee tfx_output.log + publish_exit_code=${PIPESTATUS[0]} + if [ $publish_exit_code -eq 0 ]; then + echo "Extension $extension_name with version $extension_version published successfully!" + else + echo "Failed to publish the extension $extension_name with version $extension_version." + exit 1 + fi diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index 628716ee..dae188eb 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -51,7 +51,7 @@ jobs: fi echo "Updating extension_version.txt with the new version: ${new_version}" - sed -i "s/published_extension_version=.*/published_extension_version=$new_version/" extension_version.txt + sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt cat extension_version.txt echo echo "Updated extension_version.txt file" @@ -95,6 +95,7 @@ jobs: npx tfx-cli extension create --manifest-globs vss-extension-dev.json echo "Extension $extension_name created successfully!" echo "Publishing extension $extension_name with version $extension_version" + tfx extension publish --publisher ${PUBLISHER_NAME} --manifest-globs vss-extension-dev.json --token ${USER_TOKEN} | tee tfx_output.log publish_exit_code=${PIPESTATUS[0]} if [ $publish_exit_code -eq 0 ]; then echo "Extension $extension_name with version $extension_version published successfully!" @@ -103,10 +104,6 @@ jobs: exit 1 fi - # npm i -g tfx-cli - # tfx extension publish --publisher ${PUBLISHER_NAME} --manifest-globs vss-extension-dev.json --share-with ${ORGANIZATION_NAME} --token ${USER_TOKEN} | tee tfx_output.log - # tfx extension publish --publisher TestCIPub --manifest-globs vss-extension-dev.json --token ${USER_TOKEN} | tee tfx_output.log - - name: update extension version in file id: update-extension-version if: ${{ steps.publish-qaextension.conclusion == 'success' }} From fdf7edb9faf3b0cbf6c754bb8412addebcf4363b Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Tue, 10 Sep 2024 10:55:18 +0530 Subject: [PATCH 03/19] SIGINT-2010: automate QAExt and Prod release process --- .../{deploy-Extension.yml => deploy-synopsys-extension.yml} | 5 +++++ .github/workflows/publish-QAExtension.yml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) rename .github/workflows/{deploy-Extension.yml => deploy-synopsys-extension.yml} (94%) diff --git a/.github/workflows/deploy-Extension.yml b/.github/workflows/deploy-synopsys-extension.yml similarity index 94% rename from .github/workflows/deploy-Extension.yml rename to .github/workflows/deploy-synopsys-extension.yml index e387c8ca..279e5adc 100644 --- a/.github/workflows/deploy-Extension.yml +++ b/.github/workflows/deploy-synopsys-extension.yml @@ -10,6 +10,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: deploy-extension id: deploy-extension env: diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index dae188eb..75560d45 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -12,7 +12,6 @@ jobs: - name: Set Node.js 20.x uses: actions/setup-node@v4 - with: node-version: 20.x From 8e1dcb4340ff5706a71629383a00a78de6e4958c Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Thu, 12 Sep 2024 11:07:36 +0530 Subject: [PATCH 04/19] SIGINT-2010: automate QAExt and Prod release process --- .github/workflows/check-coverage.yml | 1 - .github/workflows/check-dist.yml | 1 - .../workflows/deploy-synopsys-extension.yml | 86 +++++++++++++------ .github/workflows/publish-QAExtension.yml | 43 +++------- 4 files changed, 75 insertions(+), 56 deletions(-) diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml index 080f8b7c..9597d688 100644 --- a/.github/workflows/check-coverage.yml +++ b/.github/workflows/check-coverage.yml @@ -15,7 +15,6 @@ on: jobs: code-coverage: - if: "!contains(github.event.commits[0].message, '[skip ci]')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index b254e4bc..f9dcd3e8 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -20,7 +20,6 @@ on: jobs: check-dist: - if: "!contains(github.event.commits[0].message, '[skip ci]')" runs-on: ubuntu-latest steps: diff --git a/.github/workflows/deploy-synopsys-extension.yml b/.github/workflows/deploy-synopsys-extension.yml index 279e5adc..345ca016 100644 --- a/.github/workflows/deploy-synopsys-extension.yml +++ b/.github/workflows/deploy-synopsys-extension.yml @@ -15,33 +15,71 @@ jobs: with: node-version: 20.x - - name: deploy-extension - id: deploy-extension + - name: versioning + id: version-update env: - DEPLOY_PUBLISHER_NAME: ${{ secrets.DEPLOY_PUBLISHER_NAME }} - DEPLOY_ORGANIZATION_NAME: ${{ secrets.DEPLOY_ORG_NAME }} - USER_TOKEN: ${{ secrets.DEPLOY_USER_TOKEN }} #personal_access_token of azure devops account + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} run: | vss_extension=$(cat vss-extension.json) extension_name=$(echo $vss_extension | jq -r '.name' ) - echo "Extension Name:" $extension_name - extension_version=$(echo $vss_extension | jq -r '.version') - echo "Extension Version:" $extension_version - echo "Install dependencies && Rebuild the dist/ directory" - cd synopsys-task && npm ci && npm run build && npm run package - cd ../ - echo "Installing tfx-cli..." - npm i -g tfx-cli - echo "Creating extension $extension_name with version $extension_version" - npx tfx-cli extension create --manifest-globs vss-extension.json - echo "Extension $extension_name created successfully!" - echo "Publishing extension $extension_name with version $extension_version" - tfx extension publish --publisher ${DEPLOY_PUBLISHER_NAME} --manifest-globs vss-extension.json --token ${DEPLOY_USER_TOKEN} | tee tfx_output.log - publish_exit_code=${PIPESTATUS[0]} - if [ $publish_exit_code -eq 0 ]; then - echo "Extension $extension_name with version $extension_version published successfully!" + echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV + echo "EXTENSION NAME: "$extension_name + current_extension_version=$(echo $vss_extension | jq -r '.version') + echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV + echo "CURRENT EXTENSION VERSION: " $current_extension_version + current_major=$(echo $current_extension_version | awk -F. '{print $1}') + current_minor=$(echo $current_extension_version | awk -F. '{print $2}') + current_patch=$(echo $current_extension_version | awk -F. '{print $3}') + COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1) + echo "commit message: " $COMMIT_MESSAGE + if [[ "$COMMIT_MESSAGE" == *"upgrade-version"* ]]; then + new_version=$current_extension_version + echo "Updating vss-extension-dev.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json + echo "Updated vss-extension-dev.json file" + cat vss-extension-dev.json + + echo "Updating extension_version.txt with the new version: ${new_version}" + sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt + cat extension_version.txt + echo "Updated extension_version.txt file" + echo + + cd synopsys-task + echo "Updating package.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Updated package.json file" + echo + + echo "Updating package-lock.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '(.version = $new_version) | (.packages[""].version = $new_version)' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json + echo "Updated package-lock.json file" + echo + + echo "Updating task.json with the new version: ${new_version}" + jq --argjson major "$current_major" --argjson minor "$current_minor" --argjson patch "$current_patch" '(.version.Major = $major) | (.version.Minor = $minor) | (.version.Patch = $patch)' task.json > task.json.tmp && mv task.json.tmp task.json + echo "Updated task.json file" else - echo "Failed to publish the extension $extension_name with version $extension_version." - exit 1 - fi + new_version=$current_extension_version + echo "Extension version will not be updating automatically. Current version: ${new_version}" + fi + echo "NEW_VERSION=$new_version" >> $GITHUB_ENV + - name: update extension version in file + id: update-extension-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + run: | + echo "Updating extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file" + git config --local user.name "$(git log -n 1 --pretty=format:%an)" + git config --local user.email "$(git log -n 1 --pretty=format:%ae)" + git checkout -b extension_version_update + git add vss-extension-dev.json extension_version.txt + echo "Install dependencies && Rebuild the dist/ directory" + cd synopsys-task && npm ci && npm run build && npm run package + git add package.json package-lock.json task.json + git commit -m "upgrade extension version to ${{ env.NEW_VERSION }} [skip ci]" + git push origin extension_version_update + gh pr create --base main --head extension_version_update --title "Version upgrade to ${{ env.NEW_VERSION }}" --body "${{ env.EXTENSION_NAME }} version upgrade to ${{ env.NEW_VERSION }}" --fill + gh pr merge --squash --subject "Extension version upgrade to ${{ env.NEW_VERSION }} [skip ci]" --delete-branch + echo "Successful updated extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file..." diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index 75560d45..96786b89 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -44,34 +44,18 @@ jobs: echo "Updated vss-extension-dev.json file" cat vss-extension-dev.json echo - else - new_version=$current_extension_version - echo "Extension version will not be updating automatically. Current version: ${new_version}" - fi echo "Updating extension_version.txt with the new version: ${new_version}" sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt cat extension_version.txt echo echo "Updated extension_version.txt file" - - cd synopsys-task - echo "Updating package.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json - cat package.json - echo "Updated package.json file" - echo - - echo "Updating package-lock.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '(.version = $new_version) | (.packages[""].version = $new_version)' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json - echo "Updated package-lock.json file" - echo - - echo "Updating task.json with the new version: ${new_version}" - jq --argjson major "$current_major" --argjson minor "$current_minor" --argjson patch "$current_patch" '(.version.Major = $major) | (.version.Minor = $minor) | (.version.Patch = $patch)' task.json > task.json.tmp && mv task.json.tmp task.json - echo "Updated task.json file" - + else + new_version=$current_extension_version + echo "Extension version will not be updating automatically. Current version: ${new_version}" + fi echo "NEW_VERSION=$new_version" >> $GITHUB_ENV + - name: publish-QAExtension id: publish-qaextension if: ${{ steps.version-update.conclusion == 'success' }} @@ -85,9 +69,6 @@ jobs: echo "Extension Name:" $extension_name extension_version=$(echo $vss_extension_dev | jq -r '.version') echo "Extension Version:" $extension_version - echo "Install dependencies && Rebuild the dist/ directory" - cd synopsys-task && npm ci && npm run build && npm run package - cd ../ echo "Installing tfx-cli..." npm i -g tfx-cli echo "Creating extension $extension_name with version $extension_version" @@ -102,6 +83,7 @@ jobs: echo "Failed to publish the extension $extension_name with version $extension_version." exit 1 fi + - name: update extension version in file id: update-extension-version @@ -109,15 +91,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} run: | - echo "Updating extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file" + echo "Updating extension version in vss-extension-dev.json & extension_version.txt file" git config --local user.name "$(git log -n 1 --pretty=format:%an)" git config --local user.email "$(git log -n 1 --pretty=format:%ae)" + git checkout -b qaextension_version_update git add vss-extension-dev.json extension_version.txt - cd synopsys-task - git add package.json package-lock.json task.json - git commit -m "update extension version [skip ci]" - git push origin main - echo "Successful updated extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file..." + git commit -m "update extension version to ${{ env.NEW_VERSION }} [skip ci]" + git push origin qaextension_version_update + echo gh --version + gh pr create --base main --head qaextension_version_update --title "Version upgrade to ${{ env.NEW_VERSION }}" --body "${{ env.EXTENSION_NAME }} version upgrade to ${{ env.NEW_VERSION }}" + gh pr merge --squash --subject "Extension version upgrade to ${{ env.NEW_VERSION }} [skip ci]" --delete-branch - name: Upload Artifact uses: actions/upload-artifact@v4 From bff18f4c0780dc0d1b23ca41c159e7c52ba11f20 Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Tue, 17 Sep 2024 15:40:28 +0530 Subject: [PATCH 05/19] SIGINT-2010: automate QAExt and Prod release process --- .github/workflows/deploy-synopsys-extension.yml | 7 +++++-- .github/workflows/publish-QAExtension.yml | 4 ++-- extension_version.txt | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-synopsys-extension.yml b/.github/workflows/deploy-synopsys-extension.yml index 345ca016..ffa5a22f 100644 --- a/.github/workflows/deploy-synopsys-extension.yml +++ b/.github/workflows/deploy-synopsys-extension.yml @@ -5,7 +5,7 @@ on: jobs: deploy-synopsys-extension: - if: "!contains(github.event.commits[0].message, '[skip ci]')" + if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -31,8 +31,9 @@ jobs: current_minor=$(echo $current_extension_version | awk -F. '{print $2}') current_patch=$(echo $current_extension_version | awk -F. '{print $3}') COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1) + echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV echo "commit message: " $COMMIT_MESSAGE - if [[ "$COMMIT_MESSAGE" == *"upgrade-version"* ]]; then + if [[ "$COMMIT_MESSAGE" == *"version-upgrade"* ]]; then new_version=$current_extension_version echo "Updating vss-extension-dev.json with the new version: ${new_version}" jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json @@ -61,11 +62,13 @@ jobs: echo "Updated task.json file" else new_version=$current_extension_version + echo "Commit message does not contains 'version-upgrade' message" echo "Extension version will not be updating automatically. Current version: ${new_version}" fi echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - name: update extension version in file + if: "contains(env.COMMIT_MESSAGE, 'version-upgrade')" id: update-extension-version env: GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index 96786b89..2cab3f28 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -5,7 +5,7 @@ on: jobs: publish-QAExtension: - if: "!contains(github.event.commits[0].message, '[skip ci]')" + if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -83,7 +83,7 @@ jobs: echo "Failed to publish the extension $extension_name with version $extension_version." exit 1 fi - + - name: update extension version in file id: update-extension-version diff --git a/extension_version.txt b/extension_version.txt index 7fcafe85..be1f7971 100644 --- a/extension_version.txt +++ b/extension_version.txt @@ -1 +1 @@ -published_qaextension_version=1.9.0 \ No newline at end of file +published_qaextension_version=1.10.0 \ No newline at end of file From 1cbf4e5bfd7e85c3805e437b463c120d567c5bd5 Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Wed, 18 Sep 2024 17:14:21 +0530 Subject: [PATCH 06/19] SIGINT-2010: automate QAExt and Prod release process --- ...ion.yml => deploy-blackduck-extension.yml} | 29 ++++++++++++++----- .github/workflows/publish-QAExtension.yml | 21 ++++++++++++-- extension_version.txt | 2 +- vss-extension-dev.json | 2 +- 4 files changed, 42 insertions(+), 12 deletions(-) rename .github/workflows/{deploy-synopsys-extension.yml => deploy-blackduck-extension.yml} (84%) diff --git a/.github/workflows/deploy-synopsys-extension.yml b/.github/workflows/deploy-blackduck-extension.yml similarity index 84% rename from .github/workflows/deploy-synopsys-extension.yml rename to .github/workflows/deploy-blackduck-extension.yml index ffa5a22f..af5bfe4a 100644 --- a/.github/workflows/deploy-synopsys-extension.yml +++ b/.github/workflows/deploy-blackduck-extension.yml @@ -1,10 +1,10 @@ -name: deploy-synopsys-extension +name: deploy-blackduck-extension on: workflow_dispatch: jobs: - deploy-synopsys-extension: + deploy-blackduck-extension: if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ubuntu-latest steps: @@ -15,16 +15,31 @@ jobs: with: node-version: 20.x + - name: Install dependencies + run: cd blackduck-security-task && npm ci + + - name: Rebuild the dist/ directory + run: cd blackduck-security-task && npm run build && npm run package + + - name: Compare the expected and actual dist/ directories + run: | + cd blackduck-security-task + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + - name: versioning id: version-update env: GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} run: | - vss_extension=$(cat vss-extension.json) - extension_name=$(echo $vss_extension | jq -r '.name' ) + extension_name=$(jq -r '.name' < vss-extension.json) echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV echo "EXTENSION NAME: "$extension_name - current_extension_version=$(echo $vss_extension | jq -r '.version') + current_extension_version=$(jq -r '.version' < vss-extension.json) echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV echo "CURRENT EXTENSION VERSION: " $current_extension_version current_major=$(echo $current_extension_version | awk -F. '{print $1}') @@ -46,7 +61,7 @@ jobs: echo "Updated extension_version.txt file" echo - cd synopsys-task + cd blackduck-security-task echo "Updating package.json with the new version: ${new_version}" jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json echo "Updated package.json file" @@ -79,7 +94,7 @@ jobs: git checkout -b extension_version_update git add vss-extension-dev.json extension_version.txt echo "Install dependencies && Rebuild the dist/ directory" - cd synopsys-task && npm ci && npm run build && npm run package + cd blackduck-security-task && npm ci && npm run build && npm run package git add package.json package-lock.json task.json git commit -m "upgrade extension version to ${{ env.NEW_VERSION }} [skip ci]" git push origin extension_version_update diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index 2cab3f28..932eead4 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -15,16 +15,31 @@ jobs: with: node-version: 20.x + - name: Install dependencies + run: cd blackduck-security-task && npm ci + + - name: Rebuild the dist/ directory + run: cd blackduck-security-task && npm run build && npm run package + + - name: Compare the expected and actual dist/ directories + run: | + cd blackduck-security-task + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + - name: versioning id: version-update env: GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} run: | - vss_extension_dev=$(cat vss-extension-dev.json) - extension_name=$(echo $vss_extension_dev | jq -r '.name' ) + extension_name=$(jq -r '.name' < vss-extension-dev.json) echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV echo "EXTENSION NAME: "$extension_name - current_extension_version=$(echo $vss_extension_dev | jq -r '.version') + current_extension_version=$(jq -r '.version' < vss-extension-dev.json) echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV echo "CURRENT QAEXTENSION VERSION: " $current_extension_version previous_published_qaextension_version=$(grep 'published_qaextension_version' extension_version.txt | cut -d '=' -f 2) diff --git a/extension_version.txt b/extension_version.txt index be1f7971..e3377013 100644 --- a/extension_version.txt +++ b/extension_version.txt @@ -1 +1 @@ -published_qaextension_version=1.10.0 \ No newline at end of file +published_qaextension_version=1.10.1 \ No newline at end of file diff --git a/vss-extension-dev.json b/vss-extension-dev.json index 6ec3dbdf..fd80701d 100644 --- a/vss-extension-dev.json +++ b/vss-extension-dev.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "QAExt", "name": "Black Duck Security Scan", - "version": "1.10.0", + "version": "1.10.1", "publisher": "QAExt", "targets": [ { From 9542f5187893bfacb68cf1d076eb97ac0bdf545e Mon Sep 17 00:00:00 2001 From: Siyaram Meena Date: Tue, 8 Oct 2024 12:33:24 +0530 Subject: [PATCH 07/19] SIGINT-2010: automate QAExt and Prod release process --- .github/workflows/create-tag.yml | 75 +++++++++++++ .../workflows/deploy-blackduck-extension.yml | 103 ------------------ .github/workflows/publish-QAExtension.yml | 29 +++-- .../workflows/publish-blackduck-extension.yml | 67 ++++++++++++ .../workflows/upgrade-extension-version.yml | 101 +++++++++++++++++ 5 files changed, 257 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/create-tag.yml delete mode 100644 .github/workflows/deploy-blackduck-extension.yml create mode 100644 .github/workflows/publish-blackduck-extension.yml create mode 100644 .github/workflows/upgrade-extension-version.yml diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml new file mode 100644 index 00000000..af01a407 --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,75 @@ +name: create-tag + +on: + workflow_dispatch: + inputs: + TAG: + description: 'TAG' + required: true + default: "" + type: string + TAG_BODY: + description: 'TAG DESCRIPTION' + required: false + default: "" + type: string + IS_DRAFT: + description: 'CREATE AS DRAFT' + required: false + default: false + type: boolean + IS_PRERELEASE: + description: 'PRERELEASE TAG' + required: true + default: true + type: boolean +jobs: + create-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install dependencies + run: cd blackduck-security-task && npm ci + + - name: Rebuild the dist/ directory + run: cd blackduck-security-task && npm run build && npm run package + + - name: Compare the expected and actual dist/ directories + run: | + cd blackduck-security-task + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + + - name: replace \n + id: process_body + run: | + tag_body="${{ github.event.inputs.TAG_BODY }}" + echo "${tag_body}">>processed_body.txt + sed -i 's/\\n/\n/g' processed_body.txt + cat processed_body.txt + processed_body=$(cat processed_body.txt | tr '\n' '\n') + echo "PROCESSED_BODY<>$GITHUB_ENV + echo "$processed_body">>$GITHUB_ENV + echo "EOF">>$GITHUB_ENV + + - name: Create tag + id: create_tag + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.event.inputs.TAG }} + release_name: "BLACK DUCK EXTENSION ${{ github.event.inputs.TAG }}" + body: ${{ env.PROCESSED_BODY }} + draft: ${{ github.event.inputs.IS_DRAFT }} + prerelease: ${{ github.event.inputs.IS_PRERELEASE }} \ No newline at end of file diff --git a/.github/workflows/deploy-blackduck-extension.yml b/.github/workflows/deploy-blackduck-extension.yml deleted file mode 100644 index af5bfe4a..00000000 --- a/.github/workflows/deploy-blackduck-extension.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: deploy-blackduck-extension - -on: - workflow_dispatch: - -jobs: - deploy-blackduck-extension: - if: "!contains(github.event.head_commit.message, '[skip ci]')" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: Install dependencies - run: cd blackduck-security-task && npm ci - - - name: Rebuild the dist/ directory - run: cd blackduck-security-task && npm run build && npm run package - - - name: Compare the expected and actual dist/ directories - run: | - cd blackduck-security-task - if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff - exit 1 - fi - id: diff - - - name: versioning - id: version-update - env: - GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} - run: | - extension_name=$(jq -r '.name' < vss-extension.json) - echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV - echo "EXTENSION NAME: "$extension_name - current_extension_version=$(jq -r '.version' < vss-extension.json) - echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV - echo "CURRENT EXTENSION VERSION: " $current_extension_version - current_major=$(echo $current_extension_version | awk -F. '{print $1}') - current_minor=$(echo $current_extension_version | awk -F. '{print $2}') - current_patch=$(echo $current_extension_version | awk -F. '{print $3}') - COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1) - echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV - echo "commit message: " $COMMIT_MESSAGE - if [[ "$COMMIT_MESSAGE" == *"version-upgrade"* ]]; then - new_version=$current_extension_version - echo "Updating vss-extension-dev.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json - echo "Updated vss-extension-dev.json file" - cat vss-extension-dev.json - - echo "Updating extension_version.txt with the new version: ${new_version}" - sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt - cat extension_version.txt - echo "Updated extension_version.txt file" - echo - - cd blackduck-security-task - echo "Updating package.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json - echo "Updated package.json file" - echo - - echo "Updating package-lock.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '(.version = $new_version) | (.packages[""].version = $new_version)' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json - echo "Updated package-lock.json file" - echo - - echo "Updating task.json with the new version: ${new_version}" - jq --argjson major "$current_major" --argjson minor "$current_minor" --argjson patch "$current_patch" '(.version.Major = $major) | (.version.Minor = $minor) | (.version.Patch = $patch)' task.json > task.json.tmp && mv task.json.tmp task.json - echo "Updated task.json file" - else - new_version=$current_extension_version - echo "Commit message does not contains 'version-upgrade' message" - echo "Extension version will not be updating automatically. Current version: ${new_version}" - fi - echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - - - name: update extension version in file - if: "contains(env.COMMIT_MESSAGE, 'version-upgrade')" - id: update-extension-version - env: - GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} - run: | - echo "Updating extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file" - git config --local user.name "$(git log -n 1 --pretty=format:%an)" - git config --local user.email "$(git log -n 1 --pretty=format:%ae)" - git checkout -b extension_version_update - git add vss-extension-dev.json extension_version.txt - echo "Install dependencies && Rebuild the dist/ directory" - cd blackduck-security-task && npm ci && npm run build && npm run package - git add package.json package-lock.json task.json - git commit -m "upgrade extension version to ${{ env.NEW_VERSION }} [skip ci]" - git push origin extension_version_update - gh pr create --base main --head extension_version_update --title "Version upgrade to ${{ env.NEW_VERSION }}" --body "${{ env.EXTENSION_NAME }} version upgrade to ${{ env.NEW_VERSION }}" --fill - gh pr merge --squash --subject "Extension version upgrade to ${{ env.NEW_VERSION }} [skip ci]" --delete-branch - echo "Successful updated extension version in vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file..." diff --git a/.github/workflows/publish-QAExtension.yml b/.github/workflows/publish-QAExtension.yml index 932eead4..63889e08 100644 --- a/.github/workflows/publish-QAExtension.yml +++ b/.github/workflows/publish-QAExtension.yml @@ -46,31 +46,30 @@ jobs: echo "PREVIOUS PUBLISHED QAEXTENSION VERSION: " $previous_published_qaextension_version previous_major=$(echo $previous_published_qaextension_version | awk -F. '{print $1}') previous_minor=$(echo $previous_published_qaextension_version | awk -F. '{print $2}') + previous_patch=$(echo $previous_published_qaextension_version | awk -F. '{print $3}') current_major=$(echo $current_extension_version | awk -F. '{print $1}') current_minor=$(echo $current_extension_version | awk -F. '{print $2}') - current_patch=$(echo $current_extension_version | awk -F. '{print $3}') if [ "$previous_major" -eq "$current_major" ] && [ "$previous_minor" -eq "$current_minor" ]; then - current_patch=$((current_patch+1)) + current_patch=$((previous_patch+1)) new_version=$current_major.$current_minor.$current_patch echo "Updating extension version to: ${new_version}" - - echo "Updating vss-extension-dev.json with the new version: ${new_version}" - jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json - echo "Updated vss-extension-dev.json file" - cat vss-extension-dev.json - echo - - echo "Updating extension_version.txt with the new version: ${new_version}" - sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt - cat extension_version.txt - echo - echo "Updated extension_version.txt file" else new_version=$current_extension_version echo "Extension version will not be updating automatically. Current version: ${new_version}" fi + echo "Updating vss-extension-dev.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json + echo "Updated vss-extension-dev.json file" + cat vss-extension-dev.json + echo + + echo "Updating extension_version.txt with the new version: ${new_version}" + sed -i "s/published_qaextension_version=.*/published_qaextension_version=$new_version/" extension_version.txt + cat extension_version.txt + echo + echo "Updated extension_version.txt file" + echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - - name: publish-QAExtension id: publish-qaextension if: ${{ steps.version-update.conclusion == 'success' }} diff --git a/.github/workflows/publish-blackduck-extension.yml b/.github/workflows/publish-blackduck-extension.yml new file mode 100644 index 00000000..19374e91 --- /dev/null +++ b/.github/workflows/publish-blackduck-extension.yml @@ -0,0 +1,67 @@ +name: publish-blackduck-extension + +on: + workflow_dispatch: + inputs: + isPublish: + description: 'DO YOU WANT TO PUBLISH BLACK DUCK EXTENSION TO MARKETPLACE' + required: true + default: false + type: boolean + +jobs: + publish-blackduck-extension: + if: ${{ github.event.inputs.isPublish == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Compare the expected and actual dist/ directories + run: | + cd blackduck-security-task + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + + - name: publish-Extension + id: publish-extension + env: + PROD_PUBLISHER_NAME: ${{ secrets.PROD_PUBLISHER_NAME }} + PROD_ORGANIZATION_NAME: ${{ secrets.PROD_ORG_NAME }} + PROD_USER_TOKEN: ${{ secrets.PROD_USER_TOKEN }} #personal_access_token of azure devops account + run: | + extension_name=$(jq -r '.name' < vss-extension.json) + echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV + echo "EXTENSION NAME: "$extension_name + extension_version=$(jq -r '.version' < vss-extension.json) + echo "EXTENSION_VERSION=$extension_version" >> $GITHUB_ENV + echo "EXTENSION VERSION: " $extension_version + echo "Installing tfx-cli..." + npm i -g tfx-cli + echo "Creating extension $extension_name with version $extension_version" + npx tfx-cli extension create --manifest-globs vss-extension.json + echo "Extension $extension_name created successfully!" + echo "Publishing extension $extension_name with version $extension_version" + tfx extension publish --publisher ${PROD_PUBLISHER_NAME} --manifest-globs vss-extension.json --token ${PROD_USER_TOKEN} | tee tfx_output.log + publish_exit_code=${PIPESTATUS[0]} + if [ $publish_exit_code -eq 0 ]; then + echo "Extension $extension_name with version $extension_version published successfully!" + else + echo "Failed to publish the extension $extension_name with version $extension_version." + exit 1 + fi + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + if: ${{ steps.publish-extension.conclusion == 'success' }} + with: + name: ${{ env.EXTENSION_NAME }}-${{ env.EXTENSION_VERSION }}.vsix + path: "*.vsix" \ No newline at end of file diff --git a/.github/workflows/upgrade-extension-version.yml b/.github/workflows/upgrade-extension-version.yml new file mode 100644 index 00000000..50dc3239 --- /dev/null +++ b/.github/workflows/upgrade-extension-version.yml @@ -0,0 +1,101 @@ +name: upgrade-extension-version + +on: + workflow_dispatch: + inputs: + version: + description: 'EXTENSION VERSION' + required: true + default: "" + type: string + +jobs: + upgrade-extension-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install dependencies + run: cd blackduck-security-task && npm ci + + - name: Rebuild the dist/ directory + run: cd blackduck-security-task && npm run build && npm run package + + - name: Compare the expected and actual dist/ directories + run: | + cd blackduck-security-task + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + + - name: versioning + id: version-update + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + run: | + extension_name=$(jq -r '.name' < vss-extension.json) + echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV + echo "EXTENSION NAME: "$extension_name + current_extension_version=${{ github.event.inputs.version }} + echo "CURRENT_VERSION=$current_extension_version" >> $GITHUB_ENV + echo "CURRENT EXTENSION VERSION: " $current_extension_version + current_major=$(echo $current_extension_version | awk -F. '{print $1}') + current_minor=$(echo $current_extension_version | awk -F. '{print $2}') + current_patch=$(echo $current_extension_version | awk -F. '{print $3}') + + new_version=$current_extension_version + echo "Updating vss-extension.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' vss-extension.json > vss-extension.json.tmp && mv vss-extension.json.tmp vss-extension.json + echo "Updated vss-extension.json file" + cat vss-extension.json + echo + + echo "Updating vss-extension-dev.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' vss-extension-dev.json > vss-extension-dev.json.tmp && mv vss-extension-dev.json.tmp vss-extension-dev.json + echo "Updated vss-extension-dev.json file" + cat vss-extension-dev.json + echo + + cd blackduck-security-task + echo "Updating package.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '.version = $new_version' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Updated package.json file" + cat package.json + echo + + echo "Updating package-lock.json with the new version: ${new_version}" + jq --arg new_version "$new_version" '(.version = $new_version) | (.packages[""].version = $new_version)' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json + echo "Updated package-lock.json file" + echo + + echo "Updating task.json with the new version: ${new_version}" + jq --argjson major "$current_major" --argjson minor "$current_minor" --argjson patch "$current_patch" '(.version.Major = $major) | (.version.Minor = $minor) | (.version.Patch = $patch)' task.json > task.json.tmp && mv task.json.tmp task.json + echo "Updated task.json file" + + echo "NEW_VERSION=$new_version" >> $GITHUB_ENV + + - name: update extension version in file + id: update-extension-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + run: | + echo "Updating extension version in vss-extension.json, vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file" + git config --local user.name "$(git log -n 1 --pretty=format:%an)" + git config --local user.email "$(git log -n 1 --pretty=format:%ae)" + git checkout -b extension_version_update + git pull origin extension_version_update --rebase || true + git add vss-extension.json vss-extension-dev.json extension_version.txt + cd blackduck-security-task + git add package.json package-lock.json task.json + git commit -m "upgrade extension version to ${{ env.NEW_VERSION }} [skip ci]" + git push origin extension_version_update --force + gh pr create --base main --head extension_version_update --title "Extension version upgrade to ${{ env.NEW_VERSION }}" --body "${{ env.EXTENSION_NAME }} version upgrade to ${{ env.NEW_VERSION }}" --fill + echo "Successful updated extension version in vss-extension.json, vss-extension-dev.json, extension_version.txt, package.json, package-lock.json & task.json file..." \ No newline at end of file From ade41f76c6f0aacc237c7dc4291e41c9e8f7daec Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 13:50:13 +0530 Subject: [PATCH 08/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index c06cae4a..93167c67 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -32,7 +32,7 @@ paths: - .m2/ script: - - cd blackduck-task + - cd blackduck-security-task - npm ci - npm run format && npm run lint && npm run build && npm run package From 0c60d086b18a5ac8ca1cb54be2d6a6336cc9757a Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 13:50:13 +0530 Subject: [PATCH 09/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 095e6f21..df18586e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,14 +21,14 @@ include: stages: - build - unit_test_and_coverage - - versioning - - analysis - - sbom - - e2e-publish - - e2e-setup - - e2e - - e2e-cleanup - - notification + #- versioning + #- analysis + #- sbom + #- e2e-publish + #- e2e-setup + #- e2e + #- e2e-cleanup + #- notification variables: BUILD_TOOL: npm From a359e78a6f1b5e4721bf95e587a3b12a5668a9a9 Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 13:50:13 +0530 Subject: [PATCH 10/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci-template.yml | 22 ++--- .gitlab-ci.yml | 180 ++++++++++++++++++++-------------------- 2 files changed, 101 insertions(+), 101 deletions(-) diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index 93167c67..f45aa15f 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -44,17 +44,17 @@ - npm test coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ -.new_pop_blackduck_analysis: - image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14 - extends: - - .new_pop_blackduck - - .retry - before_script: - - | - apt-get update -y - apt-get install -y rsync make jq python3 python3-pip - pip3 install blackduck requests - export RELEASE_VERSION=`git describe --tags --abbrev=0 2>/dev/null || echo ''` +#.new_pop_blackduck_analysis: +# image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14 +# extends: +# - .new_pop_blackduck +# - .retry +# before_script: +# - | +# apt-get update -y +# apt-get install -y rsync make jq python3 python3-pip +# pip3 install blackduck requests +# export RELEASE_VERSION=`git describe --tags --abbrev=0 2>/dev/null || echo ''` #.changelog: # image: node:17-buster-slim # extends: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df18586e..af952512 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,93 +55,93 @@ unit_test_and_coverage_job: dependencies: [build_job] -.export_sbom_variables: - before_script: - - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - - export ARTIFACTORY_UPLOAD_REPO=1 - - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/synopsys-extension-ci-cd - - export PRODUCT=Integrations - - export GENERATE_CONFIGURATION_FILE=1 - - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile synopsys-extension-ci-cd-$EXT_VERSION.zip --debug" - - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/synopsys-extension-ci-cd:synopsys-extension-ci-cd-$EXT_VERSION" - -generate_sbom: - extends: - - .export_sbom_variables - - .run_sbom_generation - stage: sbom - only: - refs: - - main - -polaris_bridge: - stage: analysis - extends: .polaris_bridge - -pop_blackduck: - image: us-docker.pkg.dev/cloudops-artifacts-prd/polaris/ember_cli:3.28.5-node_16.14 - variables: - POP_BLACKDUCK_INPROGRESS: 1 - extends: - - .new_pop_blackduck - before_script: - - | - apt-get update -y - apt-get install -y rsync make jq python3 python3-pip - pip3 install blackduck requests - export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - -e2e-publish: - stage: e2e-publish - tags: - - linux - extends: .extension-publish - -e2e-setup: - stage: e2e-setup - dependencies: [e2e-publish] - tags: - - linux - extends: .e2e-setup - -e2e-linux: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Linux" - RUNNER_OS: "Linux" - -e2e-mac: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Darwin" - RUNNER_OS: "Mac" - -e2e-windows: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Windows_NT" - RUNNER_OS: "Windows" - -e2e-clean-up: - stage: e2e-cleanup - dependencies: [e2e-publish,e2e-setup,e2e-linux,e2e-mac,e2e-windows] - tags: - - linux - extends: .e2e-clean-up - rules: - - when: always +#.export_sbom_variables: +# before_script: +# - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') +# - export ARTIFACTORY_UPLOAD_REPO=1 +# - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/synopsys-extension-ci-cd +# - export PRODUCT=Integrations +# - export GENERATE_CONFIGURATION_FILE=1 +# - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile synopsys-extension-ci-cd-$EXT_VERSION.zip --debug" +# - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/synopsys-extension-ci-cd:synopsys-extension-ci-cd-$EXT_VERSION" +# +#generate_sbom: +# extends: +# - .export_sbom_variables +# - .run_sbom_generation +# stage: sbom +# only: +# refs: +# - main +# +#polaris_bridge: +# stage: analysis +# extends: .polaris_bridge +# +#pop_blackduck: +# image: us-docker.pkg.dev/cloudops-artifacts-prd/polaris/ember_cli:3.28.5-node_16.14 +# variables: +# POP_BLACKDUCK_INPROGRESS: 1 +# extends: +# - .new_pop_blackduck +# before_script: +# - | +# apt-get update -y +# apt-get install -y rsync make jq python3 python3-pip +# pip3 install blackduck requests +# export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') +# +#e2e-publish: +# stage: e2e-publish +# tags: +# - linux +# extends: .extension-publish +# +#e2e-setup: +# stage: e2e-setup +# dependencies: [e2e-publish] +# tags: +# - linux +# extends: .e2e-setup +# +#e2e-linux: +# stage: e2e +# dependencies: [e2e-publish,e2e-setup] +# tags: +# - linux +# extends: .e2e-extension +# variables: +# XML_PATH_IN_JAR: $XML +# RUNNER_NAME: "Linux" +# RUNNER_OS: "Linux" +# +#e2e-mac: +# stage: e2e +# dependencies: [e2e-publish,e2e-setup] +# tags: +# - linux +# extends: .e2e-extension +# variables: +# XML_PATH_IN_JAR: $XML +# RUNNER_NAME: "Darwin" +# RUNNER_OS: "Mac" +# +#e2e-windows: +# stage: e2e +# dependencies: [e2e-publish,e2e-setup] +# tags: +# - linux +# extends: .e2e-extension +# variables: +# XML_PATH_IN_JAR: $XML +# RUNNER_NAME: "Windows_NT" +# RUNNER_OS: "Windows" +# +#e2e-clean-up: +# stage: e2e-cleanup +# dependencies: [e2e-publish,e2e-setup,e2e-linux,e2e-mac,e2e-windows] +# tags: +# - linux +# extends: .e2e-clean-up +# rules: +# - when: always \ No newline at end of file From 6901bb039e4dc0370f53c60857f386e1eb7c4774 Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 21:48:59 +0530 Subject: [PATCH 11/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci-template.yml | 22 ++--- .gitlab-ci.yml | 196 ++++++++++++++++++++-------------------- 2 files changed, 109 insertions(+), 109 deletions(-) diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index f45aa15f..93167c67 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -44,17 +44,17 @@ - npm test coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ -#.new_pop_blackduck_analysis: -# image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14 -# extends: -# - .new_pop_blackduck -# - .retry -# before_script: -# - | -# apt-get update -y -# apt-get install -y rsync make jq python3 python3-pip -# pip3 install blackduck requests -# export RELEASE_VERSION=`git describe --tags --abbrev=0 2>/dev/null || echo ''` +.new_pop_blackduck_analysis: + image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14 + extends: + - .new_pop_blackduck + - .retry + before_script: + - | + apt-get update -y + apt-get install -y rsync make jq python3 python3-pip + pip3 install blackduck requests + export RELEASE_VERSION=`git describe --tags --abbrev=0 2>/dev/null || echo ''` #.changelog: # image: node:17-buster-slim # extends: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af952512..095e6f21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,14 +21,14 @@ include: stages: - build - unit_test_and_coverage - #- versioning - #- analysis - #- sbom - #- e2e-publish - #- e2e-setup - #- e2e - #- e2e-cleanup - #- notification + - versioning + - analysis + - sbom + - e2e-publish + - e2e-setup + - e2e + - e2e-cleanup + - notification variables: BUILD_TOOL: npm @@ -55,93 +55,93 @@ unit_test_and_coverage_job: dependencies: [build_job] -#.export_sbom_variables: -# before_script: -# - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') -# - export ARTIFACTORY_UPLOAD_REPO=1 -# - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/synopsys-extension-ci-cd -# - export PRODUCT=Integrations -# - export GENERATE_CONFIGURATION_FILE=1 -# - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile synopsys-extension-ci-cd-$EXT_VERSION.zip --debug" -# - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/synopsys-extension-ci-cd:synopsys-extension-ci-cd-$EXT_VERSION" -# -#generate_sbom: -# extends: -# - .export_sbom_variables -# - .run_sbom_generation -# stage: sbom -# only: -# refs: -# - main -# -#polaris_bridge: -# stage: analysis -# extends: .polaris_bridge -# -#pop_blackduck: -# image: us-docker.pkg.dev/cloudops-artifacts-prd/polaris/ember_cli:3.28.5-node_16.14 -# variables: -# POP_BLACKDUCK_INPROGRESS: 1 -# extends: -# - .new_pop_blackduck -# before_script: -# - | -# apt-get update -y -# apt-get install -y rsync make jq python3 python3-pip -# pip3 install blackduck requests -# export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') -# -#e2e-publish: -# stage: e2e-publish -# tags: -# - linux -# extends: .extension-publish -# -#e2e-setup: -# stage: e2e-setup -# dependencies: [e2e-publish] -# tags: -# - linux -# extends: .e2e-setup -# -#e2e-linux: -# stage: e2e -# dependencies: [e2e-publish,e2e-setup] -# tags: -# - linux -# extends: .e2e-extension -# variables: -# XML_PATH_IN_JAR: $XML -# RUNNER_NAME: "Linux" -# RUNNER_OS: "Linux" -# -#e2e-mac: -# stage: e2e -# dependencies: [e2e-publish,e2e-setup] -# tags: -# - linux -# extends: .e2e-extension -# variables: -# XML_PATH_IN_JAR: $XML -# RUNNER_NAME: "Darwin" -# RUNNER_OS: "Mac" -# -#e2e-windows: -# stage: e2e -# dependencies: [e2e-publish,e2e-setup] -# tags: -# - linux -# extends: .e2e-extension -# variables: -# XML_PATH_IN_JAR: $XML -# RUNNER_NAME: "Windows_NT" -# RUNNER_OS: "Windows" -# -#e2e-clean-up: -# stage: e2e-cleanup -# dependencies: [e2e-publish,e2e-setup,e2e-linux,e2e-mac,e2e-windows] -# tags: -# - linux -# extends: .e2e-clean-up -# rules: -# - when: always \ No newline at end of file +.export_sbom_variables: + before_script: + - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') + - export ARTIFACTORY_UPLOAD_REPO=1 + - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/synopsys-extension-ci-cd + - export PRODUCT=Integrations + - export GENERATE_CONFIGURATION_FILE=1 + - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile synopsys-extension-ci-cd-$EXT_VERSION.zip --debug" + - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/synopsys-extension-ci-cd:synopsys-extension-ci-cd-$EXT_VERSION" + +generate_sbom: + extends: + - .export_sbom_variables + - .run_sbom_generation + stage: sbom + only: + refs: + - main + +polaris_bridge: + stage: analysis + extends: .polaris_bridge + +pop_blackduck: + image: us-docker.pkg.dev/cloudops-artifacts-prd/polaris/ember_cli:3.28.5-node_16.14 + variables: + POP_BLACKDUCK_INPROGRESS: 1 + extends: + - .new_pop_blackduck + before_script: + - | + apt-get update -y + apt-get install -y rsync make jq python3 python3-pip + pip3 install blackduck requests + export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') + +e2e-publish: + stage: e2e-publish + tags: + - linux + extends: .extension-publish + +e2e-setup: + stage: e2e-setup + dependencies: [e2e-publish] + tags: + - linux + extends: .e2e-setup + +e2e-linux: + stage: e2e + dependencies: [e2e-publish,e2e-setup] + tags: + - linux + extends: .e2e-extension + variables: + XML_PATH_IN_JAR: $XML + RUNNER_NAME: "Linux" + RUNNER_OS: "Linux" + +e2e-mac: + stage: e2e + dependencies: [e2e-publish,e2e-setup] + tags: + - linux + extends: .e2e-extension + variables: + XML_PATH_IN_JAR: $XML + RUNNER_NAME: "Darwin" + RUNNER_OS: "Mac" + +e2e-windows: + stage: e2e + dependencies: [e2e-publish,e2e-setup] + tags: + - linux + extends: .e2e-extension + variables: + XML_PATH_IN_JAR: $XML + RUNNER_NAME: "Windows_NT" + RUNNER_OS: "Windows" + +e2e-clean-up: + stage: e2e-cleanup + dependencies: [e2e-publish,e2e-setup,e2e-linux,e2e-mac,e2e-windows] + tags: + - linux + extends: .e2e-clean-up + rules: + - when: always From 5cb81aca8224a691e5e3826ee9cf5c4bbddaf741 Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 13:50:13 +0530 Subject: [PATCH 12/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 8 +++++--- Makefile | 4 ++-- vss-extension-dev.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 095e6f21..7f6d7bdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,11 +59,12 @@ unit_test_and_coverage_job: before_script: - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - export ARTIFACTORY_UPLOAD_REPO=1 - - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/synopsys-extension-ci-cd + - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/blackduck-security-extension - export PRODUCT=Integrations - export GENERATE_CONFIGURATION_FILE=1 - - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile synopsys-extension-ci-cd-$EXT_VERSION.zip --debug" - - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/synopsys-extension-ci-cd:synopsys-extension-ci-cd-$EXT_VERSION" + - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile blackduck-security-extension-$EXT_VERSION.zip --debug" + - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/blackduck-security-extension:blackduck-security-extension-$EXT_VERSION" + generate_sbom: extends: @@ -73,6 +74,7 @@ generate_sbom: only: refs: - main + - SIGINT-2310 polaris_bridge: stage: analysis diff --git a/Makefile b/Makefile index 89d72b58..fbf310d8 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,9 @@ build: echo "Provide the Build command like mvn install / go build / npm " dependencies: - echo "change directory to synopsys-task" + echo "change directory to blackduck-security-task" ifdef POP_BLACKDUCK_INPROGRESS - cd synopsys-task + cd blackduck-security-task endif image_scan: diff --git a/vss-extension-dev.json b/vss-extension-dev.json index fd80701d..a558d78c 100644 --- a/vss-extension-dev.json +++ b/vss-extension-dev.json @@ -28,7 +28,7 @@ }, "files": [ { - "path": "synopsys-task" + "path": "blackduck-security-extension" } ], "content": { From 5e41c2d41569bae84c418ce0c72698249278c40b Mon Sep 17 00:00:00 2001 From: kirann Date: Thu, 10 Oct 2024 13:50:13 +0530 Subject: [PATCH 13/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f6d7bdf..1e92c7ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,6 +98,7 @@ e2e-publish: tags: - linux extends: .extension-publish + allow_failure: true e2e-setup: stage: e2e-setup From aec3fc2b0fe7dc310b06977f2ce1fc7e74be8f67 Mon Sep 17 00:00:00 2001 From: kirann Date: Fri, 11 Oct 2024 23:47:10 +0530 Subject: [PATCH 14/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e92c7ea..435b4e0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -106,6 +106,7 @@ e2e-setup: tags: - linux extends: .e2e-setup + allow_failure: true e2e-linux: stage: e2e From 495435d4d94f38e421b74f374d63003e9bde1b1a Mon Sep 17 00:00:00 2001 From: kirann Date: Sat, 12 Oct 2024 00:03:09 +0530 Subject: [PATCH 15/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 67 +------------------------------------------------- 1 file changed, 1 insertion(+), 66 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 435b4e0c..5ba31d53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,9 +12,6 @@ include: - project: altair/altair-build-common ref: master file: gitlab/ci/altair_common.yml - - project: qa-automation/test-integrations - ref: main - file: _ci/e2e_azure.yml # List of job stages in their order of execution. @@ -24,11 +21,6 @@ stages: - versioning - analysis - sbom - - e2e-publish - - e2e-setup - - e2e - - e2e-cleanup - - notification variables: BUILD_TOOL: npm @@ -91,61 +83,4 @@ pop_blackduck: apt-get update -y apt-get install -y rsync make jq python3 python3-pip pip3 install blackduck requests - export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - -e2e-publish: - stage: e2e-publish - tags: - - linux - extends: .extension-publish - allow_failure: true - -e2e-setup: - stage: e2e-setup - dependencies: [e2e-publish] - tags: - - linux - extends: .e2e-setup - allow_failure: true - -e2e-linux: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Linux" - RUNNER_OS: "Linux" - -e2e-mac: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Darwin" - RUNNER_OS: "Mac" - -e2e-windows: - stage: e2e - dependencies: [e2e-publish,e2e-setup] - tags: - - linux - extends: .e2e-extension - variables: - XML_PATH_IN_JAR: $XML - RUNNER_NAME: "Windows_NT" - RUNNER_OS: "Windows" - -e2e-clean-up: - stage: e2e-cleanup - dependencies: [e2e-publish,e2e-setup,e2e-linux,e2e-mac,e2e-windows] - tags: - - linux - extends: .e2e-clean-up - rules: - - when: always + export RELEASE_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') \ No newline at end of file From 43d42f26610d08724281d4761cd546ff480c632e Mon Sep 17 00:00:00 2001 From: kirann Date: Sat, 12 Oct 2024 00:04:16 +0530 Subject: [PATCH 16/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ba31d53..00bcf12f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,7 @@ stages: - versioning - analysis - sbom + - notification variables: BUILD_TOOL: npm @@ -51,13 +52,12 @@ unit_test_and_coverage_job: before_script: - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - export ARTIFACTORY_UPLOAD_REPO=1 - - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/blackduck-security-extension + - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/github-actions - export PRODUCT=Integrations - export GENERATE_CONFIGURATION_FILE=1 - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile blackduck-security-extension-$EXT_VERSION.zip --debug" - export GENERATION_OPTIONS="--entry integrations/mirrored-repos/blackduck-security-extension:blackduck-security-extension-$EXT_VERSION" - generate_sbom: extends: - .export_sbom_variables From 09dd5788477ee2528f78bc95d026b2c7205ab8ec Mon Sep 17 00:00:00 2001 From: kirann Date: Mon, 14 Oct 2024 16:14:45 +0530 Subject: [PATCH 17/19] feat(SIGINT-2310): updating build script. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 00bcf12f..795045e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ unit_test_and_coverage_job: before_script: - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - export ARTIFACTORY_UPLOAD_REPO=1 - - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/github-actions + - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/blackduck-security-extension - export PRODUCT=Integrations - export GENERATE_CONFIGURATION_FILE=1 - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile blackduck-security-extension-$EXT_VERSION.zip --debug" From 1af04a7a7de52e5527bd0db5403a417204a8db76 Mon Sep 17 00:00:00 2001 From: kirann Date: Mon, 14 Oct 2024 16:18:22 +0530 Subject: [PATCH 18/19] updating gitlab.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 795045e8..00bcf12f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ unit_test_and_coverage_job: before_script: - export EXT_VERSION=$(cat vss-extension.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - export ARTIFACTORY_UPLOAD_REPO=1 - - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/blackduck-security-extension + - export SBOM_ART_TOKEN_VAULT_PATH=sbom/integrations/github-actions - export PRODUCT=Integrations - export GENERATE_CONFIGURATION_FILE=1 - export PRODUCT_ADDON_SBOM_OPTIONS="--output-zipfile blackduck-security-extension-$EXT_VERSION.zip --debug" From d1c1f7a3f99f59644d2ff041a10584300b7c828b Mon Sep 17 00:00:00 2001 From: kirann Date: Mon, 14 Oct 2024 16:18:22 +0530 Subject: [PATCH 19/19] updating gitlab.yml file --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 00bcf12f..2a2893c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,7 +66,6 @@ generate_sbom: only: refs: - main - - SIGINT-2310 polaris_bridge: stage: analysis