Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a build steps for: - signed windows binary - archive of built CLI (npm-like package) with Node.js runtime embedded
- Loading branch information
Showing
6 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ snyk-result.json | |
snyk_report.css | ||
snyk_report.html | ||
!/docker/snyk_report.css | ||
cert.pem | ||
key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# Take built CLI | ||
mkdir ./dist/docker | ||
mkdir ./dist/docker/cli | ||
cp -r ./dist/cli ./dist/docker/cli/cli | ||
cp -r ./dist/lib ./dist/docker/cli/lib | ||
cp ./package.json ./dist/docker/ | ||
cp ./config.default.json ./dist/docker/ | ||
cp -r ./help ./dist/docker/help | ||
|
||
# Snyk CLI entry script | ||
cp ./release-scripts/snyk-mac.sh ./dist/docker/ | ||
|
||
cd ./dist/docker | ||
|
||
npm install --production | ||
|
||
# Download macOS NodeJS binary, using same as pkg | ||
curl "https://nodejs.org/dist/v14.6.0/node-v14.6.0-darwin-x64.tar.gz" | tar -xz | ||
|
||
cd .. | ||
|
||
# Create bundle, resolve symlinks | ||
tar czfh docker-mac-signed-bundle.tar.gz ./docker | ||
|
||
sha256sum docker-mac-signed-bundle.tar.gz > docker-mac-signed-bundle.tar.gz.sha256 | ||
|
||
rm -rf ./docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# create files as needed | ||
CERT_FILE=cert.pem | ||
if [ ! -f "$CERT_FILE" ]; then | ||
echo "$SIGNING_CERT" | base64 --decode > "$CERT_FILE" | ||
fi | ||
|
||
# create files as needed | ||
KEY_FILE=key.pem | ||
if [ ! -f "$KEY_FILE" ]; then | ||
echo "$SIGNING_KEY" | base64 --decode > "$KEY_FILE" | ||
fi | ||
|
||
osslsigncode sign -h sha512 \ | ||
-certs cert.pem \ | ||
-key key.pem \ | ||
-n "Snyk CLI" \ | ||
-i "https://snyk.io" \ | ||
-t "http://timestamp.comodoca.com/authenticode" \ | ||
-in snyk-win.exe \ | ||
-out snyk-win-signed.exe | ||
|
||
sha256sum snyk-win-signed.exe > snyk-win-signed.exe.sha256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
DIRNAME=$(dirname "$0") | ||
|
||
NODE="$DIRNAME/node-v14.6.0-darwin-x64/bin/node" | ||
SNYK_CLI="$DIRNAME/cli/cli/index.js" | ||
|
||
"$NODE" "$SNYK_CLI" "$@" |