Skip to content

Commit

Permalink
Merge pull request #2108 from snyk/smoke/binary-cdn
Browse files Browse the repository at this point in the history
test: use binary from cdn for smoke tests
  • Loading branch information
Jahed Ahmed committed Jul 23, 2021
2 parents 64e3fe8 + e974b9d commit 7f0b32e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/smoke-tests.yml
Expand Up @@ -89,9 +89,7 @@ jobs:
- name: Install snyk from Docker bundle
if: ${{ matrix.snyk_install_method == 'docker-bundle' }}
run: |
snyk_cli_dl=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/snyk/snyk/releases/latest | jq --raw-output '(.assets[])? | select(.name == "${{ matrix.snyk_cli_dl_file }}") | .browser_download_url')
echo "snyk_cli_dl: ${snyk_cli_dl}"
curl -Lo ./snyk-cli.tar.gz $snyk_cli_dl
curl -Lo ./snyk-cli.tar.gz 'https://static.snyk.io/cli/latest/${{ matrix.snyk_cli_dl_file }}'
sudo mkdir -p /usr/local/bin/snyk-mac
sudo mv ./snyk-cli.tar.gz /usr/local/bin/snyk-mac
sudo tar -xf /usr/local/bin/snyk-mac/snyk-cli.tar.gz -C /usr/local/bin/snyk-mac # makes a folder called docker
Expand All @@ -112,10 +110,7 @@ jobs:
- name: Install Snyk with binary - Non-Windows
if: ${{ matrix.snyk_install_method == 'binary' && matrix.os != 'windows' }}
run: |
echo "install snyk with binary"
snyk_cli_dl=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/snyk/snyk/releases/latest | jq --raw-output '(.assets[])? | select(.name == "${{ matrix.snyk_cli_dl_file }}") | .browser_download_url')
echo "snyk_cli_dl: ${snyk_cli_dl}"
curl -Lo ./snyk-cli $snyk_cli_dl
curl -Lo ./snyk-cli 'https://static.snyk.io/cli/latest/${{ matrix.snyk_cli_dl_file }}'
chmod -R +x ./snyk-cli
sudo mv ./snyk-cli /usr/local/bin/snyk
snyk --version
Expand Down
5 changes: 1 addition & 4 deletions test/smoke/alpine/entrypoint.sh
@@ -1,9 +1,6 @@
#!/bin/sh

echo "install snyk with binary"
snyk_cli_dl=$(curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/snyk/snyk/releases/latest | jq --raw-output '(.assets[])? | select(.name == "snyk-alpine") | .browser_download_url')
echo "snyk_cli_dl: $snyk_cli_dl"
curl -Lo ./snyk-cli "$snyk_cli_dl"
curl -Lo ./snyk-cli 'https://static.snyk.io/cli/latest/snyk-alpine'
chmod -R +x ./snyk-cli
mv ./snyk-cli /usr/local/bin/snyk
snyk --version
Expand Down
5 changes: 1 addition & 4 deletions test/smoke/install-snyk-binary-win.sh
@@ -1,7 +1,4 @@
echo "install-snyk-binary-win.sh"
snyk_cli_dl=$(curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/snyk/snyk/releases/latest | jq --raw-output '(.assets[])? | select(.name == "snyk-win.exe") | .browser_download_url')
echo "snyk_cli_dl: ${snyk_cli_dl}"
curl -Lo ./snyk-cli.exe $snyk_cli_dl
curl -Lo ./snyk-cli.exe 'https://static.snyk.io/cli/latest/snyk-win.exe'
./snyk-cli.exe --version
chmod -R +x ./snyk-cli
mv ./snyk-cli.exe "/bin/snyk.exe"
Expand Down

0 comments on commit 7f0b32e

Please sign in to comment.