initial pass at switching to plugn
This commit is contained in:
1 parent
ac75c726ad
commit
7a545759f2
33 files changed
+163
-91
No files matched your search
@@ -19,39 +19,39 @@ case "$1" in
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
|
||||
# *DEPRECATED* in v0.3.15: `pluginhook pre-build` will be removed in future releases
|
||||
pluginhook pre-build "$APP"
|
||||
# *DEPRECATED* in v0.3.22: `pluginhook pre-build-buildstep` will be removed in future releases
|
||||
pluginhook pre-build-buildstep "$APP"
|
||||
pluginhook pre-build-buildpack "$APP"
|
||||
# *DEPRECATED* in v0.3.15: `plugn trigger pre-build` will be removed in future releases
|
||||
plugn trigger pre-build "$APP"
|
||||
# *DEPRECATED* in v0.3.22: `plugn trigger pre-build-buildstep` will be removed in future releases
|
||||
plugn trigger pre-build-buildstep "$APP"
|
||||
plugn trigger pre-build-buildpack "$APP"
|
||||
|
||||
# *DEPRECATED* in v0.3.14: `pluginhook docker-args` will be removed in future releases
|
||||
# *DEPRECATED* in v0.3.14: `plugn trigger docker-args` will be removed in future releases
|
||||
# https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP build)
|
||||
DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP)
|
||||
DOCKER_ARGS=$(: | plugn trigger docker-args $APP build)
|
||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-build $APP)
|
||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
|
||||
docker attach $id
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
|
||||
# *DEPRECATED* in v0.3.15: `pluginhook post-build` will be removed in future releases
|
||||
pluginhook post-build "$APP"
|
||||
# *DEPRECATED* in v0.3.22: `pluginhook post-build-buildstep` will be removed in future releases
|
||||
pluginhook post-build-buildstep "$APP"
|
||||
pluginhook post-build-buildpack "$APP"
|
||||
# *DEPRECATED* in v0.3.15: `plugn trigger post-build` will be removed in future releases
|
||||
plugn trigger post-build "$APP"
|
||||
# *DEPRECATED* in v0.3.22: `plugn trigger post-build-buildstep` will be removed in future releases
|
||||
plugn trigger post-build-buildstep "$APP"
|
||||
plugn trigger post-build-buildpack "$APP"
|
||||
;;
|
||||
|
||||
dockerfile)
|
||||
# extract first port from Dockerfile
|
||||
DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile)
|
||||
[[ -n "$DOCKERFILE_PORT" ]] && config_set --no-restart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
|
||||
pluginhook pre-build-dockerfile "$APP"
|
||||
plugn trigger pre-build-dockerfile "$APP"
|
||||
|
||||
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
||||
docker build $DOKKU_DOCKER_BUILD_OPTS -t "$IMAGE" .
|
||||
|
||||
pluginhook post-build-dockerfile "$APP"
|
||||
plugn trigger post-build-dockerfile "$APP"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -66,11 +66,11 @@ case "$1" in
|
||||
|
||||
case "$IMAGE_SOURCE_TYPE" in
|
||||
herokuish)
|
||||
# *DEPRECATED* in v0.3.15: `pluginhook pre-release` will be removed in future releases
|
||||
pluginhook pre-release $APP $IMAGE_TAG
|
||||
# *DEPRECATED* in v0.3.22: `pluginhook pre-release-buildstep` will be removed in future releases
|
||||
pluginhook pre-release-buildstep $APP $IMAGE_TAG
|
||||
pluginhook pre-release-buildpack $APP $IMAGE_TAG
|
||||
# *DEPRECATED* in v0.3.15: `plugn trigger pre-release` will be removed in future releases
|
||||
plugn trigger pre-release "$APP" "$IMAGE_TAG"
|
||||
# *DEPRECATED* in v0.3.22: `plugn trigger pre-release-buildstep` will be removed in future releases
|
||||
plugn trigger pre-release-buildstep "$APP" "$IMAGE_TAG"
|
||||
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
|
||||
if [[ -n $(config_export global) ]]; then
|
||||
id=$(config_export global | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
@@ -81,16 +81,17 @@ case "$1" in
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
# *DEPRECATED* in v0.3.15: `pluginhook post-release` will be removed in future releases
|
||||
pluginhook post-release $APP $IMAGE_TAG
|
||||
# *DEPRECATED* in v0.3.22: `pluginhook post-release-buildstep` will be removed in future releases
|
||||
pluginhook post-release-buildstep $APP $IMAGE_TAG
|
||||
pluginhook post-release-buildpack $APP $IMAGE_TAG
|
||||
# *DEPRECATED* in v0.3.15: `plugn trigger post-release` will be removed in future releases
|
||||
plugn trigger post-release "$APP" "$IMAGE_TAG"
|
||||
# *DEPRECATED* in v0.3.22: `plugn trigger post-release-buildstep` will be removed in future releases
|
||||
plugn trigger post-release-buildstep "$APP" "$IMAGE_TAG"
|
||||
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
|
||||
;;
|
||||
|
||||
dockerfile)
|
||||
pluginhook pre-release-dockerfile $APP $IMAGE_TAG
|
||||
pluginhook post-release-dockerfile $APP $IMAGE_TAG
|
||||
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
|
||||
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -175,8 +176,8 @@ case "$1" in
|
||||
|
||||
shift 2
|
||||
|
||||
DOCKER_ARGS=$(: | pluginhook docker-args $APP run $IMAGE_TAG)
|
||||
DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP $IMAGE_TAG)
|
||||
DOCKER_ARGS=$(: | plugn trigger docker-args $APP run $IMAGE_TAG)
|
||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-run $APP $IMAGE_TAG)
|
||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
|
||||
has_tty && DOKKU_RUN_OPTS+=" -i -t"
|
||||
@@ -222,7 +223,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
help)
|
||||
cat && cat<<EOF
|
||||
cat<<EOF
|
||||
ls, Pretty listing of deployed applications and containers
|
||||
logs <app> [-t], Show the last logs for an application (-t follows)
|
||||
run <app> <cmd>, Run a command in the environment of an application
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.4.0"
|
||||
[plugin.config]
|
||||
Reference in new issue
Block a user