File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ source "${SCRIPT_DIR}/lib.sh"
14
14
set -euo pipefail
15
15
16
16
CODER_DEV_ACCESS_URL=" ${CODER_DEV_ACCESS_URL:- http:// 127.0.0.1: 3000} "
17
+ CODER_DEV_LICENSE=" ${CODER_DEV_LICENSE:- " " } "
17
18
DEVELOP_IN_CODER=" ${DEVELOP_IN_CODER:- 0} "
18
19
debug=0
19
20
DEFAULT_PASSWORD=" SomeSecurePassword!"
@@ -200,6 +201,18 @@ fatal() {
200
201
echo ' Failed to create regular user. To troubleshoot, try running this command manually.'
201
202
fi
202
203
204
+ # Add a license if one is provided and we are not operating in AGPL mode.
205
+ if [ " ${CODER_BUILD_AGPL:- 0} " -gt " 0" ]; then
206
+ if [ -n " ${CODER_DEV_LICENSE} " ]; then
207
+ NUM_LICENSES=$( " ${CODER_DEV_SHIM} " licenses list -o json | jq -r ' . | length' )
208
+ if [ " ${NUM_LICENSES} " -eq " 0" ]; then
209
+ echo -n " ${CODER_DEV_LICENSE} " | " ${CODER_DEV_SHIM} " licenses add -f - || echo " ERROR: failed to add license. Try adding one manually."
210
+ else
211
+ echo " At least one license already exists."
212
+ fi
213
+ fi
214
+ fi
215
+
203
216
# Create a new organization and add the member user to it.
204
217
if [ " ${multi_org} " -gt " 0" ]; then
205
218
another_org=" second-organization"
You can’t perform that action at this time.
0 commit comments