-
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.
Developer documenation for setting up local environment (Optum#326)
* Added documentation for CLI changes. * Cleaned up references to .dce.yaml. * Reorganized terraform-based configuration to advanced section. * WIP: start of the test script. * WIP: initial version of test script through at least deploying DCE via CLI. * WIP: Shell script so far asserts a successful deployment using the DCE CLI. * Added example configuration file for tests. * Updated policies and documentation to match new support AWS Nuke services. * Added details in changelog for newly-supported services. * Regenerated UserDetailer which seems to be causaing issues in ADO build. * Changed from require to assert to avoid panic. * Reverted changes because it was a bad idea. * Removed bad comma which was probably causing JSON problems. * Updated developer documenation with setup information and hardened install_ci.sh script to be used by developers. * Updated CHANGELOG to include descriptions of changes from feature branch.
- Loading branch information
1 parent
215e0d4
commit a754c06
Showing
5 changed files
with
173 additions
and
62 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 was deleted.
Oops, something went wrong.
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,19 +1,66 @@ | ||
#!/bin/bash | ||
#------------------------------------------------------------------------------ | ||
# install_ci.sh | ||
# The purpose of this script is install the required tools for building and | ||
# testing DCE | ||
#------------------------------------------------------------------------------ | ||
|
||
set -euxo pipefail | ||
|
||
export GOBIN=$(dirname `which go`) | ||
# safeGoGet will get the go tool, checking to see if it exists first and doing | ||
# a little additional messaging | ||
function safeGoGet() { | ||
binname=$(basename $1) | ||
echo "Checking for ${binname} on the path..." | ||
if [ ! -x "$(command -v ${binname})" ]; then | ||
echo -n "Getting ${binname} from $1..." | ||
go get $1 >/dev/null 2>&1 | ||
echo "Done." | ||
fi | ||
} | ||
|
||
if [ ! -x "$(command -v go)" ]; then | ||
echo "Cannot find \'go\'. Check your $PATH to make sure it includes \'go\'." >&2 | ||
exit 1 | ||
fi | ||
|
||
gopath=$(command -v go) | ||
export GOBIN=$(dirname ${gopath}) | ||
export GO111MODULE=off | ||
|
||
wget -q https://github.com/wata727/tflint/releases/download/v0.13.4/tflint_linux_amd64.zip | ||
unzip tflint_linux_amd64.zip | ||
chmod +x tflint | ||
mv tflint $GOBIN | ||
# Get the proper version of tflint first and install it into the same path | ||
# as the other go tools. | ||
if [ -x "$(command -v wget)" ]; then | ||
if [ ! -x "$(command -v tflint)" ]; then | ||
wget -q https://github.com/wata727/tflint/releases/download/v0.13.4/tflint_linux_amd64.zip -O /tmp/tflint.zip | ||
(cd /tmp && unzip tflint.zip) | ||
chmod +x /tmp/tflint | ||
mv /tmp/tflint $GOBIN | ||
fi | ||
else | ||
echo "Cannot find wget, which is required for installing tools." | ||
exit 1 | ||
fi | ||
|
||
#------------------------------------------------------------------------------ | ||
# Dependencies go here. | ||
#------------------------------------------------------------------------------ | ||
|
||
# go-junit-report is used by the test scripts to generate report output readable | ||
# by CI tools that can read JUnit reports | ||
safeGoGet github.com/jstemmer/go-junit-report | ||
|
||
# gcov is used to generate coverage information in a report that can be read | ||
# by CI tools | ||
safeGoGet github.com/axw/gocov/gocov | ||
safeGoGet github.com/AlekSi/gocov-xml | ||
safeGoGet github.com/matm/gocov-html | ||
|
||
# golangci-lint is a lint aggregator used in the lint.sh script to lint the | ||
# go and terraform code. | ||
safeGoGet github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
go get github.com/jstemmer/go-junit-report | ||
go get github.com/axw/gocov/gocov | ||
go get github.com/AlekSi/gocov-xml | ||
go get github.com/matm/gocov-html | ||
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint | ||
# gosec is used for checking the code for security problems | ||
safeGoGet github.com/securego/gosec/cmd/gosec | ||
|
||
go get github.com/securego/gosec/cmd/gosec | ||
echo "Setup complete." |