Skip to content

Commit

Permalink
Merge pull request #5403 from reactioncommerce/perf-kieckhafer-remove…
Browse files Browse the repository at this point in the history
…SnykAsCITask

ci: remove snyk as a CI task
  • Loading branch information
spencern authored Aug 1, 2019
2 parents 82069f4 + 7e53592 commit 7f2d0ce
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,46 +305,6 @@ jobs:
command: |
hadolint Dockerfile
snyk-security:
<<: *defaults
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
keys:
- reaction-v2-node-modules-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- reaction-v2-node-modules-{{ .Branch }}
- reaction-v2-node-modules-master
- run:
name: Snyk Test
command: |
CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" # Determine PR number from pull request link
if [[ -v CIRCLE_PR_NUMBER ]] && [ -n ${CIRCLE_PR_NUMBER} ]; then
url="https://api.github.com/repos/${DOCKER_REPOSITORY}/pulls/$CIRCLE_PR_NUMBER" # Get PR from github API
TARGET_BRANCH=$(curl "$url" | jq '.base.ref' | tr -d '"') # Determine target/base branch from API response
fi
if [ -z "${TARGET_BRANCH}" ] || [ ${TARGET_BRANCH} == "null" ]; then
echo "Not a PR. Skipping Snyk."
exit 0
fi
# If target branch does not exist or is master, run snyk tests
if [ ${TARGET_BRANCH} == "master" ] || [ -z "${TARGET_BRANCH/[ ]*\n/}" ]; then
PATH=$PATH:$CIRCLE_WORKING_DIRECTORY/node_modules/.bin && \
snyk test
else
# If package.json is different from the base branch, run snyk
if git diff origin/$CIRCLE_BRANCH..origin/$TARGET_BRANCH package.json | grep diff; then
echo "package.json different. Running Snyk."
PATH=$PATH:$CIRCLE_WORKING_DIRECTORY/node_modules/.bin && \
snyk test
else
echo "package.json identical to target branch. Skipping Snyk."
fi
fi
workflows:
version: 2
build_and_test:
Expand All @@ -371,8 +331,6 @@ workflows:
- build
- docker-build:
context: reaction-build-read
requires:
- snyk-security
- docker-push:
context: reaction-publish-docker
requires:
Expand All @@ -385,7 +343,3 @@ workflows:
filters:
branches:
only: /^master$/
- snyk-security:
context: reaction-validation
requires:
- build

0 comments on commit 7f2d0ce

Please sign in to comment.