Files
Gokapi/release/entrypoint.sh
2021-03-12 11:01:00 +01:00

27 lines
599 B
Bash
Executable File

#!/bin/bash
set -e
targets=${@-"darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 windows/amd64 windows/386"}
cd /usr/src/myapp
for target in $targets; do
os="$(echo $target | cut -d '/' -f1)"
arch="$(echo $target | cut -d '/' -f2)"
output="release/gokapi-${os}_${arch}"
if [ $os = "windows" ]; then
output+='.exe'
fi
echo "----> Building project for: $target"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $output
zip -j $output.zip $output > /dev/null
rm $output
done
echo "----> Build is complete. List of files at $release_path:"
cd release/
ls -l gokapi-*