-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathcreate
executable file
·40 lines (37 loc) · 2.27 KB
/
create
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
#!/usr/bin/env bash
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-create-cmd() {
#E create a $PLUGIN_COMMAND_PREFIX service named lollipop
#E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
#E you can also specify the image and image version to use for the service.
#E it *must* be compatible with the ${PLUGIN_IMAGE} image.
#E export ${PLUGIN_VARIABLE}_IMAGE="${PLUGIN_IMAGE}"
#E export ${PLUGIN_VARIABLE}_IMAGE_VERSION="${PLUGIN_IMAGE_VERSION}"
#E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
#E you can also specify custom environment variables to start
#E the ${PLUGIN_COMMAND_PREFIX} service in semicolon-separated form.
#E export ${PLUGIN_VARIABLE}_CUSTOM_ENV="USER=alpha;HOST=beta"
#E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
#A service, service to run command against
#F -c|--config-options "--args --go=here", extra arguments to pass to the container create command
#F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
#F -i|--image IMAGE, the image name to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -m|--memory MEMORY, container memory limit in megabytes (default: unlimited)
#F -N|--initial-network INITIAL_NETWORK, the initial network to attach the service to
#F -p|--password PASSWORD, override the user-level service password
#F -P|--post-create-network NETWORKS, a comma-separated list of networks to attach the service container to after service creation
#F -r|--root-password PASSWORD, override the root-level service password
#F -S|--post-start-network NETWORKS, a comma-separated list of networks to attach the service container to after service start
#F -s|--shm-size SHM_SIZE, override shared memory size for $PLUGIN_COMMAND_PREFIX docker container
declare desc="create a $PLUGIN_SERVICE service"
local cmd="$PLUGIN_COMMAND_PREFIX:create" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" CREATE_FLAGS_LIST=("${@:2}")
service_create "$SERVICE" "${@:2}"
}
service-create-cmd "$@"