Skip to content

Commit

Permalink
[shfmt] Add target for installing new package (#37)
Browse files Browse the repository at this point in the history
* feat(install/Makefile): add target which installs new package (shfmt)

* feat(shellcheck): add new target which installs shellcheck

* fix(README): regenerate README.md

* fix(install/Makefile): parameterize OS

* refactor(install/Makefile): sort dependencies alphabetically

* Merge shellcheck in shfmt
  • Loading branch information
vadim-gleif authored and osterman committed Aug 17, 2018
1 parent b8a1887 commit 48b6937
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 45 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Available targets:
kubectx Install kubectx
kubens Install kubens
lectl Install lectl script to check issued certificates by Let's Encrypt on CTL
shellcheck Install shellcheck static analysis tool for shell scripts
shfmt Install shfmt - shell parser, formatter and interpreter
sops Install sops (required by `helm-secrets`)
stern Install stern multi pod and container log tailing for Kubernetes
terraform Install Terraform
Expand Down
2 changes: 2 additions & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Available targets:
kubectx Install kubectx
kubens Install kubens
lectl Install lectl script to check issued certificates by Let's Encrypt on CTL
shellcheck Install shellcheck static analysis tool for shell scripts
shfmt Install shfmt - shell parser, formatter and interpreter
sops Install sops (required by `helm-secrets`)
stern Install stern multi pod and container log tailing for Kubernetes
terraform Install Terraform
Expand Down
105 changes: 60 additions & 45 deletions install/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,32 @@ TMP ?= /tmp
github_download_binary_release = $(CURL) -o $(INSTALL_PATH)/$@ https://github.com/$(1)/$@/releases/download/$(2)/$(3) && chmod +x $(INSTALL_PATH)/$@

all: awless \
aws-vault \
cfssl \
chamber \
fetch \
github-commenter \
gomplate \
goofys \
helm \
helmfile \
htmltest \
hugo \
kops \
kubectl \
kubectx \
kubens \
sops \
stern \
terraform \
terraform-docs \
terragrunt \
yq \
figurine \
lectl \
cloudflared
aws-vault \
cfssl \
chamber \
cloudflared \
fetch \
figurine \
github-commenter \
gomplate \
goofys \
helm \
helmfile \
htmltest \
hugo \
kops \
kubectl \
kubectx \
kubens \
lectl \
shellcheck \
shfmt \
sops \
stern \
terraform \
terraform-docs \
terragrunt \
yq

export AWLESS_VERSION ?= 0.1.11
# Releases: https://github.com/wallix/awless/releases
Expand Down Expand Up @@ -62,12 +64,25 @@ export CHAMBER_VERSION ?= 2.1.0
chamber:
$(call github_download_binary_release,segmentio,v$(CHAMBER_VERSION),$@-v$(CHAMBER_VERSION)-$(OS)-$(ARCH))

# Releases: https://developers.cloudflare.com/argo-tunnel/downloads/
## Install cloudflared which offers an easy way to expose web servers securely to the internet(Argo Tunnel)
cloudflared:
$(CURL) -o - https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-$(OS)-$(ARCH).tgz | tar -zxO cloudflared > $(INSTALL_PATH)/cloudflared
chmod +x $(INSTALL_PATH)/cloudflared

export FETCH_VERSION ?= 0.2.0
# Releases: https://github.com/gruntwork-io/fetch/releases
## Install fetch to easily download files, folders, and release assets from a specific git commit, branch, or tag
fetch:
$(call github_download_binary_release,gruntwork-io,v$(FETCH_VERSION),$@_$(OS)_$(ARCH))

export FIGURINE_VERSION ?= 0.2.2
# Releases: https://github.com/arsham/figurine/releases
## Install figurine to generate fancy colorized ASCII banners
figurine:
$(CURL) -o - https://github.com/arsham/figurine/releases/download/v$(FIGURINE_VERSION)/figurine_$(OS)_v$(FIGURINE_VERSION).tar.gz | tar -zxO figurine > $(INSTALL_PATH)/figurine
chmod +x $(INSTALL_PATH)/figurine

export GITHUB_COMMENTER_VERSION ?= 0.1.2
## Install github-commenter
github-commenter:
Expand All @@ -94,7 +109,6 @@ export GOOFYS_VERSION ?= 0.19.0
goofys:
$(call github_download_binary_release,kahing,v$(GOOFYS_VERSION),$@)


export HELM_VERSION ?= 2.9.1
## Install helm
helm:
Expand Down Expand Up @@ -144,26 +158,6 @@ export HUGO_VERSION ?= 0.45.1
hugo: hugo-$(OS)
@exit 0

export FIGURINE_VERSION ?= 0.2.2
# Releases: https://github.com/arsham/figurine/releases
## Install figurine to generate fancy colorized ASCII banners
figurine:
$(CURL) -o - https://github.com/arsham/figurine/releases/download/v$(FIGURINE_VERSION)/figurine_$(OS)_v$(FIGURINE_VERSION).tar.gz | tar -zxO figurine > $(INSTALL_PATH)/figurine
chmod +x $(INSTALL_PATH)/figurine

export LECTL_VERSION ?= 0.16
# Releases: https://github.com/sahsanu/lectl/releases
## Install lectl script to check issued certificates by Let's Encrypt on CTL
lectl:
$(CURL) -o - https://raw.githubusercontent.com/sahsanu/lectl/v$(LECTL_VERSION)/lectl > $(INSTALL_PATH)/lectl
chmod +x $(INSTALL_PATH)/lectl

# Releases: https://developers.cloudflare.com/argo-tunnel/downloads/
## Install cloudflared which offers an easy way to expose web servers securely to the internet(Argo Tunnel)
cloudflared:
$(CURL) -o - https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-$(OS)-$(ARCH).tgz | tar -zxO cloudflared > $(INSTALL_PATH)/cloudflared
chmod +x $(INSTALL_PATH)/cloudflared

export KOPS_VERSION ?= 1.9.2
# Releases: https://github.com/kubernetes/kops/releases
## Install kops
Expand All @@ -190,6 +184,27 @@ kubens:
$(CURL) -o $(INSTALL_PATH)/$@ https://raw.githubusercontent.com/ahmetb/kubectx/v$(KUBECTX_VERSION)/$@
chmod +x $(INSTALL_PATH)/$@

export LECTL_VERSION ?= 0.16
# Releases: https://github.com/sahsanu/lectl/releases
## Install lectl script to check issued certificates by Let's Encrypt on CTL
lectl:
$(CURL) -o - https://raw.githubusercontent.com/sahsanu/lectl/v$(LECTL_VERSION)/lectl > $(INSTALL_PATH)/lectl
chmod +x $(INSTALL_PATH)/lectl

export SHELLCHECK_VERSION ?= 0.5.0
# Releases: https://github.com/koalaman/shellcheck/releasess
## Install shellcheck static analysis tool for shell scripts
shellcheck:
$(CURL) -o - https://storage.googleapis.com/shellcheck/shellcheck-v$(SHELLCHECK_VERSION).$(OS).x86_64.tar.xz | tar -xOJ shellcheck-v$(SHELLCHECK_VERSION)/shellcheck > $(INSTALL_PATH)/shellcheck
chmod +x $(INSTALL_PATH)/shellcheck

export SHFMT_VERSION ?= 2.5.1
# Releases: https://github.com/mvdan/sh/releases
## Install shfmt - shell parser, formatter and interpreter
shfmt:
$(CURL) -o - https://github.com/mvdan/sh/releases/download/v$(SHFMT_VERSION)/shfmt_v$(SHFMT_VERSION)_$(OS)_$(ARCH) > $(INSTALL_PATH)/shfmt
chmod +x $(INSTALL_PATH)/shfmt

export SOPS_VERSION ?= 3.0.5
## Install sops (required by `helm-secrets`)
sops:
Expand Down

0 comments on commit 48b6937

Please sign in to comment.