-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
29 lines (23 loc) · 931 Bytes
/
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
build:
go build -gcflags="all=-N -l" -o ~/.terraform.d/plugins/registry.terraform.io/disc/pritunl/0.0.1/darwin_amd64/terraform-provider-pritunl_v0.0.1 main.go
test:
@docker rm tf_pritunl_acc_test -f || true
@docker run --name tf_pritunl_acc_test --hostname pritunl.local --rm -d --privileged \
-p 1194:1194/udp \
-p 1194:1194/tcp \
-p 80:80/tcp \
-p 443:443/tcp \
-p 27017:27017/tcp \
ghcr.io/jippi/docker-pritunl:1.32.3602.80
sleep 20
@chmod +x ./tools/wait-for-it.sh
./tools/wait-for-it.sh localhost:27017 -- echo "mongodb is up"
# enables an api access for the pritunl user, updates an api token and secret
@docker exec -i tf_pritunl_acc_test mongo pritunl < ./tools/mongo.js
TF_ACC=1 \
PRITUNL_URL="https://localhost/" \
PRITUNL_INSECURE="true" \
PRITUNL_TOKEN=tfacctest_token \
PRITUNL_SECRET=tfacctest_secret \
go test -v -cover -count 1 ./internal/provider
@docker rm tf_pritunl_acc_test -f