mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-22 23:23:35 -06:00
scripts: build script
This commit is contained in:
parent
ab411a1952
commit
b569a5d8b6
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ terraform.tfstate
|
||||
bin/
|
||||
config/y.go
|
||||
config/y.output
|
||||
pkg/
|
||||
vendor/
|
||||
website/.vagrant
|
||||
website/build
|
||||
|
5
Makefile
5
Makefile
@ -16,9 +16,12 @@ export CGO_CFLAGS CGO_LDFLAGS PATH
|
||||
|
||||
default: test
|
||||
|
||||
dev: config/y.go libucl
|
||||
bin: config/y.go libucl
|
||||
@sh -c "$(CURDIR)/scripts/build.sh"
|
||||
|
||||
dev: config/y.go libucl
|
||||
@TF_DEV=1 sh -c "$(CURDIR)/scripts/build.sh"
|
||||
|
||||
libucl: vendor/libucl/$(LIBUCL_NAME)
|
||||
|
||||
test: config/y.go libucl
|
||||
|
@ -30,6 +30,10 @@ fi
|
||||
echo "--> Getting dependencies..."
|
||||
go get ./...
|
||||
|
||||
# Delete the old dir
|
||||
echo "--> Removing old directory..."
|
||||
rm -f bin/*
|
||||
|
||||
# Build!
|
||||
echo "--> Building..."
|
||||
gox \
|
||||
@ -41,6 +45,20 @@ gox \
|
||||
mv bin/terraform-terraform${EXTENSION} bin/terraform${EXTENSION}
|
||||
cp bin/terraform* ${GOPATHSINGLE}/bin
|
||||
|
||||
# If we're on Windows, get the DLL in there
|
||||
if [ "$(go env GOOS)" = "windows" ]; then
|
||||
cp libucl.dll bin/
|
||||
fi
|
||||
|
||||
if [ "${TF_DEV}x" = "x" ]; then
|
||||
# Zip and copy to the dist dir
|
||||
echo "--> Packaging..."
|
||||
mkdir -p pkg
|
||||
cd bin/
|
||||
zip ../pkg/$(go env GOOS)_$(go env GOARCH).zip ./*
|
||||
cd $DIR
|
||||
fi
|
||||
|
||||
# Done!
|
||||
echo
|
||||
echo "--> Results:"
|
||||
|
Loading…
Reference in New Issue
Block a user