generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add Terrascan + 🧹 Installation housekeeping (#54)
Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
- Loading branch information
Jacob Woffenden
authored
Apr 5, 2024
1 parent
28d1317
commit 6b4487e
Showing
18 changed files
with
92 additions
and
12 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
2 changes: 1 addition & 1 deletion
2
features/src/container-structure-test/devcontainer-feature.json
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
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# shellcheck source=/dev/null | ||
# file not accessible until being built | ||
source /usr/local/bin/devcontainer-utils | ||
|
||
get_system_architecture | ||
|
||
GITHUB_REPOSITORY="tenable/terrascan" | ||
VERSION="${TRIVYCLIVERSION:-"latest"}" | ||
|
||
if [[ "${VERSION}" == "latest" ]]; then | ||
get_github_latest_tag "${GITHUB_REPOSITORY}" | ||
VERSION="${GITHUB_LATEST_TAG}" | ||
VERSION_STRIP_V="${GITHUB_LATEST_TAG_STRIP_V}" | ||
else | ||
# shellcheck disable=SC2034 | ||
VERSION_STRIP_V="${VERSION#v}" | ||
fi | ||
|
||
ARCHITECTURE=$(uname --machine) | ||
export ARCHITECTURE | ||
|
||
curl --fail-with-body --location "https://github.com/${GITHUB_REPOSITORY}/releases/download/${VERSION}/terrascan_${VERSION_STRIP_V}_Linux_${ARCHITECTURE}.tar.gz" \ | ||
--output "terrascan_${VERSION_STRIP_V}_Linux_${ARCHITECTURE}.tar.gz" | ||
|
||
tar --extract --file "terrascan_${VERSION_STRIP_V}_Linux_${ARCHITECTURE}.tar.gz" | ||
|
||
install --owner=vscode --group=vscode --mode=775 terrascan /usr/local/bin/terrascan | ||
|
||
rm --recursive --force rm -rf terrascan LICENSE README.md CHANGELOG.md "terrascan_${VERSION_STRIP_V}_Linux_${ARCHITECTURE}.tar.gz" |
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
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