mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
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:
+30
-1
@@ -1,9 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./develop.sh [--agpl]
|
||||
#
|
||||
# If the --agpl parameter is specified, builds only the AGPL-licensed code (no
|
||||
# Coder enterprise features).
|
||||
|
||||
# Allow toggling verbose output
|
||||
[[ -n ${VERBOSE:-""} ]] && set -x
|
||||
set -euo pipefail
|
||||
|
||||
agpl="${CODER_BUILD_AGPL:-0}"
|
||||
args="$(getopt -o "" -l agpl -- "$@")"
|
||||
eval set -- "$args"
|
||||
while true; do
|
||||
case "$1" in
|
||||
--agpl)
|
||||
agpl=1
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
error "Unrecognized option: $1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
# shellcheck disable=SC1091,SC1090
|
||||
source "${SCRIPT_DIR}/lib.sh"
|
||||
@@ -28,8 +52,13 @@ if [[ ! -e ./site/out/bin/coder.sha1 && ! -e ./site/out/bin/coder.tar.zst ]]; th
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmd_path="enterprise/cmd/coder"
|
||||
if [[ "$agpl" == 1 ]]; then
|
||||
cmd_path="cmd/coder"
|
||||
fi
|
||||
|
||||
# Compile the CLI binary once just so we don't waste time compiling things multiple times
|
||||
go build -tags embed -o "${CODER_DEV_BIN}" "${PROJECT_ROOT}/cmd/coder"
|
||||
go build -tags embed -o "${CODER_DEV_BIN}" "${PROJECT_ROOT}/${cmd_path}"
|
||||
# Use the coder dev shim so we don't overwrite the user's existing Coder config.
|
||||
CODER_DEV_SHIM="${PROJECT_ROOT}/scripts/coder-dev.sh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user