-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Release of the Extensible CLI via npm
- Loading branch information
1 parent
b6e056b
commit e7e558c
Showing
25 changed files
with
7,645 additions
and
256 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
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,16 @@ | ||
{ | ||
"darwin": { | ||
"amd64": "snyk-macos", | ||
"arm64": "snyk-macos" | ||
}, | ||
"windows": { | ||
"amd64": "snyk-win.exe" | ||
}, | ||
"alpine": { | ||
"amd64": "snyk-alpine" | ||
}, | ||
"linux": { | ||
"amd64": "snyk-linux", | ||
"arm64": "snyk-linux-arm64" | ||
} | ||
} |
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,29 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
BINARY_OUTPUT_FOLDER=${1} | ||
BINARY_WRAPPER_DIR=${2} | ||
ROOT=$(pwd) | ||
|
||
# create legacy TS tarball | ||
mv "$(npm pack)" "${BINARY_OUTPUT_FOLDER}/snyk_legacy.tgz" | ||
|
||
# create TS binary wrapper tarball | ||
pushd . | ||
cd "${BINARY_WRAPPER_DIR}" | ||
mv "$(npm pack)" "${ROOT}/${BINARY_OUTPUT_FOLDER}/snyk_wrapper.tgz" | ||
popd | ||
|
||
# merge the two tarballs and repack them to the final file | ||
pushd . | ||
cd "${BINARY_OUTPUT_FOLDER}" | ||
tar -xf snyk_legacy.tgz | ||
tar -xf snyk_wrapper.tgz | ||
cd package | ||
mv "$(npm pack)" "${ROOT}/${BINARY_OUTPUT_FOLDER}/snyk.tgz" | ||
popd | ||
|
||
# cleanup intermediate files and folders | ||
rm -rf "${ROOT}/${BINARY_OUTPUT_FOLDER}/package" | ||
rm -rf "${ROOT}/${BINARY_OUTPUT_FOLDER}/snyk_legacy.tgz" | ||
rm -rf "${ROOT}/${BINARY_OUTPUT_FOLDER}/snyk_wrapper.tgz" |
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,41 @@ | ||
# Copyright 2022 Snyk Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM node:gallium | ||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y sudo git squid curl git traceroute net-tools iptables vim make golang | ||
|
||
RUN apt-get auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/ | ||
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy | ||
|
||
RUN useradd snyk --create-home | ||
RUN echo "snyk ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
RUN mkdir -p /app | ||
COPY . /app | ||
|
||
RUN rm -rf /app/build /app/.bin | ||
RUN cp /app/test/acceptance/environments/proxy/entrypoint.sh /bin | ||
|
||
RUN chmod +x /bin/entrypoint.sh | ||
RUN chmod 777 /app && chown -R snyk /app | ||
|
||
ENV http_proxy="http://localhost:3128" | ||
ENV https_proxy="http://localhost:3128" | ||
ENV no_proxy "localhost,127.0.0.1" | ||
|
||
RUN env | ||
USER snyk | ||
WORKDIR /app | ||
ENTRYPOINT ["/bin/entrypoint.sh"] |
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,31 @@ | ||
#!/bin/bash | ||
# | ||
# © 2022 Snyk Limited All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -ex | ||
|
||
echo "Starting squid..." | ||
sudo squid -f /etc/squid/squid.conf -NYCd 1 & | ||
## configure firewall to only work through proxy | ||
sudo iptables -A OUTPUT -m owner --uid-owner root -j ACCEPT | ||
sudo iptables -A OUTPUT -m owner --uid-owner proxy -j ACCEPT | ||
sudo iptables -A OUTPUT -p tcp --dport 80 -j REJECT | ||
sudo iptables -A OUTPUT -p tcp --dport 443 -j REJECT | ||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | ||
sleep 5 # wait for squid to startup | ||
export PATH=$PATH:$PWD/.bin/pact/bin:$PWD/.bin/ | ||
export DISPLAY=:99 | ||
exec "$@" |
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,27 @@ | ||
<!-- | ||
~ © 2022 Snyk Limited All rights reserved. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<settings> | ||
<proxies> | ||
<proxy> | ||
<id>cli-acceptance-test</id> | ||
<active>true</active> | ||
<protocol>http</protocol> | ||
<host>localhost</host> | ||
<port>3128</port> | ||
</proxy> | ||
</proxies> | ||
</settings> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:12 | ||
FROM node:16 | ||
|
||
COPY ./smoke/ /snyk/smoke/ | ||
COPY ./fixtures/ /snyk/fixtures/ | ||
|
Oops, something went wrong.