这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
e61421b
refactor: migrate the app deploy lock to the data directory
josegonzalez Aug 27, 2023
b7a3ef2
fix: use correct path for lock
josegonzalez Jan 30, 2024
f0c6f45
fix: correctly namespace the lock file
josegonzalez Feb 9, 2024
db476d3
chore: run shfmt
josegonzalez Feb 9, 2024
b94f6cd
set exposedByDefault to false in traefik to only expose docker contai…
bastianh Mar 3, 2024
5995818
tests: add initial test for exposed dockerfile port
josegonzalez Mar 7, 2024
d4b484a
fix: replace existing port-map ingress objects with domain ingress ob…
josegonzalez Mar 12, 2024
2546984
fix: correct testcase for metabase deploy
josegonzalez Mar 12, 2024
ac2ea75
fix: use correct variable name
josegonzalez Mar 12, 2024
77d9594
fix: use annotation to check for ingress method
josegonzalez Mar 12, 2024
ee08b8c
chore: remove traefik priority functionality
josegonzalez Mar 13, 2024
d2b167d
Merge pull request #6681 from dokku/k3s-ingress-per-domain
josegonzalez Mar 13, 2024
b9d3390
Merge pull request #6650 from bastianh/expose_by_default
josegonzalez Mar 13, 2024
0d6bde2
Merge pull request #6156 from dokku/migrate-lock-path
josegonzalez Mar 13, 2024
68d05b2
refactor: simplify file ownership in the container by setting the pro…
josegonzalez Feb 25, 2024
dd26850
chore: double-quote
josegonzalez Feb 25, 2024
681dc93
feat: disable setuidgid as the app is already running as the correct …
josegonzalez Feb 25, 2024
c8afdb5
Merge pull request #6700 from dokku/traefik-remove-priority
josegonzalez Mar 13, 2024
64cc239
fix: use copytruncate in logrotate commands
josegonzalez Mar 13, 2024
87a008c
Merge pull request #6632 from dokku/remove-disable-chown
josegonzalez Mar 13, 2024
76dd78e
chore: run shfmt
josegonzalez Mar 13, 2024
eb9a754
Merge pull request #6703 from dokku/logrotate-perms
josegonzalez Mar 13, 2024
55461f0
feat: switch the default k3s routing layer from traefik to nginx
josegonzalez Mar 13, 2024
10468ce
fix: ensure we cleanup the data directory on app deletion
josegonzalez Mar 13, 2024
eaf641f
Merge pull request #6705 from dokku/6690-git-data-dir-cleanup
josegonzalez Mar 13, 2024
4bd64df
Merge pull request #6704 from dokku/k3s-default-nginx
josegonzalez Mar 13, 2024
50958fc
refactor: remove git:unlock command
josegonzalez Mar 13, 2024
9cb5495
fix: correct issue where removing by index failed due to incorrect in…
josegonzalez Mar 13, 2024
795d494
chore: rename test files
josegonzalez Mar 13, 2024
a1790d6
fix: use correct variable
josegonzalez Mar 13, 2024
a78a865
Merge pull request #6707 from dokku/6657-remove-by-index
josegonzalez Mar 13, 2024
c53d21c
Merge pull request #6706 from dokku/6690-git-unlock
josegonzalez Mar 13, 2024
e6f964b
chore(deps): bump zipp from 3.17.0 to 3.18.0 in /docs/_build
dependabot[bot] Mar 13, 2024
b78431a
Merge pull request #6709 from dokku/dependabot/pip/docs/_build/zipp-3…
josegonzalez Mar 13, 2024
b026103
chore(deps): bump google.golang.org/protobuf in /plugins/scheduler-k3s
dependabot[bot] Mar 13, 2024
4d07ac6
Merge pull request #6710 from dokku/dependabot/go_modules/plugins/sch…
josegonzalez Mar 14, 2024
5d8ccee
fix: disable filename globbing for all commands
josegonzalez Mar 13, 2024
34768ca
fix: set exit_code variable
josegonzalez Mar 13, 2024
dc20a38
fix: use old method for calling the git plugin
josegonzalez Mar 13, 2024
91c8e62
refactor: reparse the original ssh command in the hopes of keeping ar…
josegonzalez Mar 13, 2024
e50b941
fix: correct arg parsing for git commands
josegonzalez Mar 13, 2024
79bce7d
fix: use dollar sign
josegonzalez Mar 13, 2024
cf742bb
chore: run shfmt
josegonzalez Mar 13, 2024
ca55f58
refactor: move plugin test helper functions to test_helper.bash
josegonzalez Mar 13, 2024
e43927a
tests: add a test for argument handling
josegonzalez Mar 13, 2024
6d07fea
fix: correct expansion issue
josegonzalez Mar 13, 2024
ff18061
fix: correctly prepend argument to passed ssh args
josegonzalez Mar 14, 2024
a9933c7
Merge pull request #6708 from dokku/2322-spaces-over-ssh
josegonzalez Mar 14, 2024
135497a
chore: remove unused code for copying cache directories
josegonzalez Feb 25, 2024
c26a49b
tests: add tests for config and docker options
josegonzalez Feb 25, 2024
883809f
fix: properly rewrite domains when renaming an app
josegonzalez Feb 26, 2024
e0409ca
fix: ensure env vars are copied over when cloning or renaming an app
josegonzalez Mar 14, 2024
1cc8b37
fix: drop extra phase argument
josegonzalez Mar 14, 2024
0ea9e7a
fix: copy over all phase files during an app rename or clone
josegonzalez Mar 14, 2024
f34fd27
refactor: use CallPlugnTrigger instead of PlugnTriggerOutputAsString
josegonzalez Mar 14, 2024
cdff4ae
refactor: use CallPlugnTrigger instead of PlugnTriggerOutput
josegonzalez Mar 14, 2024
0d26a90
Merge pull request #6630 from dokku/cleanup-cache-dir-code
josegonzalez Mar 14, 2024
2fd6767
Merge pull request #6711 from dokku/6422-remove-plugin-trigger-output…
josegonzalez Mar 14, 2024
68a280e
Merge pull request #6712 from dokku/6422-remove-plugin-trigger-output
josegonzalez Mar 14, 2024
c277f52
refactor: use CallPlugnTrigger instead of PlugnTriggerSetup
josegonzalez Mar 14, 2024
e641fae
feat: add disk utilization to report output
josegonzalez Mar 14, 2024
54e324a
Merge pull request #6715 from dokku/5764-df-report
josegonzalez Mar 14, 2024
a7c90c4
Merge pull request #6714 from dokku/6422-remove-plugin-trigger-setup
josegonzalez Mar 14, 2024
ea60980
chore: remove unused plugn code
josegonzalez Mar 14, 2024
bb5ab0a
refactor: use CallPlugnTrigger instead of PlugnTrigger
josegonzalez Mar 14, 2024
005eb2e
fix: detect the error twice
josegonzalez Mar 14, 2024
4bae815
chore: remove codeskyblue/go-sh
josegonzalez Mar 14, 2024
e470a88
Merge pull request #6713 from dokku/6422-remove-plugin-trigger
josegonzalez Mar 14, 2024
4de97a1
feat: add ability to only build synced repo if there are changes
josegonzalez Mar 14, 2024
5877298
tests: check that the ref has been updated to the correct value
josegonzalez Mar 14, 2024
5d24b10
chore: run shfmt
josegonzalez Mar 14, 2024
2f2d4f5
Merge pull request #6717 from dokku/6242-git-sync-build-if-changes
josegonzalez Mar 14, 2024
e98cbe9
feat: add a make target to copy the dokku binary over
josegonzalez Mar 14, 2024
9597943
Merge pull request #6719 from dokku/copydokku
josegonzalez Mar 14, 2024
54e1b97
fix: add nginx-property binary to gitignore
josegonzalez Mar 14, 2024
5a5531b
Merge pull request #6720 from dokku/nginx-gitignore
josegonzalez Mar 14, 2024
41b0898
fix: correct issue where cron properties cannot be retrieved if global
josegonzalez Mar 14, 2024
5553da1
Merge pull request #6721 from dokku/cron-fix-global
josegonzalez Mar 14, 2024
83b8945
feat: write current process id to all acquired lock files
josegonzalez Mar 14, 2024
89cff89
fix: do not unset variables unless re-running as dokku user
josegonzalez Mar 14, 2024
dcd85f5
chore(deps): bump tj-actions/changed-files from 42.1.0 to 43.0.0
dependabot[bot] Mar 14, 2024
8c67368
chore(deps): bump zipp from 3.17.0 to 3.18.0 in /docs/_build
dependabot[bot] Mar 14, 2024
efc35ab
fix: correctly check if a repository has code or not in git plugin
josegonzalez Mar 14, 2024
159b01e
Merge pull request #6722 from dokku/dependabot/github_actions/tj-acti…
josegonzalez Mar 14, 2024
991b6fd
Merge pull request #6723 from dokku/dependabot/pip/docs/_build/zipp-3…
josegonzalez Mar 14, 2024
4b06990
Merge pull request #6718 from dokku/bashpid-in-cron
josegonzalez Mar 14, 2024
a759b03
Merge pull request #6724 from dokku/git-fix-empty-repo-check
josegonzalez Mar 14, 2024
43c2554
feat: warn when publish ports if scaling up or zero downtime is enabled
josegonzalez Mar 14, 2024
36ade1e
tests: add test for port publishing warning
josegonzalez Mar 14, 2024
6e3631a
fix: correct warning placement and update tests to account for parall…
josegonzalez Mar 14, 2024
c9b9c2a
chore: run shfmt
josegonzalez Mar 14, 2024
9a7c8cd
chore(deps): bump tj-actions/changed-files from 42.1.0 to 43.0.0
dependabot[bot] Mar 15, 2024
0ab4e2b
chore(deps): bump zipp from 3.17.0 to 3.18.1 in /docs/_build
dependabot[bot] Mar 15, 2024
ca893cd
chore(deps): update markdown requirement in /docs/_build
dependabot[bot] Mar 15, 2024
be9a608
Merge pull request #6725 from dokku/4662-warn-on-published-port
josegonzalez Mar 15, 2024
2119268
Merge pull request #6727 from dokku/dependabot/github_actions/tj-acti…
josegonzalez Mar 15, 2024
0c5887c
Merge pull request #6729 from dokku/dependabot/pip/docs/_build/markdo…
josegonzalez Mar 15, 2024
f42596a
Merge branch '0.34-release' into dependabot/pip/docs/_build/zipp-3.18.1
josegonzalez Mar 15, 2024
c533700
Merge pull request #6728 from dokku/dependabot/pip/docs/_build/zipp-3…
josegonzalez Mar 15, 2024
4d22ccd
Clarify alternate proxy support status
strugee Mar 17, 2024
2274eea
Merge pull request #6731 from strugee/patch-1
josegonzalez Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v42.1.0
uses: tj-actions/changed-files@v43.0.0
with:
files: contrib/images/digitalocean/**
- name: Run `packer validate`
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ go-clean:
fi ;\
done

copyfiles:
$(MAKE) go-build || exit 1
copydokku:
cp dokku /usr/local/bin/dokku
chmod 0755 /usr/local/bin/dokku

copyfiles: copydokku
$(MAKE) go-build || exit 1
mkdir -p ${CORE_PLUGINS_PATH} ${PLUGINS_PATH}
rm -rf ${CORE_PLUGINS_PATH}/*
test -d ${CORE_PLUGINS_PATH}/enabled || PLUGIN_PATH=${CORE_PLUGINS_PATH} plugn init
Expand Down
9 changes: 7 additions & 2 deletions contrib/dokku_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,14 @@ main() {
[[ " storage:ensure-directory " == *" $CMD "* ]] && unset APP
[[ "$CMD" =~ events*|plugin*|ssh-keys* ]] && unset APP
[[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
if [[ -n "$@" ]] && [[ -n "$APP" ]]; then
set -- "$APP" "$@"
set -- "--app" "$@"
fi
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@"
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@ || {
local ssh_args=("-o" "LogLevel=QUIET" "-p" "$DOKKU_PORT" "-t" "dokku@$DOKKU_REMOTE_HOST" "--")
ssh_args+=("$@")
ssh "${ssh_args[@]}" || {
ssh_exit_code="$?"
echo " ! Failed to execute dokku command over ssh: exit code $?" 1>&2
echo " ! If there was no output from Dokku, ensure your configured SSH Key can connect to the remote server" 1>&2
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ click==8.1.7
ghp-import==2.1.0
importlib-metadata==7.0.2
Jinja2==3.1.3
Markdown>=3.2.1,<3.6
Markdown>=3.2.1,<3.7
MarkupSafe==2.1.5
mergedeep==1.3.4
mkdocs==1.5.3
Expand All @@ -20,4 +20,4 @@ pyyaml_env_tag==0.1
six==1.16.0
soupsieve==2.5
watchdog==4.0.0
zipp==3.17.0
zipp==3.18.1
14 changes: 14 additions & 0 deletions docs/appendices/0.34.0-migration-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 0.34.0 Migration Guide

## Removals

- The `disable-chown` property of the `scheduler-docker-local` plugin has been removed. Mounted paths will no longer have file permissions changed during the pre-deploy phase. Files baked into the container image for herokuish builds will always be owned by the correct user.
- The `git:unlock` command has been removed. It was previously used to "unlock" a temporary directory that already existed. The directory the `git:unlock` command used to cleanup is now properly removed on exit of the `git:from-image` command.

## Changes

- The k3s scheduler now defaults to nginx as it's default proxy implementation. The traefik proxy implementation is still available, though users will need to set the global `ingress-class` k3s property to `traefik` via the following command:

```shell
dokku scheduler-k3s:set --global ingress-class traefik
```
9 changes: 7 additions & 2 deletions docs/deployment/methods/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ git:from-archive [--archive-type ARCHIVE_TYPE] <app> <archive-url> [<git-usernam
git:from-image [--build-dir DIRECTORY] <app> <docker-image> [<git-username> <git-email>] # Updates an app's git repository with a given docker image
git:generate-deploy-key # Generates a deploy ssh key
git:load-image [--build-dir DIRECTORY] <app> <docker-image> [<git-username> <git-email>] # Updates an app's git repository with a docker image loaded from stdin
git:sync [--build] <app> <repository> [<git-ref>] # Clone or fetch an app from remote git repo
git:sync [--build|build-if-changes] <app> <repository> [<git-ref>] # Clone or fetch an app from remote git repo
git:initialize <app> # Initialize a git repository for an app
git:public-key # Outputs the dokku public deploy key
git:report [<app>] [<flag>] # Displays a git report for one or more apps
git:set <app> <key> (<value>) # Set or clear a git property for an app
git:status <app> # Show the working tree status for an app
git:unlock <app> [--force] # Removes previous git clone folder for new deployment
```

Git-based deployment has been the traditional method of deploying applications in Dokku. As of v0.12.0, Dokku introduces a few ways to customize the experience of deploying via `git push`. A Git-based deployment currently supports building applications via:
Expand Down Expand Up @@ -158,6 +157,12 @@ By default, this command does not trigger an application build. To do so during
dokku git:sync --build node-js-app https://github.com/heroku/node-js-getting-started.git
```

When running `git:sync` without a reference, it may be useful to only build when there are changes. To do so, specify the `--build-if-changes` flag.

```shell
dokku git:sync --build-if-changes node-js-app https://github.com/heroku/node-js-getting-started.git
```

### Initializing from private repositories

> [!IMPORTANT]
Expand Down
14 changes: 0 additions & 14 deletions docs/deployment/schedulers/docker-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ dokku scheduler:set node-js-app selected

Many builders only produce amd64-compatible images. The docker-local scheduler will automatically detect these and run them via the `--platform=linux/amd64` on arm64 deploy targets.

### Disabling chown of persistent storage

The `scheduler-docker-local` plugin will ensure your storage mounts are owned by either `herokuishuser` or the overridden value you have set in `DOKKU_APP_USER`. You may disable this by running the following `scheduler-docker-local:set` command for your application:

```shell
dokku scheduler-docker-local:set node-js-app disable-chown true
```

Once set, you may re-enable it by setting a blank value for `disable-chown`:

```shell
dokku scheduler-docker-local:set node-js-app disable-chown
```

### Disabling the init process

The `scheduler-docker-local` injects an init process by default via the `--init`. For some apps - such as those where the built docker image uses S6 as the init - this may be undesirable and cause issues with process starts. You may disable this by running the following `scheduler-docker-local:set` command for your application:
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment/schedulers/k3s.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ By default, Dokku will attempt to auto-detect the IP address of the server. In c
dokku scheduler-k3s:initialize --server-ip 192.168.20.15
```

Dokku's k3s integration natively uses `Traefik` as it's ingress load balancer via [Traefik's CRDs](https://doc.traefik.io/traefik/providers/kubernetes-crd/), but a cluster can be set to use `nginx` via the [ingress-nginx](https://github.com/kubernetes/ingress-nginx) project. Switching to nginx will result in any `nginx` plugin settings being respected, either by turning them into annotations or creating a custom server snippet.
Dokku's k3s integration natively uses `nginx` as it's ingress load balancer via [ingress-nginx](https://github.com/kubernetes/ingress-nginx). Properties set by the `nginx` plugin will be respected, either by turning them into annotations or creating a custom server/location snippet that the `ingress-nginx` project can use.

To change the ingress, set the `--ingress-class` flag:
Dokku can also use Traefik on cluster initialization via the [Traefik's CRDs](https://doc.traefik.io/traefik/providers/kubernetes-crd/). To change the ingress, set the `--ingress-class` flag:

```shell
dokku scheduler-k3s:initialize --ingress-class nginx
dokku scheduler-k3s:initialize --ingress-class traefik
```

### Adding nodes to the cluster
Expand Down
1 change: 1 addition & 0 deletions docs/getting-started/upgrading/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Docker releases updates periodically to their engine. We recommend reading their

Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded.

- [Upgrading to 0.34](/docs/appendices/0.34.0-migration-guide.md)
- [Upgrading to 0.33](/docs/appendices/0.33.0-migration-guide.md)
- [Upgrading to 0.32](/docs/appendices/0.32.0-migration-guide.md)
- [Upgrading to 0.31](/docs/appendices/0.31.0-migration-guide.md)
Expand Down
10 changes: 0 additions & 10 deletions docs/networking/proxies/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ dokku traefik:set --global log-level DEBUG

After modifying, the Traefik container will need to be restarted.

### Setting rule priority

By default, app deployments will result in the newer traefik rules using a higher priority in order to have any newer rules respected by Traefik. Rule priorities will always increase according to the current unix timestamp. The priority may be fixed by setting the app-level `priority` property:

```shell
dokku traefik:set node-js-app priority 12345
```

After modifying, the app container will need to be recreated via a `ps:rebuild` or an app deployment.

### SSL Configuration

The traefik plugin only supports automatic ssl certificates from it's letsencrypt integration. Managed certificates provided by the `certs` plugin are ignored.
Expand Down
2 changes: 1 addition & 1 deletion docs/networking/proxy-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ proxy:report [<app>] [<flag>] # Displays a proxy report fo
proxy:set [<app>|--global] <proxy-type> # Set proxy type for app
```

In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. This allows other proxy software - such as HAProxy or Caddy - to be used in place of nginx.

## Usage

Expand Down
19 changes: 12 additions & 7 deletions dokku
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export DOKKU_SYSTEM_USER=${DOKKU_SYSTEM_USER:="dokku"}
export DOKKU_API_VERSION=1
export DOKKU_NOT_IMPLEMENTED_EXIT=10
export DOKKU_VALID_EXIT=0
export DOKKU_PID="$BASHPID"
export DOKKU_PID="${DOKKU_PID:=$$}"

export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_LOGS_HOST_DIR=${DOKKU_LOGS_HOST_DIR:=$DOKKU_LOGS_DIR}
Expand Down Expand Up @@ -88,8 +88,8 @@ fi
! has_tty && DOKKU_QUIET_OUTPUT=1

if [[ $(id -un) != "dokku" ]]; then
unset TMP TMPDIR TEMP TEMPDIR
if [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]] && [[ $1 != "scheduler-k3s:initialize" ]] && [[ $1 != "scheduler-k3s:uninstall" ]]; then
unset DOKKU_PID TMP TMPDIR TEMP TEMPDIR
export SSH_USER=$(id -un)
sudo -u dokku -E -H "$0" "$@"
exit $?
Expand All @@ -106,15 +106,20 @@ fi

if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
export -n SSH_ORIGINAL_COMMAND
if [[ $1 =~ config-* ]] || [[ $1 =~ docker-options* ]]; then
xargs $0 <<<$SSH_ORIGINAL_COMMAND
exit $?
else
exit_code=0
if [[ $1 =~ git-* ]] || [[ $1 =~ git:* ]]; then
set -f
$0 $SSH_ORIGINAL_COMMAND
exit_code=$?
set +f
else
readarray -t -O "${#ssh_arg_array[@]}" ssh_arg_array < <(printf '%s' "$SSH_ORIGINAL_COMMAND" | xargs -n 1)
set -f
$0 "${ssh_arg_array[@]}"
exit_code=$?
set +f
exit $?
fi
exit $exit_code
fi

if ! dokku_auth "$@"; then
Expand Down
4 changes: 4 additions & 0 deletions plugins/00_dokku-standard/subcommands/report
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ cmd-report() {
dokku_log_info1 "uname: $(uname -a)"
dokku_log_info1 "memory: "
free -m | sed "s/^/ /"
dokku_log_info1 "disk utilization: "
df -h --type btrfs --type ext4 --type ext3 --type ext2 --type vfat --type iso9660 | sed "s/^/ /"
dokku_log_info1 "disk inode utilization: "
df -hi --type btrfs --type ext4 --type ext3 --type ext2 --type vfat --type iso9660 | sed "s/^/ /"
dokku_log_info1 "docker version: "
"$DOCKER_BIN" version | sed "s/^/ /"
dokku_log_info1 "docker daemon info: "
Expand Down
10 changes: 3 additions & 7 deletions plugins/20_events/install
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ EOF
cat >"$DOKKU_LOGROTATE_FILE" <<EOF
$DOKKU_LOGS_DIR/*.log {
daily
rotate 7
missingok
notifempty
su syslog dokku
rotate 7
compress
delaycompress
postrotate
reload rsyslog &>/dev/null || true
endscript
create 664 syslog dokku
notifempty
copytruncate
}
EOF

Expand Down
73 changes: 57 additions & 16 deletions plugins/app-json/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ func getPhaseScript(appName string, phase string) (string, error) {
func getReleaseCommand(appName string, image string) string {
processType := "release"
port := "5000"
b, _ := common.PlugnTriggerOutput("procfile-get-command", []string{appName, processType, port}...)
return strings.TrimSpace(string(b[:]))
results, _ := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "procfile-get-command",
Args: []string{appName, processType, port},
})
return results.StdoutContents()
}

func getDokkuAppShell(appName string) string {
Expand All @@ -114,13 +117,19 @@ func getDokkuAppShell(appName string) string {
ctx := context.Background()
errs, ctx := errgroup.WithContext(ctx)
errs.Go(func() error {
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...)
globalShell = strings.TrimSpace(string(b[:]))
results, _ := common.CallPlugnTriggerWithContext(ctx, common.PlugnTriggerInput{
Trigger: "config-get-global",
Args: []string{"DOKKU_APP_SHELL"},
})
globalShell = results.StdoutContents()
return nil
})
errs.Go(func() error {
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...)
appShell = strings.TrimSpace(string(b[:]))
results, _ := common.CallPlugnTriggerWithContext(ctx, common.PlugnTriggerInput{
Trigger: "config-get",
Args: []string{appName, "DOKKU_APP_SHELL"},
})
appShell = results.StdoutContents()
return nil
})

Expand Down Expand Up @@ -204,17 +213,27 @@ func executeScript(appName string, image string, imageTag string, phase string)
}

var dockerArgs []string
if b, err := common.PlugnTriggerSetup("docker-args-deploy", []string{appName, imageTag}...).SetInput("").Output(); err == nil {
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
results, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "docker-args-deploy",
Args: []string{appName, imageTag},
Stdin: strings.NewReader(""),
})
if err == nil {
words, err := shellquote.Split(results.StdoutContents())
if err != nil {
return err
}

dockerArgs = append(dockerArgs, words...)
}

if b, err := common.PlugnTriggerSetup("docker-args-process-deploy", []string{appName, imageSourceType, imageTag}...).SetInput("").Output(); err == nil {
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
results, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "docker-args-process-deploy",
Args: []string{appName, imageSourceType, imageTag},
Stdin: strings.NewReader(""),
})
if err == nil {
words, err := shellquote.Split(results.StdoutContents())
if err != nil {
return err
}
Expand Down Expand Up @@ -398,12 +417,15 @@ func createdContainerID(appName string, dockerArgs []string, image string, comma
arguments = append(arguments, image)
arguments = append(arguments, command...)

b, err := common.PlugnTriggerOutput("config-export", []string{appName, "false", "true", "json"}...)
results, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "config-export",
Args: []string{appName, "false", "true", "json"},
})
if err != nil {
return "", err
}
var env map[string]string
if err := json.Unmarshal(b, &env); err != nil {
if err := json.Unmarshal(results.StdoutBytes(), &env); err != nil {
return "", err
}

Expand All @@ -420,7 +442,11 @@ func createdContainerID(appName string, dockerArgs []string, image string, comma
}

containerID := result.StdoutContents()
err = common.PlugnTrigger("post-container-create", []string{"app", containerID, appName, phase}...)
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "post-container-create",
Args: []string{"app", containerID, appName, phase},
StreamStdio: true,
})
return containerID, err
}

Expand All @@ -440,12 +466,27 @@ func setScale(appName string, image string) error {
}

if len(args) == 3 {
return common.PlugnTrigger("ps-can-scale", []string{appName, "true"}...)
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "ps-can-scale",
Args: []string{appName, "true"},
StreamStdio: true,
})
return err
}

if err := common.PlugnTrigger("ps-can-scale", []string{appName, "false"}...); err != nil {
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "ps-can-scale",
Args: []string{appName, "false"},
StreamStdio: true,
})
if err != nil {
return err
}

return common.PlugnTrigger("ps-set-scale", args...)
_, err = common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "ps-set-scale",
Args: args,
StreamStdio: true,
})
return err
}
2 changes: 0 additions & 2 deletions plugins/app-json/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ require (

require (
github.com/alexellis/go-execute/v2 v2.2.1 // indirect
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand Down
4 changes: 0 additions & 4 deletions plugins/app-json/go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
github.com/alexellis/go-execute/v2 v2.2.1 h1:4Ye3jiCKQarstODOEmqDSRCqxMHLkC92Bhse743RdOI=
github.com/alexellis/go-execute/v2 v2.2.1/go.mod h1:FMdRnUTiFAmYXcv23txrp3VYZfLo24nMpiIneWgKHTQ=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4quafGxDT9LDasjGdlGkzLbfmmrlng3kA=
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
Loading