Skip to content

Commit

Permalink
Merge pull request #114 from snyk/develop
Browse files Browse the repository at this point in the history
Merge develop into master for release
  • Loading branch information
maxjeffos authored May 23, 2021
2 parents 7eba33f + 45c3154 commit 3bcb84c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
14 changes: 10 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ jobs:
- run:
name: Create renamed copy of the vsix bundle
command: |
cp *.vsix extension-artifact.vsix
ls -la extension-artifact.vsix
cp *.vsix dev-extension-artifact.vsix
ls -la dev-extension-artifact.vsix
- store_artifacts:
path: ./extension-artifact.vsix
path: ./dev-extension-artifact.vsix

- run:
name: Launch Test Pipelines
Expand Down Expand Up @@ -115,8 +115,14 @@ jobs:
export AZURE_DEVOPS_EXT_PAT=$PROD_AZURE_DEVOPS_EXT_PAT
npx semantic-release
- run:
name: Create renamed copy of the vsix bundle
command: |
cp *.vsix prod-extension-artifact.vsix
ls -la prod-extension-artifact.vsix
- store_artifacts:
path: ./Snyk-snyk-security-scan.vsix
path: ./prod-extension-artifact.vsix

workflows:
version: 2
Expand Down
28 changes: 5 additions & 23 deletions scripts/ci-deploy-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,19 @@ node "${PWD}/scripts/ci-update-task-json-prod.js" ${AZ_EXT_NEW_VERSION}
# Override version
OVERRIDE_JSON="{ \"id\": \"${AZ_EXTENSION_ID}\", \"name\": \"${AZ_EXTENSION_NAME}\", \"version\": \"${AZ_EXT_NEW_VERSION}\", \"public\": true }"

echo "Creating extension..."
tfx extension create \
--manifest-globs vss-extension.json \
# Publish extension
echo "Publishing extension..."
tfx extension publish --manifest-globs vss-extension.json \
--version $AZ_EXT_NEW_VERSION \
--extension-id $AZ_EXTENSION_ID \
--publisher $AZ_PUBLISHER \
--override $OVERRIDE_JSON \
--token $AZURE_DEVOPS_EXT_PAT \
--output-path Snyk-snyk-security-scan.vsix

create_exit_code=$?
if [[ create_exit_code -eq 0 ]]; then
echo "Extension created"
ls -la
else
echo "Failed to create extension with exit code ${create_exit_code}"
exit ${create_exit_code}
fi

if [[ ! -f "Snyk-snyk-security-scan.vsix" ]]; then
echo "missing Snyk-snyk-security-scan.vsix file, not publishing extension"
exit 1
fi

echo "Snyk-snyk-security-scan.vsix file exists, publishing extension..."
tfx extension publish --token $AZURE_DEVOPS_EXT_PAT --vsix Snyk-snyk-security-scan.vsix
--token $AZURE_DEVOPS_EXT_PAT

publish_exit_code=$?
if [[ publish_exit_code -eq 0 ]]; then
echo "Extension published"
else
echo "Failed to publish extension with exit code ${publish_exit_code}"
echo "Extension failed to pubish with exit code ${publish_exit_code}"
exit ${publish_exit_code}
fi

0 comments on commit 3bcb84c

Please sign in to comment.