-
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.
feat: add pre-commit and terraform-docs
- Loading branch information
Showing
9 changed files
with
82 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases | ||
rev: v4.0.1 # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases | ||
hooks: | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- repo: https://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.45.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases | ||
rev: v1.52.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases | ||
hooks: | ||
- id: terraform_validate | ||
- id: terraform_docs | ||
# - id: terraform_docs | ||
- id: terraform_fmt | ||
- repo: https://github.com/terraform-docs/terraform-docs | ||
rev: v0.16.0 | ||
hooks: | ||
- id: terraform-docs-system | ||
args: ["--output-file", "README.md", "."] | ||
... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,8 @@ | ||
2021-10-09 02:09:35 (49.9 MB/s) - ‘go1.17.2.linux-arm64.tar.gz’ saved [102615093/102615093] | ||
|
||
go env: cannot find go env config: neither $XDG_CONFIG_HOME nor $HOME are defined | ||
missing $GOPATH | ||
Cloud-init v. 20.3-10.0.1.el8_4.5 running 'modules:final' at Sat, 09 Oct 2021 02:07:28 +0000. Up 28.54 seconds. | ||
2021-10-09 02:09:45,002 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) | ||
2021-10-09 02:09:45,003 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.6/site-packages/cloudinit/config/cc_scripts_user.py'>) failed | ||
Cloud-init v. 20.3-10.0.1.el8_4.5 finished at Sat, 09 Oct 2021 02:09:45 +0000. Datasource DataSourceOracle. Up 166.46 seconds |
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 |
---|---|---|
|
@@ -31,7 +31,9 @@ ansible-galaxy collection install oracle.oci | |
ansible-galaxy role install cimon-io.systemd-service | ||
|
||
# Python tooling | ||
## update pip | ||
## update setuptools, wheel and pip | ||
dnf install platform-python-devel.aarch64 -y # required by pre-commit | ||
python -m pip install setuptools wheel --upgrade # required by pre-commit | ||
python -m pip install pip --upgrade | ||
|
||
## install and configure virtualenvwrapper | ||
|
@@ -44,3 +46,22 @@ python -m pip install virtualenvwrapper --upgrade | |
|
||
## install global packages | ||
python -m pip install oci oci-cli --upgrade | ||
python -m pip install pre-commit --upgrade | ||
|
||
# install Go globally | ||
## required to install terraform-docs as there is no pre-build arm64 binaries | ||
## install Go from Golang.org as OL8 currently only distribute Go 1.15 | ||
GO_PACKAGE="go1.17.2.linux-arm64.tar.gz" | ||
wget "https://golang.org/dl/$GO_PACKAGE" | ||
rm -rf /usr/local/go && tar -C /usr/local -xzf "$GO_PACKAGE" | ||
echo "PATH=$PATH:/usr/local/go/bin" >> /etc/environment | ||
rm -rf "$GO_PACKAGE" | ||
|
||
{ | ||
echo "#!/bin/sh" | ||
echo "sudo /usr/local/go/bin/go env -w GOBIN=/usr/local/bin" | ||
echo "sudo /usr/local/go/bin/go install github.com/terraform-docs/[email protected]" | ||
} >> $HOME_FOLDER/install_terraform-docs.sh | ||
|
||
chmod +X $HOME_FOLDER/install_terraform-docs.sh | ||
$HOME_FOLDER/install_terraform-docs.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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
## Changes | ||
|
||
Reserved Public IP | ||
add a reserved Public IP to instance |
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,13 @@ | ||
# 2021-10-09 | ||
|
||
## New features | ||
|
||
`Bootstrap.sh` installs new programming language and tooling: | ||
|
||
- Go 1.17.2 | ||
- pre-commit 2.15.0 : A framework for managing and maintaining multi-language Git pre-commit hooks. | ||
- terraform-docs 0.16.0 : Generate Terraform modules documentation in various formats | ||
|
||
## Changes | ||
|
||
pre-commit now use the official hook from the terraform-docs Github repo. |