-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 1.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.PHONY: all
GO_DIR := /usr/local
GO_VERSION=1.17
TF_VERSION=1.2.1
NODE_VERSION=14.x
all: install-dependencies test/all
install-dependencies: install/terraform install/go install/nodejs
# -----------------------------------------------------------------------------------
# Dependencies install targets
# -----------------------------------------------------------------------------------
install/terraform:
@echo "INSTALLING TERRAFORM version ${TF_VERSION}..."
@curl https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip --output /opt/terraform.zip
@unzip -o /opt/terraform.zip -d /usr/local/bin/
@rm -f /opt/terraform.zip
@terraform -version
@echo ""
install/go:
@echo "INSTALLING GO version ${GO_VERSION}..."
@rm -rf ${GO_DIR}/go
@curl https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz --output ${GO_DIR}/go${GO_VERSION}.linux-amd64.tar.gz
@cd ${GO_DIR} && tar -C ${GO_DIR} -xzf ${GO_DIR}/go${GO_VERSION}.linux-amd64.tar.gz
@rm -f ${GO_DIR}/go${GO_VERSION}.linux-amd64.tar.gz
@go version
@echo ""
install/nodejs:
@echo "INSTALLING NODE.js version ${NODE_VERSION}..."
@curl -sL https://rpm.nodesource.com/setup_${NODE_VERSION} | bash -
@yum install -y nodejs
@node -v
@npm -v
@echo ""
# -----------------------------------------------------------------------------------
# Test Targets
# -----------------------------------------------------------------------------------
test/all:
cd test/ && go mod tidy -compat=1.17 && go test -count 1 -v -timeout 60m