Skip to content

Commit

Permalink
fix: rollback docker desktop to use ./docker/snyk-mac.sh
Browse files Browse the repository at this point in the history
Docker Desktop configures this path per-user so migrating to something else is more complicated than just leaving it as it was.

Co-authored-by: Stefan Scherer <stefan.scherer@docker.com>
  • Loading branch information
Jahed Ahmed and StefanScherer committed Jan 10, 2022
1 parent c5d0e5d commit 726cd4c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/smoke-tests.yml
Expand Up @@ -92,11 +92,12 @@ jobs:
if: ${{ matrix.snyk_install_method == 'docker-bundle' }}
run: |
pushd "$(mktemp -d)"
curl 'https://static.snyk.io/cli/latest/${{ matrix.snyk_cli_dl_file }}' | tar -xz --strip-components=1
ls -la
sudo ln -s "$(pwd)/entrypoint.sh" ./snyk
export PATH="$(pwd):${PATH}"
echo "$(pwd)" >> "${GITHUB_PATH}"
curl 'https://static.snyk.io/cli/latest/${{ matrix.snyk_cli_dl_file }}' | tar -xz
ls -la docker
mkdir ./bin
sudo ln -s "$(pwd)/docker/snyk-mac.sh" ./bin/snyk
export PATH="$(pwd)/bin:${PATH}"
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
popd
which snyk
snyk version
Expand Down
2 changes: 1 addition & 1 deletion docker-desktop/README.md
Expand Up @@ -32,5 +32,5 @@ To test it, you can do the following:
```sh
cd ./binary-releases
tar xzf snyk-for-docker-desktop-darwin-x64.tar.gz
./snyk-for-docker-desktop-darwin-x64/entrypoint.sh woof
./docker/snyk-mac.sh woof
```
9 changes: 5 additions & 4 deletions docker-desktop/build.sh
Expand Up @@ -8,8 +8,9 @@ node_url="https://nodejs.org/dist/${node_version}/node-${node_version}-${platfor
build_name="snyk-for-docker-desktop-${platform}-${arch}"
build_filename="${build_name}.tar.gz"
build_sha_filename="${build_filename}.sha256"
build_root="./docker-desktop/dist"
build_dir="${build_root}/${build_name}"
build_root="./docker-desktop/dist/${build_name}"
build_dir_name="docker"
build_dir="${build_root}/${build_dir_name}"
output_dir="./binary-releases"

if [[ -d "${build_dir}" ]]; then
Expand All @@ -22,7 +23,7 @@ mkdir -p "${build_dir}"
mkdir -p "${output_dir}"

# Include entrypoint.
cp ./docker-desktop/src/entrypoint.sh "${build_dir}"
cp ./docker-desktop/src/snyk-mac.sh "${build_dir}"

# Include Snyk CLI build.
cp ./package.json "${build_dir}"
Expand All @@ -47,7 +48,7 @@ popd
# We build from build_root so that build_name is the top-level directory in the
# tarball. We want a top-level directory to avoid tarbombs.
pushd "${build_root}"
tar czfh "${build_filename}" "${build_name}"
tar czfh "${build_filename}" "${build_dir_name}"
shasum -a 256 "${build_filename}" > "${build_sha_filename}"
popd

Expand Down
File renamed without changes.

0 comments on commit 726cd4c

Please sign in to comment.