Build enterprise coder binary by default (#3517)

* Build enterprise coder binary by default

Signed-off-by: Spike Curtis <spike@coder.com>

* Add --agpl to develop.sh

Signed-off-by: Spike Curtis <spike@coder.com>

* Add --agpl flag to archive.sh

Signed-off-by: Spike Curtis <spike@coder.com>

* shell format

Signed-off-by: Spike Curtis <spike@coder.com>

* Move AGPL back to LICENSE, explain enterprise license is forthcoming

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Spike Curtis
2022-08-17 09:02:25 -07:00
committed by GitHub
parent 4be61d9250
commit 5817c6ac7f
9 changed files with 132 additions and 15 deletions

View File

@ -3,7 +3,7 @@
# This script builds multiple Go binaries for Coder with the given OS and
# architecture combinations.
#
# Usage: ./build_go_matrix.sh [--version 1.2.3-devel+abcdef] [--output dist/] [--slim] [--sign-darwin] [--archive] [--package-linux] os1:arch1,arch2 os2:arch1 os1:arch3
# Usage: ./build_go_matrix.sh [--version 1.2.3-devel+abcdef] [--output dist/] [--slim] [--sign-darwin] [--archive] [--package-linux] [--agpl] os1:arch1,arch2 os2:arch1 os1:arch3
#
# If no OS:arch combinations are provided, nothing will happen and no error will
# be returned. Slim builds are disabled by default. If no version is specified,
@ -30,6 +30,9 @@
#
# If the --package-linux parameter is specified, all linux binaries will be
# packaged using ./package.sh. Requires the nfpm binary.
#
# If the --agpl parameter is specified, builds only the AGPL-licensed code (no
# Coder enterprise features).
set -euo pipefail
# shellcheck source=scripts/lib.sh
@ -41,8 +44,9 @@ slim=0
sign_darwin=0
archive=0
package_linux=0
agpl=0
args="$(getopt -o "" -l version:,output:,slim,sign-darwin,archive,package-linux -- "$@")"
args="$(getopt -o "" -l version:,output:,slim,sign-darwin,archive,package-linux,agpl -- "$@")"
eval set -- "$args"
while true; do
case "$1" in
@ -73,6 +77,10 @@ while true; do
package_linux=1
shift
;;
--agpl)
agpl=1
shift
;;
--)
shift
break
@ -167,6 +175,9 @@ fi
if [[ "$sign_darwin" == 1 ]]; then
build_args+=(--sign-darwin)
fi
if [[ "$agpl" == 1 ]]; then
build_args+=(--agpl)
fi
# Build each spec.
for spec in "${specs[@]}"; do
@ -208,6 +219,9 @@ for spec in "${specs[@]}"; do
if [[ "$sign_darwin" == 1 ]] && [[ "$spec_os" == "darwin" ]]; then
archive_args+=(--sign-darwin)
fi
if [[ "$agpl" == 1 ]]; then
archive_args+=(--agpl)
fi
log "--- Creating archive for $spec_os $spec_arch ($spec_output_archive)"
execrelative ./archive.sh \