forked from volcengine/terraform-provider-volcengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
22 lines (19 loc) · 715 Bytes
/
build.sh
File metadata and controls
22 lines (19 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
OS=$1
NAME="terraform-provider-volcengine"
set -ea
if [ "$OS" == "" ]
then
OS="darwin"
fi
CGO_ENABLED=0 GOOS=$OS GOARCH=amd64 go build -o $NAME
rm -f $GOPATH/bin/$NAME
cp $NAME $GOPATH/bin/
# 如果terraform版本高于或者等于0.13
# 需要执行如下三条指令 来映射CLI到本地路径
# 如果小于此版本可以不做这三个操作
# shellcheck disable=SC2154
#mkdir -p ~/.terraform.d/plugins/registry.terraform.io/hashicorp/volcengine/0.0.1/"$OS"_amd64/
#rm -f ~/.terraform.d/plugins/registry.terraform.io/hashicorp/volcengine/0.0.1/"$OS"_amd64/"$NAME"_v0.0.1
#cp $NAME ~/.terraform.d/plugins/registry.terraform.io/hashicorp/volcengine/0.0.1/"$OS"_amd64/"$NAME"_v0.0.1
rm -f $NAME