forked from elpete/setup-commandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
70 lines (63 loc) · 2.21 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Setup CommandBox CLI
description: Sets up CommandBox for GitHub Actions
branding:
icon: terminal
color: blue
inputs:
forgeboxAPIKey:
description: "ForgeBox API Key"
required: false
default: ''
install:
description: "Comma-delimitted list of packages to install"
required: false
default: ""
installSystemModules:
description: "Install cfconfig and dotenv"
required: false
default: "false"
warmup:
description: "Execute a box version upon installation"
required: false
default: 'false'
version:
description: "CommandBox version to install"
required: false
default: 'latest'
runs:
using: "composite"
steps:
- shell: bash
run: |
# Latest Stable or Specific Version
if [[ "${{ inputs.version }}" == "latest" ]] ; then
echo "Installing Latest Stable CommandBox"
curl -SL -o box.zip https://www.ortussolutions.com/parent/download/commandbox/type/bin
else
echo "Installing CommandBox v${{ inputs.version }}"
curl -SL -o box.zip https://downloads.ortussolutions.com/ortussolutions/commandbox/${{ inputs.version }}/commandbox-bin-${{ inputs.version }}.zip
fi
# Unzip and Install
unzip box.zip -d /usr/local/bin/ && rm -v box.zip
# Install global dependencies
INSTALL_DEPENDENCIES=${{ inputs.install }}
if [[ "${{ inputs.installSystemModules }}" == "true" ]] ; then
if [[ "$INSTALL_DEPENDENCIES" == "" ]] ; then
INSTALL_DEPENDENCIES=commandbox-cfconfig,commandbox-dotenv
else
INSTALL_DEPENDENCIES=$INSTALL_DEPENDENCIES,commandbox-cfconfig,commandbox-dotenv
fi
fi
if [[ "$INSTALL_DEPENDENCIES" != "" ]] ; then
echo "Detected installation of global packages: $INSTALL_DEPENDENCIES"
box install $INSTALL_DEPENDENCIES
fi
# Add ForgeBox Key
if [[ "${{ inputs.forgeboxAPIKey }}" != "" ]] ; then
echo "Setting up ForgeBox API Key..."
box config set endpoints.forgebox.APIToken=${{ inputs.forgeboxAPIKey }} > /dev/null
fi
# Warmup
if [[ "${{ inputs.warmup }}" == "true" ]] ; then
box version
fi