-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rosemary.teague
committed
Apr 12, 2019
1 parent
a7a31a8
commit 49ccff2
Showing
3 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
performSnykAnalysisIfEnabled() { | ||
if [ -n "${SNYK_ORG}" ] && [ -n "${SNYK_TOKEN}" ]; then | ||
snyk monitor --org="${SNYK_ORG}" --docker "${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT}" --policy-path=.snyk | ||
if [[ -n "$TRAVIS_TAG" ]]; then | ||
snyk monitor --org="${SNYK_ORG}" --docker "${TRAVIS_REPO_SLUG}:${TRAVIS_TAG}" | ||
fi | ||
fi | ||
} | ||
|
||
docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" | ||
|
||
if [ "${TRAVIS_TAG}" ]; then | ||
docker push "${TRAVIS_REPO_SLUG}:${TRAVIS_TAG}" | ||
fi | ||
docker push "${TRAVIS_REPO_SLUG}:latest" && \ | ||
docker push "${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT}" | ||
|
||
performSnykAnalysisIfEnabled |