Compare commits
94 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61af5971d5 | ||
|
|
acc206fca7 | ||
|
|
59a81ad3be | ||
|
|
d7b23b84f0 | ||
|
|
3d77de20cc | ||
|
|
365356eb5f | ||
|
|
044cc4a618 | ||
|
|
09541f8aac | ||
|
|
4d0979bbcd | ||
|
|
dba4bb9c2c | ||
|
|
2e4c886ab2 | ||
|
|
dd1962f92d | ||
|
|
1439e8b30b | ||
|
|
8240790381 | ||
|
|
0050aa6b92 | ||
|
|
f53b26f3f0 | ||
|
|
57a9a11ab3 | ||
|
|
a6a0e033a7 | ||
|
|
18492ac83c | ||
|
|
13dd8aa224 | ||
|
|
574304486a | ||
|
|
90feb8dc96 | ||
|
|
7bc241dd48 | ||
|
|
57b884e7c7 | ||
|
|
3ba775d4b3 | ||
|
|
89d6f0eb6e | ||
|
|
465e220315 | ||
|
|
1b767e7632 | ||
|
|
b3304337ca | ||
|
|
40e7f6d15b | ||
|
|
c95659d57d | ||
|
|
a1e7b99b26 | ||
|
|
52f1f2495c | ||
|
|
112ee88fe9 | ||
|
|
2ff06ff4c7 | ||
|
|
df289be994 | ||
|
|
ae76e8784c | ||
|
|
d537cb70cd | ||
|
|
4a70f0bea2 | ||
|
|
e51165d915 | ||
|
|
d10d4cc55c | ||
|
|
2301efa460 | ||
|
|
d00284166f | ||
|
|
f279ce44b2 | ||
|
|
36215828f1 | ||
|
|
0623af86d6 | ||
|
|
c6976499ad | ||
|
|
01bd69100c | ||
|
|
541d73ad93 | ||
|
|
6b159c32cf | ||
|
|
5f2968d1b0 | ||
|
|
0e768d107a | ||
|
|
3557ff16dc | ||
|
|
30131ef363 | ||
|
|
946c424734 | ||
|
|
f42b293836 | ||
|
|
b691c0affc | ||
|
|
48fa04a05b | ||
|
|
8c14bb9aeb | ||
|
|
ca2de6a4a3 | ||
|
|
755499797e | ||
|
|
f2a3cfc0b4 | ||
|
|
a42786a465 | ||
|
|
de0a467c97 | ||
|
|
ab23a4b6f1 | ||
|
|
87aed0eadf | ||
|
|
9a86549359 | ||
|
|
2eeb0069d5 | ||
|
|
f536a05e06 | ||
|
|
26b95854d4 | ||
|
|
775432c73f | ||
|
|
84ee5995f4 | ||
|
|
91e9bb9670 | ||
|
|
c6a8bd669f | ||
|
|
d9d0a932b0 | ||
|
|
a91d45c397 | ||
|
|
98c81513aa | ||
|
|
a7e5f2abdc | ||
|
|
0aa0c884d3 | ||
|
|
dfa39fc590 | ||
|
|
cbd442fc2e | ||
|
|
ebd2778f5b | ||
|
|
5887d4ddfa | ||
|
|
36e9b4b2ae | ||
|
|
81d31c9934 | ||
|
|
4aaefb0c4c | ||
|
|
6aac1ea0d1 | ||
|
|
bd275d9b5d | ||
|
|
8c0dbc7d6a | ||
|
|
07194ca17f | ||
|
|
325c6d44dd | ||
|
|
168ed1716c | ||
|
|
3de8c3002a | ||
|
|
1cbbfb195f |
@@ -84,7 +84,9 @@ jobs:
|
||||
- run:
|
||||
name: run bats tests
|
||||
command: |
|
||||
sudo -E make -e test-ci
|
||||
if ! sudo -E make -e test-ci; then
|
||||
sudo -E make tests-ci-retry-failed
|
||||
fi
|
||||
no_output_timeout: 60m
|
||||
shell: /bin/bash
|
||||
- run:
|
||||
|
||||
20
.github/workflows/bump-formula.yml
vendored
Normal file
20
.github/workflows/bump-formula.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: bump-formula
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
bump-formula:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Bump Brew
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
brew tap dokku/repo
|
||||
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku
|
||||
102
HISTORY.md
102
HISTORY.md
@@ -1,5 +1,107 @@
|
||||
# History
|
||||
|
||||
## 0.22.3
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4268: @josegonzalez Properly parse flags for logs command
|
||||
- #4264: @josegonzalez Correct argument handling when setting the `--app` flag
|
||||
- #4252: @magikid Allow symbolic links for certificate and key files
|
||||
|
||||
### New Features
|
||||
|
||||
- #4270: @josegonzalez Allow renaming old applications to new format
|
||||
- #4261: @josegonzalez Add remove by fingerprint and json format output to ssh-keys plugin
|
||||
- #4262: @josegonzalez Improve ps:restore logging
|
||||
- #4263: @josegonzalez Bump the dokku client formula on release
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4253: @guettli Highlight the default build method used by Dokku
|
||||
- #4250: @rlnd1 Update upgrading.md
|
||||
- #4249: @guettli Fix typo in zero downtime docs
|
||||
- #4247: @josegonzalez Clarify the domain name setting in the docs
|
||||
|
||||
### Tests
|
||||
|
||||
- #4269: @josegonzalez Rename duplicate test
|
||||
- #4266: @josegonzalez Update junit test files when a bats retry is successful
|
||||
- #4265: @josegonzalez Retry failing and skipped tests once
|
||||
|
||||
## 0.22.2
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4243: @josegonzalez Do not delete app when the app name is invalid
|
||||
|
||||
### New Features
|
||||
|
||||
- #4141: @josegonzalez Always initialize git repository
|
||||
|
||||
### Other
|
||||
|
||||
- #4244: @dependabot-preview[bot] chore(deps): bump monolog/monolog from 1.25.5 to 1.26.0 in /tests/apps/php
|
||||
|
||||
## 0.22.1
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.1/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.1 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4238: @josegonzalez Ensure dead files are created for docker object retirement
|
||||
- #4239: @josegonzalez Ensure all byte output is trimmed of whitespace
|
||||
- #4228: @Cellane Fix tags:deploy command for images that contain ONBUILD directive
|
||||
- #4233: @josegonzalez Properly parse releease command when there is an entrypoint
|
||||
- #4215: @josegonzalez Implement missing cleanup routines
|
||||
- #4212: @josegonzalez Cleanup docker options during post-delete
|
||||
- #4211: @ml-milan-vit Make the dokku-update command compatible with Dokku 0.22+
|
||||
|
||||
### New Features
|
||||
|
||||
- #4242: @josegonzalez Remove reference to 'whitelist'
|
||||
- #4220: @josegonzalez Update plugn from 0.5.0 to 0.5.1
|
||||
- #4241: @josegonzalez Properly handle stdout when capturing plugn output
|
||||
- #4237: @josegonzalez Release dokku-update 0.2.0
|
||||
- #4225: @znz Accept first pushed branch as deploy-branch
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4236: @josegonzalez Remove note regarding not having an official client
|
||||
- #4234: @josegonzalez Switch to bats --filter for running a single test
|
||||
- #4222: @leopolicastro Fix typo in deployment tasks documentation
|
||||
- #4221: @srr013 Updating readme for clarity on git push step
|
||||
- #4214: @josegonzalez Expand backup and restore documentation
|
||||
- #4213: @josegonzalez Enhance the 'plugin' plugin documentation
|
||||
|
||||
### Tests
|
||||
|
||||
- #4218: @josegonzalez Enable compilation cache
|
||||
|
||||
### Other
|
||||
|
||||
- #4230: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 186 to 187 in /tests/apps/php
|
||||
- #4223: @dependabot-preview[bot] chore(deps): bump jetty-servlet from 9.4.35.v20201120 to 11.0.0 in /tests/apps/java
|
||||
- #4224: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 185 to 186 in /tests/apps/php
|
||||
|
||||
## 0.22.0
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
4
Makefile
4
Makefile
@@ -2,9 +2,9 @@ DOKKU_VERSION ?= master
|
||||
|
||||
HEROKUISH_VERSION ?= 0.5.19
|
||||
PROCFILE_VERSION ?= 0.11.0
|
||||
PLUGN_VERSION ?= 0.5.0
|
||||
PLUGN_VERSION ?= 0.5.1
|
||||
SIGIL_VERSION ?= 0.6.0
|
||||
SSHCOMMAND_VERSION ?= 0.11.0
|
||||
SSHCOMMAND_VERSION ?= 0.12.0
|
||||
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
|
||||
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
|
||||
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz
|
||||
|
||||
@@ -99,8 +99,8 @@ Otherwise, you will need to import the keypair manually after installation using
|
||||
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.0/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.0 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
GO_ARGS ?= -a
|
||||
GO_ARGS ?=
|
||||
GO_PLUGIN_MAKE_TARGET ?= build
|
||||
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
|
||||
BUILD_IMAGE := golang:1.14.4
|
||||
|
||||
@@ -15,7 +15,7 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.22.0'
|
||||
VERSION = 'v0.22.3'
|
||||
|
||||
def bytes_to_string(b):
|
||||
if type(b) == bytes:
|
||||
|
||||
@@ -101,7 +101,7 @@ main() {
|
||||
|
||||
# rebuild all applications
|
||||
dokku-log-info "Rebuilding all applications"
|
||||
dokku ps:rebuildall
|
||||
dokku ps:rebuild --all
|
||||
|
||||
dokku-log-info "Waiting for old containers to stop"
|
||||
sleep 120
|
||||
|
||||
@@ -72,6 +72,9 @@ main() {
|
||||
skip=false
|
||||
continue
|
||||
fi
|
||||
is_flag=false
|
||||
|
||||
[[ "$arg" =~ ^--.* ]] && is_flag=true
|
||||
|
||||
if [[ "$arg" == "--app" ]]; then
|
||||
APP=${args[$next_index]}
|
||||
@@ -82,10 +85,10 @@ main() {
|
||||
skip=true
|
||||
shift 2
|
||||
elif [[ "$arg" =~ ^--.* ]]; then
|
||||
[[ "$cmd_set" == "true" ]] && APP_ARG="$arg" && break
|
||||
[[ "$cmd_set" == "true" ]] && [[ "$is_flag" == "false" ]] && APP_ARG="$arg" && break
|
||||
[[ "$arg" == "--trace" ]] && export DOKKU_TRACE=1 && set -x
|
||||
else
|
||||
if [[ "$cmd_set" == "true" ]]; then
|
||||
if [[ "$cmd_set" == "true" ]] && [[ "$is_flag" == "false" ]]; then
|
||||
APP_ARG="$arg"
|
||||
break
|
||||
else
|
||||
@@ -110,7 +113,7 @@ main() {
|
||||
|
||||
case "$CMD" in
|
||||
apps:create)
|
||||
if [[ -z "$APP_ARG" ]]; then
|
||||
if [[ -z "$APP" ]] && [[ -z "$APP_ARG" ]]; then
|
||||
APP=$(fn-random-name)
|
||||
counter=0
|
||||
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null | grep -q "$APP"; do
|
||||
@@ -123,7 +126,7 @@ main() {
|
||||
counter=$((counter + 1))
|
||||
fi
|
||||
done
|
||||
else
|
||||
elif [[ -z "$APP" ]]; then
|
||||
APP="$APP_ARG"
|
||||
fi
|
||||
if git remote add "$DOKKU_GIT_REMOTE" "dokku@$DOKKU_REMOTE_HOST:$APP"; then
|
||||
|
||||
2
deb.mk
2
deb.mk
@@ -6,7 +6,7 @@ DOKKU_ARCHITECTURE = amd64
|
||||
|
||||
DOKKU_UPDATE_DESCRIPTION = 'Binary that handles updating Dokku and related systems'
|
||||
DOKKU_UPDATE_REPO_NAME ?= dokku/dokku
|
||||
DOKKU_UPDATE_VERSION ?= 0.1.0
|
||||
DOKKU_UPDATE_VERSION ?= 0.2.0
|
||||
DOKKU_UPDATE_ARCHITECTURE = amd64
|
||||
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb
|
||||
|
||||
|
||||
4
debian/control
vendored
4
debian/control
vendored
@@ -1,9 +1,9 @@
|
||||
Package: dokku
|
||||
Version: 0.22.0
|
||||
Version: 0.22.3
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.10.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
Recommends: herokuish (>= 0.3.4), parallel, dokku-update, dokku-event-listener
|
||||
Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
|
||||
@@ -2,7 +2,51 @@
|
||||
|
||||
> The backup plugin was deprecated in 0.4.x, below are backup recommendations for 0.5.x and later.
|
||||
|
||||
## Backup and Migration Tutorial
|
||||
The best plan for disaster recovery is to always keep multiple (remote) copies of your local repo, static assets and periodic database dumps. Backups should be regularly tested for data integrity and completeness.
|
||||
|
||||
## TLDR
|
||||
|
||||
> Warning: This method has many caveats. Please read this entire document before assuming these backups work as expected, and test your backups on a regular basis.
|
||||
|
||||
### Creating a backup
|
||||
|
||||
To create a backup, run the following command at a time when not executing any Dokku commands or app deployments:
|
||||
|
||||
```shell
|
||||
export BACKUP_TIME=$(date +%Y-%m-%d-%H-%M)
|
||||
sudo mkdir -p /var/lib/dokku/services
|
||||
sudo chown dokku:dokku /var/lib/dokku/services
|
||||
mkdir -p /tmp/dokku-backups/
|
||||
sudo tar -czvf "/tmp/dokku-backups/${BACKUP_TIME}.tar.gz" /home/dokku /var/lib/dokku/config /var/lib/dokku/data /var/lib/dokku/services /var/lib/dokku/plugins
|
||||
```
|
||||
|
||||
This will create a point-in-time backup of your entire Dokku installation in the `/tmp/dokku-backups` directory. This backup may be moved offsite to another location via rsync, sftp, or some other protocol.
|
||||
|
||||
It is recommended that backups are regularly cleaned from the originating server and tested as necessary.
|
||||
|
||||
### Restoring a backup
|
||||
|
||||
To extract the backup onto another server, copy the backup to the server and extract it using the following command.
|
||||
|
||||
```shell
|
||||
sudo tar -xzvf path/to/dokku/backup.tar.gz -C /
|
||||
```
|
||||
|
||||
At this point, all datastores should be individually started and checked for data integrity. Once this is complete, individual applications can be rebuilt. Please consult the [process management documentation](/docs/deployment/process-management.md#rebuilding-apps) for more information on how to rebuild applications.
|
||||
|
||||
## Caveats
|
||||
|
||||
### App config
|
||||
|
||||
Application config is largely held in a small number of places:
|
||||
|
||||
- `/var/lib/dokku/config`: Properties set and managed by plugins
|
||||
- `/var/lib/dokku/data`: Files generated or extracted by various plugins
|
||||
- `/home/dokku`: Certain parts of Dokku core store data in this location
|
||||
|
||||
Compressing these directories when no Dokku commands are running is enough to ensure a complete backup of the system.
|
||||
|
||||
### Code Repositories
|
||||
|
||||
Because Dokku is git based, rebuilding a deployed app is as easy as pushing from git. You can push to a new server by updating the `dokku` remote in you local app's repo.
|
||||
|
||||
@@ -11,7 +55,14 @@ git remote rm dokku
|
||||
git remote add dokku dokku@[dokku.me:dokku.me]
|
||||
git push dokku [master]
|
||||
```
|
||||
## Databases
|
||||
|
||||
### Docker Image and Tar-based Apps
|
||||
|
||||
These applications may fail to rebuild via the normal `ps:rebuild` method. Redeploy these apps by running the original commands used to deploy them
|
||||
|
||||
### Datastores
|
||||
|
||||
> Please note that point-in-time backups of the `/var/lib/dokku/services` directory may contain partially written data due to how various datastores work. Consult the official datastore documentation for the best documentation surrounding proper backup and restore procedures.
|
||||
|
||||
Some plugins, like the official [dokku-postgres](https://github.com/dokku/dokku-postgres) plugin, have built-in commands that allow non-volatile data be exported and imported.
|
||||
|
||||
@@ -22,15 +73,26 @@ dokku postgres:export [db_name] > [db_name].dump
|
||||
dokku postgres:import [db_name] < [db_name].dump
|
||||
```
|
||||
|
||||
## Volumes and Static Assets
|
||||
Additionally, data for official datastores is located in the `/var/lib/dokku/services` directory. If the directory is restored and the plugin is available, a `dokku $SERVICE:start` may be enough to restart the service with the underlying data, so long as the datastore version does not change and the underlying data is not corrupt. If this is the case, it may be necessary to re-import all the data onto a fresh version of the datastore service.
|
||||
|
||||
### Plugins
|
||||
|
||||
The plugin directory is contained at the `/var/lib/dokku/plugins` directory. Core plugins will automatically be included in new installs, but custom plugins may not. The aforementioned `tar` creation command will back all plugins up, and the `tar` extract command will restore the plugins.
|
||||
|
||||
Note that restoring a plugin will not trigger any `install` or `dependencies` triggers. You will need to run these manually. See the [plugin management documentation](/docs/advanced-usage/plugin-management.md#installing-a-plugin) for more information on how to trigger these two hooks.
|
||||
|
||||
|
||||
### Volumes and Static Assets
|
||||
|
||||
Dokku doesn't enforce a [300mb](https://devcenter.heroku.com/articles/slug-compiler#slug-size) limit on apps, but it's best practice to keep binary assets outside of git. Since containers are considered volatile in Dokku, external stores like s3 or storage mounts should be used for non-volatile items like user uploads. The Dokku storage core plugin can be used to mount local directories / volumes inside the docker container.
|
||||
|
||||
System administrators are highly encouraged to store persistent data in app-specific subdirectories of the path `/var/lib/dokku/data/storage`. This will help ensure restores of the aforementioned primary Dokku directories will restore service to all apps.
|
||||
|
||||
See the [persistent storage documentation](/docs/advanced-usage/persistent-storage.md) for more information on how to attach persistent storage to your application.
|
||||
|
||||
## Disaster Recovery
|
||||
## Recovering app code
|
||||
|
||||
The best plan for disaster recovery is to always keep multiple (remote) copies of your local repo, static assets and periodic database dumps. In case of an emergency when your git repo and backups are completely lost, you can recover the last pushed copy from your remote Dokku server (assuming you still have the ssh key).
|
||||
In case of an emergency when your git repo and backups are completely lost, you can recover the last pushed copy from your remote Dokku server (assuming you still have the ssh key).
|
||||
|
||||
```shell
|
||||
mkdir [app-name] ; cd !$
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> New as of 0.5.0
|
||||
|
||||
Sometimes you need to run a command on at deployment time, but before an app is completely deployed. Common use cases include:
|
||||
Sometimes you need to run a command on deployment time, but before an app is completely deployed. Common use cases include:
|
||||
|
||||
* Checking a database is initialized
|
||||
* Running database migrations
|
||||
|
||||
@@ -25,7 +25,9 @@ dokku plugins-install
|
||||
|
||||
## Usage
|
||||
|
||||
You can list all installed plugins using the `plugin:list` command:
|
||||
### Listing Plugins
|
||||
|
||||
Installed plugins can be listed via the `plugin:list` command:
|
||||
|
||||
```shell
|
||||
dokku plugin:list
|
||||
@@ -33,45 +35,60 @@ dokku plugin:list
|
||||
|
||||
```
|
||||
plugn: dev
|
||||
00_dokku-standard 0.22.0 enabled dokku core standard plugin
|
||||
20_events 0.22.0 enabled dokku core events logging plugin
|
||||
app-json 0.22.0 enabled dokku core app-json plugin
|
||||
apps 0.22.0 enabled dokku core apps plugin
|
||||
build-env 0.22.0 enabled dokku core build-env plugin
|
||||
buildpacks 0.22.0 enabled dokku core buildpacks plugin
|
||||
certs 0.22.0 enabled dokku core certificate management plugin
|
||||
checks 0.22.0 enabled dokku core checks plugin
|
||||
common 0.22.0 enabled dokku core common plugin
|
||||
config 0.22.0 enabled dokku core config plugin
|
||||
docker-options 0.22.0 enabled dokku core docker-options plugin
|
||||
domains 0.22.0 enabled dokku core domains plugin
|
||||
enter 0.22.0 enabled dokku core enter plugin
|
||||
git 0.22.0 enabled dokku core git plugin
|
||||
logs 0.22.0 enabled dokku core logs plugin
|
||||
network 0.22.0 enabled dokku core network plugin
|
||||
nginx-vhosts 0.22.0 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.22.0 enabled dokku core plugin plugin
|
||||
proxy 0.22.0 enabled dokku core proxy plugin
|
||||
ps 0.22.0 enabled dokku core ps plugin
|
||||
repo 0.22.0 enabled dokku core repo plugin
|
||||
resource 0.22.0 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.22.0 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.22.0 enabled dokku core shell plugin
|
||||
ssh-keys 0.22.0 enabled dokku core ssh-keys plugin
|
||||
storage 0.22.0 enabled dokku core storage plugin
|
||||
tags 0.22.0 enabled dokku core tags plugin
|
||||
tar 0.22.0 enabled dokku core tar plugin
|
||||
trace 0.22.0 enabled dokku core trace plugin
|
||||
00_dokku-standard 0.22.3 enabled dokku core standard plugin
|
||||
20_events 0.22.3 enabled dokku core events logging plugin
|
||||
app-json 0.22.3 enabled dokku core app-json plugin
|
||||
apps 0.22.3 enabled dokku core apps plugin
|
||||
build-env 0.22.3 enabled dokku core build-env plugin
|
||||
buildpacks 0.22.3 enabled dokku core buildpacks plugin
|
||||
certs 0.22.3 enabled dokku core certificate management plugin
|
||||
checks 0.22.3 enabled dokku core checks plugin
|
||||
common 0.22.3 enabled dokku core common plugin
|
||||
config 0.22.3 enabled dokku core config plugin
|
||||
docker-options 0.22.3 enabled dokku core docker-options plugin
|
||||
domains 0.22.3 enabled dokku core domains plugin
|
||||
enter 0.22.3 enabled dokku core enter plugin
|
||||
git 0.22.3 enabled dokku core git plugin
|
||||
logs 0.22.3 enabled dokku core logs plugin
|
||||
network 0.22.3 enabled dokku core network plugin
|
||||
nginx-vhosts 0.22.3 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.22.3 enabled dokku core plugin plugin
|
||||
proxy 0.22.3 enabled dokku core proxy plugin
|
||||
ps 0.22.3 enabled dokku core ps plugin
|
||||
repo 0.22.3 enabled dokku core repo plugin
|
||||
resource 0.22.3 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.22.3 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.22.3 enabled dokku core shell plugin
|
||||
ssh-keys 0.22.3 enabled dokku core ssh-keys plugin
|
||||
storage 0.22.3 enabled dokku core storage plugin
|
||||
tags 0.22.3 enabled dokku core tags plugin
|
||||
tar 0.22.3 enabled dokku core tar plugin
|
||||
trace 0.22.3 enabled dokku core trace plugin
|
||||
```
|
||||
|
||||
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.
|
||||
|
||||
### Checking if a plugin is installed
|
||||
|
||||
You can check if a plugin has been installed via the `plugin:installed` command:
|
||||
|
||||
```shell
|
||||
dokku plugin:installed postgres
|
||||
```
|
||||
|
||||
### Installing a plugin
|
||||
|
||||
Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins.
|
||||
|
||||
The most common usage is to install a plugin from a url. This url may be any of the following:
|
||||
|
||||
- `git`: For git+ssh based plugin repository clones.
|
||||
- `ssh`: For git+ssh based plugin repository clones.
|
||||
- `file`: For copying plugins from a path on disk.
|
||||
- `https`: For http based plugin repository clones.
|
||||
|
||||
Additionally, any urls with the extensions `.tar.gz` or `.tgz` are treated as Gzipped Tarballs for installation purposes and will be downloaded and extracted into place.
|
||||
|
||||
```shell
|
||||
dokku plugin:install https://github.com/dokku/dokku-postgres.git
|
||||
```
|
||||
@@ -87,7 +104,68 @@ Checking connectivity... done.
|
||||
-----> Plugin postgres enabled
|
||||
```
|
||||
|
||||
You can also uninstall a third-party plugin using the `plugin:uninstall` command:
|
||||
For git-based plugin installation, a commit SHA-like object may be specified (tag/branch/commit sha) via the `--committish` argument and Dokku will attempt to install the specified commit object.
|
||||
|
||||
```shell
|
||||
# where 2.0.0 is a potential git tag
|
||||
dokku plugin:install https://github.com/dokku/dokku-postgres.git --committish 2.0.0
|
||||
```
|
||||
|
||||
Plugin names are interpolated based on the repository name minus the `dokku-` prefix. If the plugin being installed has a name other than what matches the repository name - or another name is desired - the `--name` flag can be used to override this interpolation.
|
||||
|
||||
```shell
|
||||
dokku plugin:install https://github.com/dokku/smoke-test-plugin.git --name smoke-test-plugin
|
||||
```
|
||||
|
||||
The `--core` flag may also be indicated as the sole argument, though it is only for installation of core plugins, and thus not useful for end-user installations.
|
||||
|
||||
```shell
|
||||
dokku plugin:install --core
|
||||
```
|
||||
|
||||
Finally, all flags may be omitted to trigger the `install` procedures for both core and third-party plugins:
|
||||
|
||||
```shell
|
||||
dokku plugin:install
|
||||
```
|
||||
|
||||
### Installing plugin dependencies
|
||||
|
||||
In some cases, plugins will have system-level dependencies. These are not automatically installed via `plugin:install`, and must be separately via the `plugin:install-dependencies` command. This will run through all the `dependencies` trigger for all plugins.
|
||||
|
||||
```shell
|
||||
dokku plugin:install-dependencies
|
||||
```
|
||||
|
||||
This command may also target _just_ core plugins via the `--core` flag. This is usually only useful for source-based installs of Dokku.
|
||||
|
||||
```shell
|
||||
dokku plugin:install-dependencies --core
|
||||
```
|
||||
|
||||
### Updating a plugin
|
||||
|
||||
An installed, third-party plugin can be updated can updated via the `plugin:update` command. This should be done after any upgrades of Dokku as there may be changes in the internal api that require an update of how the plugin interfaces with Dokku.
|
||||
|
||||
Please note that this command is only valid for plugin installs that were backed by a git-repository.
|
||||
|
||||
```shell
|
||||
dokku plugin:update postgres
|
||||
```
|
||||
|
||||
```
|
||||
Plugin (postgres) updated
|
||||
```
|
||||
|
||||
An optional commit SHA-like object may be specified.
|
||||
|
||||
```shell
|
||||
dokku plugin:update postgres 2.0.0
|
||||
```
|
||||
|
||||
### Uninstalling a plugin
|
||||
|
||||
Third party plugins can be uninstalled using the `plugin:uninstall` command:
|
||||
|
||||
```shell
|
||||
dokku plugin:uninstall postgres
|
||||
@@ -97,7 +175,9 @@ dokku plugin:uninstall postgres
|
||||
-----> Plugin postgres uninstalled
|
||||
```
|
||||
|
||||
Enabling or disabling a plugin can also be useful in cases where you are debugging whether a third-party plugin is causing issues in your Dokku installation:
|
||||
### Disabling a plugin
|
||||
|
||||
Disabling a plugin can also be useful for debugging whether a third-party plugin is causing issues in a Dokku installation. Another common use case is for disabling core functionality for replacement with a third-party plugin.
|
||||
|
||||
```shell
|
||||
dokku plugin:disable postgres
|
||||
@@ -107,6 +187,10 @@ dokku plugin:disable postgres
|
||||
-----> Plugin postgres disabled
|
||||
```
|
||||
|
||||
### Enabling a plugin
|
||||
|
||||
Disabled plugins can be re-enabled via the `plugin:enable` command.
|
||||
|
||||
```shell
|
||||
dokku plugin:enable postgres
|
||||
```
|
||||
@@ -115,12 +199,10 @@ dokku plugin:enable postgres
|
||||
-----> Plugin postgres enabled
|
||||
```
|
||||
|
||||
Finally, you can update an installed third-party plugin. This should be done after any upgrades of Dokku as there may be changes in the internal api that require an update of how the plugin interfaces with Dokku.
|
||||
### Triggering a plugin trigger
|
||||
|
||||
The `plugin:trigger` can be used to call any internal plugin trigger. This may have unintended consequences, and thus should only be called for development or debugging purposes.
|
||||
|
||||
```shell
|
||||
dokku plugin:update postgres
|
||||
```
|
||||
|
||||
```
|
||||
Plugin (postgres) updated
|
||||
dokku plugin:trigger some-internal-trigger args-go-here
|
||||
```
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
"name": "Dokku",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.0\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
@@ -39,13 +39,13 @@ h1 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
.header .navbar-brand a {
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/dokku.png);
|
||||
text-indent: 40px;
|
||||
}
|
||||
.blurb {
|
||||
color: #424242;
|
||||
background-color: #ededed;
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
"0.19.13",
|
||||
"0.20.4",
|
||||
"0.21.4",
|
||||
"0.22.0"
|
||||
"0.22.3"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Given the constraints, running Dokku commands remotely via SSH is fine. For certain configurations, the extra complication of manually invoking ssh can be a burden.
|
||||
|
||||
While Dokku does not yet have an official client, there are a multitude of ways in which you can interact with your Dokku installation. The easiest is to use the **bash** client, though you may wish to use another.
|
||||
The easiest way to interact with Dokku remotely is by using the official client. Documented below are the various clients that you may wish to use.
|
||||
|
||||
## Official Client
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Deploying to Dokku
|
||||
|
||||
> Note: This walkthrough uses the hostname `dokku.me` in commands. When deploying to your own server, you should set the `DOKKU_DOMAIN` value in the `Vagrantfile` before you initialize the Vagrant VM.
|
||||
> Note: This walkthrough uses the hostname `dokku.me` in commands. When deploying to your own server, you should substitute the domain `dokku.me` for the domain name or IP address associated with your server. Users of the Vagrant VM included with Dokku can use `dokku.me` which points to the IP of the VM.
|
||||
|
||||
## Deploy tutorial
|
||||
|
||||
@@ -103,6 +103,7 @@ Once the deploy is complete, the application's web URL will be generated as abov
|
||||
Dokku supports deploying applications in a few ways:
|
||||
|
||||
- [Heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) via [Herokuish](https://github.com/gliderlabs/herokuish#buildpacks): See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) to learn about the different ways to specify a buildpack.
|
||||
- This is the default method used by Dokku.
|
||||
- [Dockerfile](https://docs.docker.com/reference/builder/): See the [dockerfile documentation](/docs/deployment/methods/dockerfiles.md) to learn about the different ways to configure Dockerfile-based deploys.
|
||||
- [Docker Image](https://docs.docker.com/get-started/overview/#docker-objects): See the [docker image documentation](/docs/deployment/methods/images.md) to learn about how to deploy a Docker Image.
|
||||
|
||||
@@ -146,6 +147,7 @@ If you do not enter a fully qualified domain name when pushing your app, Dokku d
|
||||
```shell
|
||||
# from your local machine
|
||||
# the remote username *must* be dokku or pushes will fail
|
||||
# the below example assumes your app server domain or IP is dokku.me. Push in the form of: dokku@{serveripordomain}:{dokkuappname}
|
||||
git remote add dokku dokku@dokku.me:ruby-getting-started
|
||||
git push dokku main:master
|
||||
```
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
> New as of 0.7.0
|
||||
|
||||
```
|
||||
ssh-keys:add <name> [/path/to/key] # Add a new public key by pipe or path
|
||||
ssh-keys:list [<name>] # List of all authorized Dokku public ssh keys
|
||||
ssh-keys:remove <name> # Remove SSH public key by name
|
||||
ssh-keys:add <name> [/path/to/key] # Add a new public key by pipe or path
|
||||
ssh-keys:list [--format text|json] [<name>] # List of all authorized Dokku public ssh keys
|
||||
ssh-keys:remove [--fingerprint fingerprint|<name>] # Remove SSH public key by name
|
||||
```
|
||||
|
||||
When pushing to Dokku, SSH key-based authorization is the preferred authentication method, for ease of use and increased security.
|
||||
@@ -42,6 +42,20 @@ The keys for a specific user may be listed by specifying a second argument to th
|
||||
dokku ssh-keys:list admin
|
||||
```
|
||||
|
||||
> 0.22.3
|
||||
|
||||
The output format may be specified via the `--format` flag. Supported values include `json` and `text`.
|
||||
|
||||
```shell
|
||||
dokku ssh-keys:list --format json
|
||||
```
|
||||
|
||||
This can additionally be used to filter to keys for a particular user:
|
||||
|
||||
```shell
|
||||
dokku ssh-keys:list --format json admin
|
||||
```
|
||||
|
||||
### Adding SSH keys
|
||||
|
||||
You can add your public key to Dokku with the `ssh-keys:add` command. The output will be the fingerprint of the SSH key:
|
||||
@@ -74,10 +88,16 @@ cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
|
||||
|
||||
As key names are unique, they can be used to remove a public SSH key.
|
||||
|
||||
```SHELL
|
||||
```shell
|
||||
dokku ssh-keys:remove KEY_NAME
|
||||
```
|
||||
|
||||
An SSH Key can also be removed by fingerprint.
|
||||
|
||||
```shell
|
||||
dokku ssh-keys:remove --fingerprint FINGERPRINT
|
||||
```
|
||||
|
||||
## Scoping commands to specific users
|
||||
|
||||
Support for scoping commands to specific users can be added through plugins that take advantage of the [user-auth](/docs/development/plugin-triggers.md#user-auth) plugin trigger to handle command authorization.
|
||||
|
||||
@@ -10,7 +10,7 @@ checks:run <app> [process-type(s)] Runs zero-downtime checks for all proce
|
||||
checks:skip <app> [process-type(s)] Skip zero-downtime checks for all processes (or comma-separated process-type list)
|
||||
```
|
||||
|
||||
By default, Dokku will wait `10` seconds after starting each container before assuming it is up and proceeding with the deploy. Once this has occurred for all containers started by for an application, traffic will be switched to point to your new containers. Dokku will also wait a further `60` seconds *after* the deploy is complete before terminating old containers in order to give time for long running connections to terminate. In either case, you may have more than one container running for a given application.
|
||||
By default, Dokku will wait `10` seconds after starting each container before assuming it is up and proceeding with the deploy. Once this has occurred for all containers started by an application, traffic will be switched to point to your new containers. Dokku will also wait a further `60` seconds *after* the deploy is complete before terminating old containers in order to give time for long running connections to terminate. In either case, you may have more than one container running for a given application.
|
||||
|
||||
You may both create user-defined checks for web processes using a `CHECKS` file, as well as customize any and all parts of this experience using the checks plugin.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ The workflow looks like this:
|
||||
```shell
|
||||
# having dokku-arch in ../dokku-arch
|
||||
vagrant up build-arch
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.22.0-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.22.3-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
cd ../dokku-arch
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m 'Update to dokku 0.9.9'
|
||||
|
||||
@@ -75,20 +75,14 @@ bats tests/unit/10_apps.bats tests/unit/10_certs.bats
|
||||
|
||||
In order to increase testing velocity, a wrapper script around Bats is available that can be used to run a single test case within a suite.
|
||||
|
||||
Tests within a suite may be listed by specifying the suite as a parameter to the `tests/bats-exec-test-single` script.
|
||||
Tests within a suite may be listed by specifying the suite as a parameter to `bats`.
|
||||
|
||||
```shell
|
||||
tests/bats-exec-test-single tests/unit/10_apps.bats
|
||||
bats tests/unit/10_apps.bats
|
||||
```
|
||||
|
||||
A single test can be specified as a second parameter. The test is selected by fuzzy-match, and only the first match is executed.
|
||||
A single test can be specified via the `--filter` argument. The tests are selected via regex match, and all matches are executed.
|
||||
|
||||
```shell
|
||||
tests/bats-exec-test-single tests/unit/10_apps.bats clone
|
||||
```
|
||||
|
||||
Some special characters are translated in the test listing, specifically the characters `( ) :`, while others are not. The fuzzy matching happens on test names as listed by this script, so executing a test with a more specific name will work as expected.
|
||||
|
||||
```shell
|
||||
tests/bats-exec-test-single tests/unit/10_apps.bats clone_-2d-2dskip-2ddeploy
|
||||
bats --filter clone tests/unit/10_apps.bats
|
||||
```
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Pull the dokku/dokku image:
|
||||
|
||||
```shell
|
||||
docker pull dokku/dokku:0.22.0
|
||||
docker pull dokku/dokku:0.22.3
|
||||
```
|
||||
|
||||
Next, run the image.
|
||||
@@ -17,7 +17,7 @@ docker run \
|
||||
--publish 8443:443 \
|
||||
--volume /var/lib/dokku:/mnt/dokku \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
dokku/dokku:0.22.0
|
||||
dokku/dokku:0.22.3
|
||||
```
|
||||
|
||||
Dokku is run in the following configuration:
|
||||
|
||||
@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
|
||||
|
||||
```shell
|
||||
# for debian systems, installs Dokku via apt-get
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.0/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.22.0 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
|
||||
@@ -46,6 +46,7 @@ Why do we recommend stopping all apps?
|
||||
|
||||
```shell
|
||||
# for 0.22.0 and newer versions, use
|
||||
dokku ps:stop --all
|
||||
|
||||
# for versions between 0.11.4 and 0.21.4, use
|
||||
dokku ps:stopall
|
||||
|
||||
@@ -10,30 +10,30 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
.sponsors {
|
||||
@@ -127,12 +127,12 @@
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.0/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.22.0 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
|
||||
@@ -9,26 +9,26 @@
|
||||
<meta name="author" content="">
|
||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||
<meta name="application-name" content="Dokku">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<script>
|
||||
@@ -42,7 +42,7 @@
|
||||
</script>
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.0/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.3/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<style>
|
||||
|
||||
7
dokku
7
dokku
@@ -144,12 +144,7 @@ execute_dokku_cmd() {
|
||||
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]]; then
|
||||
[[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
|
||||
if [[ -n $DOKKU_APP_NAME ]]; then
|
||||
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
|
||||
shift 1
|
||||
set -- "--no-restart" "$DOKKU_APP_NAME" "$@"
|
||||
else
|
||||
set -- "$DOKKU_APP_NAME" "$@"
|
||||
fi
|
||||
set -- "$DOKKU_APP_NAME" "$@"
|
||||
fi
|
||||
set -- "$PLUGIN_CMD" "$@"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -25,7 +25,12 @@ type AppJSON struct {
|
||||
|
||||
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
|
||||
if hasEntrypoint {
|
||||
return []string{command}
|
||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||
if err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
|
||||
return nil
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
script := []string{"set -eo pipefail;"}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core app-json plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
@@ -12,7 +14,7 @@ func ReportSingleApp(appName, infoFlag string) error {
|
||||
|
||||
deploySource := ""
|
||||
if b, err := common.PlugnTriggerSetup("deploy-source", []string{appName}...).SetInput("").Output(); err != nil {
|
||||
deploySource = string(b[:])
|
||||
deploySource = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
locked := "false"
|
||||
|
||||
@@ -83,6 +83,17 @@ func destroyApp(appName string) error {
|
||||
|
||||
forceCleanup := true
|
||||
common.DockerCleanup(appName, forceCleanup)
|
||||
|
||||
// remove contents for apps that are symlinks to other folders
|
||||
if err := os.RemoveAll(fmt.Sprintf("%v/", common.AppRoot(appName))); err != nil {
|
||||
common.LogWarn(err.Error())
|
||||
}
|
||||
|
||||
// then remove the folder and/or the symlink
|
||||
if err := os.RemoveAll(common.AppRoot(appName)); err != nil {
|
||||
common.LogWarn(err.Error())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -140,7 +151,7 @@ func maybeCreateApp(appName string) error {
|
||||
}
|
||||
|
||||
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_DISABLE_APP_AUTOCREATION"}...)
|
||||
disableAutocreate := string(b[:])
|
||||
disableAutocreate := strings.TrimSpace(string(b[:]))
|
||||
if disableAutocreate == "true" {
|
||||
common.LogWarn("App auto-creation disabled.")
|
||||
return fmt.Errorf("Re-enable app auto-creation or create an app with 'dokku apps:create %s'", appName)
|
||||
|
||||
@@ -6,6 +6,7 @@ require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/apps"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
@@ -64,10 +65,12 @@ func main() {
|
||||
err = apps.CommandRename(oldAppName, newAppName, *skipDeploy)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("apps:report", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
infoFlag := args.Arg(1)
|
||||
err = apps.CommandReport(appName, infoFlag)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("apps", os.Args[2:])
|
||||
if err == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = apps.CommandReport(appName, infoFlag)
|
||||
}
|
||||
case "unlock":
|
||||
args := flag.NewFlagSet("apps:unlock", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
@@ -19,7 +18,7 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
|
||||
return errors.New("Please specify an new app name")
|
||||
}
|
||||
|
||||
if err := common.IsValidAppName(oldAppName); err != nil {
|
||||
if err := common.VerifyAppName(oldAppName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -27,10 +26,6 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
|
||||
return err
|
||||
}
|
||||
|
||||
if err := appExists(oldAppName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := appExists(newAppName); err == nil {
|
||||
if ignoreExisting {
|
||||
common.LogWarn("Name is already taken")
|
||||
@@ -62,8 +57,8 @@ func CommandClone(oldAppName string, newAppName string, skipDeploy bool, ignoreE
|
||||
|
||||
// CommandCreate creates app via command line
|
||||
func CommandCreate(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.IsValidAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return createApp(appName)
|
||||
@@ -71,8 +66,8 @@ func CommandCreate(appName string) error {
|
||||
|
||||
// CommandDestroy destroys an app
|
||||
func CommandDestroy(appName string, force bool) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if force {
|
||||
@@ -154,7 +149,7 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
return errors.New("Please specify an new app name")
|
||||
}
|
||||
|
||||
if err := common.IsValidAppName(oldAppName); err != nil {
|
||||
if err := common.VerifyAppName(oldAppName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -162,10 +157,6 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
return err
|
||||
}
|
||||
|
||||
if err := appExists(oldAppName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := appExists(newAppName); err == nil {
|
||||
return errors.New("Name is already taken")
|
||||
}
|
||||
@@ -197,11 +188,6 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
|
||||
// CommandReport displays an app report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) error {
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
@@ -31,16 +28,6 @@ func TriggerAppMaybeCreate(appName string) error {
|
||||
func TriggerPostDelete(appName string) error {
|
||||
imageRepo := common.GetAppImageRepo(appName)
|
||||
|
||||
// remove contents for apps that are symlinks to other folders
|
||||
if err := os.RemoveAll(fmt.Sprintf("%v/", common.AppRoot(appName))); err != nil {
|
||||
common.LogWarn(err.Error())
|
||||
}
|
||||
|
||||
// then remove the folder and/or the symlink
|
||||
if err := os.RemoveAll(common.AppRoot(appName)); err != nil {
|
||||
common.LogWarn(err.Error())
|
||||
}
|
||||
|
||||
imagesByAppLabel, err := listImagesByAppLabel(appName)
|
||||
if err != nil {
|
||||
common.LogWarn(err.Error())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-cnb plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -15,7 +15,11 @@ trigger-builder-dockerfile-builder-release() {
|
||||
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||
|
||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
|
||||
if "$DOCKER_BIN" image history --format "{{ json . }}" "$IMAGE" | grep -q "ONBUILD"; then
|
||||
dokku_log_warn "Image contains one or more ONBUILD directives, skipping label injection"
|
||||
else
|
||||
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
|
||||
fi
|
||||
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-dockerfile plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-herokuish plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -6,6 +6,7 @@ require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core buildpacks plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/buildpacks"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
@@ -43,10 +44,12 @@ func main() {
|
||||
err = buildpacks.CommandRemove(appName, buildpack, *index)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("buildpacks:report", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
infoFlag := args.Arg(1)
|
||||
err = buildpacks.CommandReport(appName, infoFlag)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("buildpacks", os.Args[2:])
|
||||
if err == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = buildpacks.CommandReport(appName, infoFlag)
|
||||
}
|
||||
case "set":
|
||||
args := flag.NewFlagSet("buildpacks:set", flag.ExitOnError)
|
||||
index := args.Int("index", 0, "--index: the 1-based index of the URL in the list of URLs")
|
||||
|
||||
@@ -3,7 +3,6 @@ package buildpacks
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
@@ -106,11 +105,6 @@ func CommandRemove(appName string, buildpack string, index int) (err error) {
|
||||
|
||||
// CommandReport displays a buildpacks report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) error {
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -16,9 +16,9 @@ is_file_import() {
|
||||
local KEY_FILE="$2"
|
||||
|
||||
if [[ $CRT_FILE ]] && [[ $KEY_FILE ]]; then
|
||||
if [[ ! -f $CRT_FILE ]]; then
|
||||
if [[ ! -r $CRT_FILE ]]; then
|
||||
dokku_log_fail "CRT file specified not found, please check file paths"
|
||||
elif [[ ! -f $KEY_FILE ]]; then
|
||||
elif [[ ! -r $KEY_FILE ]]; then
|
||||
dokku_log_fail "KEY file specified not found, please check file paths"
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core checks plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -69,7 +69,7 @@ func GetAppScheduler(appName string) string {
|
||||
}
|
||||
|
||||
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...)
|
||||
value := string(b[:])
|
||||
value := strings.TrimSpace(string(b[:]))
|
||||
if value != "" {
|
||||
return value
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func GetAppScheduler(appName string) string {
|
||||
// GetGlobalScheduler fetchs the global scheduler
|
||||
func GetGlobalScheduler() string {
|
||||
b, _ := PlugnTriggerOutput("config-get-global", []string{"DOKKU_SCHEDULER"}...)
|
||||
value := string(b[:])
|
||||
value := strings.TrimSpace(string(b[:]))
|
||||
if value != "" {
|
||||
return value
|
||||
}
|
||||
@@ -98,19 +98,19 @@ func GetDeployingAppImageName(appName, imageTag, imageRepo string) (string, erro
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
imageRemoteRepository := string(b[:])
|
||||
imageRemoteRepository := strings.TrimSpace(string(b[:]))
|
||||
|
||||
b, err = PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
newImageTag := string(b[:])
|
||||
newImageTag := strings.TrimSpace(string(b[:]))
|
||||
|
||||
b, err = PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
newImageRepo := string(b[:])
|
||||
newImageRepo := strings.TrimSpace(string(b[:]))
|
||||
|
||||
if newImageRepo != "" {
|
||||
imageRepo = newImageRepo
|
||||
@@ -286,6 +286,27 @@ func GetenvWithDefault(key string, defaultValue string) (val string) {
|
||||
return
|
||||
}
|
||||
|
||||
// ParseReportArgs splits out flags from non-flags for input into report commands
|
||||
func ParseReportArgs(pluginName string, arguments []string) ([]string, string, error) {
|
||||
osArgs := []string{}
|
||||
infoFlags := []string{}
|
||||
for _, argument := range arguments {
|
||||
if strings.HasPrefix(argument, "--") {
|
||||
infoFlags = append(infoFlags, argument)
|
||||
} else {
|
||||
osArgs = append(osArgs, argument)
|
||||
}
|
||||
}
|
||||
|
||||
if len(infoFlags) == 0 {
|
||||
return osArgs, "", nil
|
||||
}
|
||||
if len(infoFlags) == 1 {
|
||||
return osArgs, infoFlags[0], nil
|
||||
}
|
||||
return osArgs, "", fmt.Errorf("%s:report command allows only a single flag", pluginName)
|
||||
}
|
||||
|
||||
// ReportSingleApp is an internal function that displays a report for an app
|
||||
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, trimPrefix bool, uppercaseFirstCharacter bool) error {
|
||||
flags := []string{}
|
||||
@@ -395,10 +416,10 @@ func UcFirst(str string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// IsValidAppName verifies app name format
|
||||
// IsValidAppName verifies that the app name matches naming restrictions
|
||||
func IsValidAppName(appName string) error {
|
||||
if appName == "" {
|
||||
return fmt.Errorf("APP must not be null")
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
r, _ := regexp.Compile("^[a-z0-9][^/:_A-Z]*$")
|
||||
@@ -406,18 +427,30 @@ func IsValidAppName(appName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
appRoot := AppRoot(appName)
|
||||
if DirectoryExists(appRoot) {
|
||||
os.RemoveAll(appRoot)
|
||||
}
|
||||
|
||||
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores")
|
||||
}
|
||||
|
||||
// VerifyAppName verifies app name format and app existence"
|
||||
// isValidAppNameOld verifies that the app name matches the old naming restrictions
|
||||
func isValidAppNameOld(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
r, _ := regexp.Compile("^[a-z0-9][^/:A-Z]*$")
|
||||
if r.MatchString(appName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.New("App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, or colons")
|
||||
}
|
||||
|
||||
// VerifyAppName checks if an app conforming to either the old or new
|
||||
// naming conventions exists
|
||||
func VerifyAppName(appName string) error {
|
||||
if err := IsValidAppName(appName); err != nil {
|
||||
return err
|
||||
newErr := IsValidAppName(appName)
|
||||
oldErr := isValidAppNameOld(appName)
|
||||
if newErr != nil && oldErr != nil {
|
||||
return newErr
|
||||
}
|
||||
|
||||
appRoot := AppRoot(appName)
|
||||
|
||||
@@ -137,7 +137,7 @@ func DockerCleanup(appName string, forceCleanup bool) error {
|
||||
skipCleanup := false
|
||||
if appName != "" {
|
||||
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SKIP_CLEANUP"}...)
|
||||
output := string(b[:])
|
||||
output := strings.TrimSpace(string(b[:]))
|
||||
if output == "true" {
|
||||
skipCleanup = true
|
||||
}
|
||||
|
||||
@@ -181,23 +181,43 @@ dokku_container_log_verbose_quiet() {
|
||||
}
|
||||
|
||||
is_valid_app_name() {
|
||||
declare desc="verify app name format"
|
||||
declare desc="verify that the app name matches naming restrictions"
|
||||
local APP="$1"
|
||||
[[ -z "$APP" ]] && dokku_log_fail "APP must not be null"
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
|
||||
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]] && [[ ! $APP =~ [_] ]]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "${DOKKU_ROOT:?}/$APP"
|
||||
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
|
||||
}
|
||||
|
||||
is_valid_app_name_old() {
|
||||
declare desc="verify that the app name matches the old naming restrictions"
|
||||
local APP="$1"
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
|
||||
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, or colons"
|
||||
}
|
||||
|
||||
verify_app_name() {
|
||||
declare desc="verify app name format and app existence"
|
||||
local APP="$1"
|
||||
is_valid_app_name "$APP"
|
||||
declare APP="$1"
|
||||
local VALID_NEW=false
|
||||
local VALID_OLD=false
|
||||
is_valid_app_name "$APP" 2>/dev/null && VALID_NEW=true
|
||||
is_valid_app_name_old "$APP" 2>/dev/null && VALID_OLD=true
|
||||
|
||||
if [[ "$VALID_NEW" == "false" ]] && [[ "$VALID_OLD" == "false" ]]; then
|
||||
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
|
||||
fi
|
||||
|
||||
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
|
||||
|
||||
return 0
|
||||
@@ -217,7 +237,6 @@ get_app_image_repo() {
|
||||
declare desc="central definition of image repo pattern"
|
||||
local APP="$1"
|
||||
local IMAGE_REPO="dokku/$APP"
|
||||
is_valid_app_name "$APP"
|
||||
echo "$IMAGE_REPO"
|
||||
}
|
||||
|
||||
@@ -226,7 +245,6 @@ get_deploying_app_image_name() {
|
||||
local APP="$1"
|
||||
local IMAGE_TAG="$2"
|
||||
IMAGE_REPO="$3"
|
||||
is_valid_app_name "$APP"
|
||||
|
||||
local IMAGE_REMOTE_REPOSITORY=$(plugn trigger deployed-app-repository "$APP")
|
||||
local NEW_IMAGE_TAG=$(plugn trigger deployed-app-image-tag "$APP")
|
||||
@@ -247,7 +265,6 @@ get_app_image_name() {
|
||||
local APP="$1"
|
||||
local IMAGE_TAG="$2"
|
||||
IMAGE_REPO="$3"
|
||||
is_valid_app_name "$APP"
|
||||
|
||||
if [[ -z "$IMAGE_REPO" ]]; then
|
||||
IMAGE_REPO=$(get_app_image_repo "$APP")
|
||||
|
||||
@@ -6,25 +6,20 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// ParallelCommand is a type that declares functions
|
||||
// parallelCommand is a type that declares functions
|
||||
// the ps plugins can execute in parallel
|
||||
type ParallelCommand func(string) error
|
||||
type parallelCommand func(string) error
|
||||
|
||||
// ParallelCommandRun contains all the arguments
|
||||
// necessary for a parallel command run
|
||||
type ParallelCommandRun struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
// ParallelCommandResult is the result of a parallel
|
||||
// parallelCommandResult is the result of a parallel
|
||||
// command run
|
||||
type ParallelCommandResult struct {
|
||||
Name string
|
||||
Error error
|
||||
type parallelCommandResult struct {
|
||||
Name string
|
||||
CommandName string
|
||||
Error error
|
||||
}
|
||||
|
||||
// RunCommandAgainstAllApps runs a given ParallelCommand against all apps
|
||||
func RunCommandAgainstAllApps(command ParallelCommand, commandName string, parallelCount int) error {
|
||||
// RunCommandAgainstAllApps runs a given parallelCommand against all apps
|
||||
func RunCommandAgainstAllApps(command parallelCommand, commandName string, parallelCount int) error {
|
||||
runInSerial := false
|
||||
|
||||
if parallelCount < -1 {
|
||||
@@ -49,8 +44,8 @@ func RunCommandAgainstAllApps(command ParallelCommand, commandName string, paral
|
||||
return RunCommandAgainstAllAppsInParallel(command, commandName, parallelCount)
|
||||
}
|
||||
|
||||
// RunCommandAgainstAllAppsInParallel runs a given ParallelCommand against all apps in parallel
|
||||
func RunCommandAgainstAllAppsInParallel(command ParallelCommand, commandName string, parallelCount int) error {
|
||||
// RunCommandAgainstAllAppsInParallel runs a given parallelCommand against all apps in parallel
|
||||
func RunCommandAgainstAllAppsInParallel(command parallelCommand, commandName string, parallelCount int) error {
|
||||
apps, err := DokkuApps()
|
||||
if err != nil {
|
||||
LogWarn(err.Error())
|
||||
@@ -58,19 +53,19 @@ func RunCommandAgainstAllAppsInParallel(command ParallelCommand, commandName str
|
||||
}
|
||||
|
||||
jobs := make(chan string, parallelCount)
|
||||
results := make(chan ParallelCommandResult, len(apps))
|
||||
results := make(chan parallelCommandResult, len(apps))
|
||||
|
||||
go allocateJobs(apps, jobs)
|
||||
done := make(chan error)
|
||||
go aggregateResults(results, done)
|
||||
createParallelWorkerPool(jobs, results, command, parallelCount)
|
||||
createParallelWorkerPool(jobs, results, command, commandName, parallelCount)
|
||||
err = <-done
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// RunCommandAgainstAllAppsSerially runs a given ParallelCommand against all apps serially
|
||||
func RunCommandAgainstAllAppsSerially(command ParallelCommand, commandName string) error {
|
||||
// RunCommandAgainstAllAppsSerially runs a given parallelCommand against all apps serially
|
||||
func RunCommandAgainstAllAppsSerially(command parallelCommand, commandName string) error {
|
||||
apps, err := DokkuApps()
|
||||
if err != nil {
|
||||
LogWarn(err.Error())
|
||||
@@ -81,6 +76,7 @@ func RunCommandAgainstAllAppsSerially(command ParallelCommand, commandName strin
|
||||
for _, appName := range apps {
|
||||
LogInfo1(fmt.Sprintf("Running %s against app %s", commandName, appName))
|
||||
if err = command(appName); err != nil {
|
||||
LogWarn(fmt.Sprintf("Error running %s against app %s: %s", commandName, appName, err.Error()))
|
||||
errorCount++
|
||||
}
|
||||
}
|
||||
@@ -99,12 +95,12 @@ func allocateJobs(input []string, jobs chan string) {
|
||||
close(jobs)
|
||||
}
|
||||
|
||||
func aggregateResults(results chan ParallelCommandResult, done chan error) {
|
||||
func aggregateResults(results chan parallelCommandResult, done chan error) {
|
||||
var parallelError error
|
||||
errorCount := 0
|
||||
for result := range results {
|
||||
if result.Error != nil {
|
||||
LogWarn(fmt.Sprintf("Error running command against %s", result.Name))
|
||||
LogWarn(fmt.Sprintf("Error running %s against %s: %s", result.CommandName, result.Name, result.Error.Error()))
|
||||
errorCount++
|
||||
}
|
||||
}
|
||||
@@ -114,23 +110,24 @@ func aggregateResults(results chan ParallelCommandResult, done chan error) {
|
||||
done <- parallelError
|
||||
}
|
||||
|
||||
func createParallelWorker(jobs chan string, results chan ParallelCommandResult, command ParallelCommand, wg *sync.WaitGroup, workerID int) {
|
||||
func createParallelWorker(jobs chan string, results chan parallelCommandResult, command parallelCommand, commandName string, wg *sync.WaitGroup, workerID int) {
|
||||
for job := range jobs {
|
||||
LogInfo1(fmt.Sprintf("Running command against %s", job))
|
||||
output := ParallelCommandResult{
|
||||
Name: job,
|
||||
Error: command(job),
|
||||
output := parallelCommandResult{
|
||||
Name: job,
|
||||
CommandName: commandName,
|
||||
Error: command(job),
|
||||
}
|
||||
results <- output
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func createParallelWorkerPool(jobs chan string, results chan ParallelCommandResult, command ParallelCommand, numberOfWorkers int) {
|
||||
func createParallelWorkerPool(jobs chan string, results chan parallelCommandResult, command parallelCommand, commandName string, numberOfWorkers int) {
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < numberOfWorkers; i++ {
|
||||
wg.Add(1)
|
||||
go createParallelWorker(jobs, results, command, &wg, i)
|
||||
go createParallelWorker(jobs, results, command, commandName, &wg, i)
|
||||
}
|
||||
wg.Wait()
|
||||
close(results)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core common plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -2,6 +2,7 @@ package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@@ -79,7 +80,21 @@ func PlugnTrigger(triggerName string, args ...string) error {
|
||||
|
||||
// PlugnTriggerOutput fire the given plugn trigger with the given args
|
||||
func PlugnTriggerOutput(triggerName string, args ...string) ([]byte, error) {
|
||||
return PlugnTriggerSetup(triggerName, args...).Output()
|
||||
rescueStderr := os.Stderr
|
||||
r, w, _ := os.Pipe()
|
||||
os.Stderr = w
|
||||
out, err := PlugnTriggerSetup(triggerName, args...).Output()
|
||||
w.Close()
|
||||
|
||||
readStderr, _ := ioutil.ReadAll(r)
|
||||
os.Stderr = rescueStderr
|
||||
|
||||
var stderr error
|
||||
if err != nil {
|
||||
stderr = fmt.Errorf(string(readStderr[:]))
|
||||
}
|
||||
|
||||
return out, stderr
|
||||
}
|
||||
|
||||
// PlugnTriggerSetup sets up a plugn trigger call
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
@@ -145,9 +144,14 @@ func getEnvironment(appName string, merged bool) (env *Env) {
|
||||
}
|
||||
|
||||
func getAppNameOrGlobal(appName string, global bool) (string, error) {
|
||||
if appName == "" && !global {
|
||||
return appName, errors.New("Please specify an app to run the command on or --global")
|
||||
if global {
|
||||
return appName, nil
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return appName, err
|
||||
}
|
||||
|
||||
return appName, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ func newEnvFromString(rep string) (env *Env, err error) {
|
||||
|
||||
//LoadAppEnv loads an environment for the given app
|
||||
func LoadAppEnv(appName string) (env *Env, err error) {
|
||||
err = common.VerifyAppName(appName)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
appfile, err := getAppFile(appName)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -7,6 +7,7 @@ require (
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/joho/godotenv v1.2.0
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
|
||||
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core config plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
func getKeys(args []string, global bool) []string {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core docker-options plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
14
plugins/docker-options/post-delete
Executable file
14
plugins/docker-options/post-delete
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||
|
||||
trigger-docker-options-post-delete() {
|
||||
declare desc="deletes docker options files for an app"
|
||||
declare trigger="post-delete"
|
||||
declare APP="$1"
|
||||
|
||||
rm -f "$(fn-get-phase-file-path "$APP" "build")" "$(fn-get-phase-file-path "$APP" "deploy")" "$(fn-get-phase-file-path "$APP" "run")"
|
||||
}
|
||||
|
||||
trigger-docker-options-post-delete "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core domains plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core enter plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -139,12 +139,15 @@ cmd-git-hook() {
|
||||
# if block if you wish to run it for others as well.
|
||||
if [[ $refname == "refs/heads/${DOKKU_DEPLOY_BRANCH}" ]]; then
|
||||
# broken out into plugin so we might support other methods to receive an app
|
||||
# shellcheck disable=SC2086
|
||||
git_receive_app "$APP" "$newrev"
|
||||
else
|
||||
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 1 ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
plugn trigger receive-branch $APP $newrev $refname
|
||||
elif [[ -z "$(fn-git-deploy-branch "$APP" "")" ]]; then
|
||||
echo $'\e[1G\e[K'"-----> Set ${refname/refs\/heads\//} to DOKKU_DEPLOY_BRANCH."
|
||||
fn-plugin-property-write "git" "$app" "deploy-branch" "${refname/refs\/heads\//}"
|
||||
git_receive_app "$APP" "$newrev"
|
||||
else
|
||||
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to ${DOKKU_DEPLOY_BRANCH}."
|
||||
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:${DOKKU_DEPLOY_BRANCH}'"
|
||||
@@ -169,9 +172,14 @@ git_build() {
|
||||
local REF="$REV"
|
||||
else
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
|
||||
if [[ -f "$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" ]]; then
|
||||
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$REF" ]]; then
|
||||
return
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
git_build_app_repo $APP $REF
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ fn-git-last-updated-at() {
|
||||
fn-git-deploy-branch() {
|
||||
declare desc="retrieve the deploy branch for a given application"
|
||||
local APP="$1"
|
||||
local DEFAULT_BRANCH="${2-master}"
|
||||
|
||||
local DOKKU_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "$APP" "deploy-branch" "")"
|
||||
local DOKKU_GLOBAL_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "--global" "deploy-branch" "")"
|
||||
@@ -93,6 +94,6 @@ fn-git-deploy-branch() {
|
||||
elif [[ -n "$DOKKU_GLOBAL_DEPLOY_BRANCH" ]]; then
|
||||
echo "$DOKKU_GLOBAL_DEPLOY_BRANCH"
|
||||
else
|
||||
echo "master"
|
||||
echo "$DEFAULT_BRANCH"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core git plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
14
plugins/git/post-create
Executable file
14
plugins/git/post-create
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/git/functions"
|
||||
|
||||
trigger-git-post-create() {
|
||||
declare desc="initializes an app with the correct git repository structure"
|
||||
declare trigger="post-create"
|
||||
declare APP="$1"
|
||||
|
||||
fn-git-create-hook "$APP"
|
||||
}
|
||||
|
||||
trigger-git-post-create "$@"
|
||||
@@ -6,6 +6,7 @@ require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -4,3 +4,5 @@ github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4qu
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core logs plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
@@ -9,6 +8,10 @@ import (
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/logs"
|
||||
|
||||
stdFlag "flag"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -19,39 +22,32 @@ Manage log integration for an app
|
||||
Additional commands:`
|
||||
|
||||
helpContent = `
|
||||
logs [-h] [-t] [-n num] [-q] [-p process] <app>, Display recent log output
|
||||
logs [-h] [-t|--tail] [-n|--num num] [-q|--quiet] [-p|--ps process] <app>, Display recent log output
|
||||
logs:failed [<app>], Shows the last failed deploy logs
|
||||
`
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Usage = usage
|
||||
flag.Parse()
|
||||
stdFlag.Usage = usage
|
||||
stdFlag.Parse()
|
||||
|
||||
cmd := flag.Arg(0)
|
||||
cmd := stdFlag.Arg(0)
|
||||
switch cmd {
|
||||
case "logs":
|
||||
args := flag.NewFlagSet("logs", flag.ExitOnError)
|
||||
var num int64
|
||||
var ps string
|
||||
var tail bool
|
||||
var quiet bool
|
||||
help := args.Bool("h", false, "-h: print help for the command")
|
||||
args.Int64Var(&num, "n", 0, "-n: the number of lines to display")
|
||||
args.Int64Var(&num, "num", 0, "--num: the number of lines to display")
|
||||
args.StringVar(&ps, "p", "", "-p: only display logs from the given process")
|
||||
args.StringVar(&ps, "ps", "", "--p: only display logs from the given process")
|
||||
args.BoolVar(&tail, "t", true, "-t: continually stream logs")
|
||||
args.BoolVar(&tail, "tail", true, "--tail: continually stream logs")
|
||||
args.BoolVar(&quiet, "q", true, "-q: display raw logs without colors, time and names")
|
||||
args.BoolVar(&quiet, "quiet", true, "--quiet: display raw logs without colors, time and names")
|
||||
args.Parse(flag.Args()[1:])
|
||||
num := args.Int64P("num", "n", 100, "the number of lines to display")
|
||||
ps := args.StringP("ps", "p", "", "only display logs from the given process")
|
||||
tail := args.BoolP("tail", "t", false, "continually stream logs")
|
||||
quiet := args.BoolP("quiet", "q", false, "display raw logs without colors, time and names")
|
||||
args.Parse(os.Args[2:])
|
||||
if *help {
|
||||
usage()
|
||||
return
|
||||
}
|
||||
|
||||
appName := args.Arg(0)
|
||||
err := logs.CommandDefault(appName, num, ps, tail, quiet)
|
||||
err := logs.CommandDefault(appName, *num, *ps, *tail, *quiet)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/logs"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
|
||||
@@ -26,6 +26,7 @@ func CommandDefault(appName string, num int64, process string, tail, quiet bool)
|
||||
t := strconv.FormatBool(tail)
|
||||
q := strconv.FormatBool(quiet)
|
||||
n := strconv.FormatInt(num, 10)
|
||||
|
||||
if err := common.PlugnTrigger("scheduler-logs", []string{s, appName, process, t, q, n}...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
|
||||
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core network plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/network"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
@@ -52,10 +53,12 @@ func main() {
|
||||
err = network.CommandRebuildall()
|
||||
case "report":
|
||||
args := flag.NewFlagSet("network:report", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
infoFlag := args.Arg(1)
|
||||
err = network.CommandReport(appName, infoFlag)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("network", os.Args[2:])
|
||||
if err == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = network.CommandReport(appName, infoFlag)
|
||||
}
|
||||
case "set":
|
||||
args := flag.NewFlagSet("network:set", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
|
||||
@@ -124,11 +124,6 @@ func CommandRebuildall() error {
|
||||
|
||||
// CommandReport displays a network report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) error {
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
|
||||
@@ -168,5 +168,5 @@ nginx_clear_config() {
|
||||
declare desc="Remove the nginx conf file"
|
||||
declare APP="$1"
|
||||
rm -f "$DOKKU_ROOT/$APP/nginx.conf"
|
||||
fn-nginx-vhosts-nginx-init-cmd "reload"
|
||||
suppress_output fn-nginx-vhosts-nginx-init-cmd "reload"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core nginx-vhosts plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
|
||||
trigger-nginx-vhosts-post-delete() {
|
||||
declare desc="nginx-vhosts post-delete trigger"
|
||||
declare trigger="post-delete"
|
||||
declare APP="$1"
|
||||
|
||||
fn-plugin-property-destroy "nginx" "$APP"
|
||||
restart_nginx "$@" >/dev/null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core plugin plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -7,6 +7,7 @@ require (
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc=
|
||||
github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core proxy plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/proxy"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
@@ -63,10 +64,12 @@ func main() {
|
||||
err = proxy.CommandPortsSet(appName, portMaps)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("proxy:report", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
infoFlag := args.Arg(1)
|
||||
err = proxy.CommandReport(appName, infoFlag)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("proxy", os.Args[2:])
|
||||
if err == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = proxy.CommandReport(appName, infoFlag)
|
||||
}
|
||||
case "set":
|
||||
args := flag.NewFlagSet("proxy:set", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
|
||||
@@ -155,11 +155,6 @@ func CommandPortsSet(appName string, portMaps []string) error {
|
||||
|
||||
// CommandReport displays a proxy report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) error {
|
||||
if strings.HasPrefix(appName, "--") {
|
||||
infoFlag = appName
|
||||
appName = ""
|
||||
}
|
||||
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
|
||||
@@ -9,6 +9,7 @@ require (
|
||||
github.com/dokku/dokku/plugins/docker-options v0.0.0-00010101000000-000000000000
|
||||
github.com/gofrs/flock v0.8.0
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -10,3 +10,5 @@ github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1XjNtTFGCwSM6OmFJblU4ld4gACoJsbadJg=
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
fn-ps-parallel-cmd() {
|
||||
declare desc="Run a ps command against all apps"
|
||||
declare CMD="$1"
|
||||
local GNU_PARALLEL has_apps=false
|
||||
|
||||
for APP in $(dokku_apps); do
|
||||
has_apps=true
|
||||
break
|
||||
done
|
||||
|
||||
if [[ "$has_apps" == "false" ]]; then
|
||||
dokku_log_info1 "No apps detected"
|
||||
return
|
||||
fi
|
||||
|
||||
if which parallel >/dev/null 2>&1; then
|
||||
dokku_log_info1 "Running 'dokku ps:${CMD}' in parallel"
|
||||
GNU_PARALLEL=$(parallel -V 2>&1 | grep GNU || true)
|
||||
if [[ -z "$GNU_PARALLEL" ]]; then
|
||||
# shellcheck disable=SC2046
|
||||
parallel $DOKKU_PARALLEL_ARGUMENTS -i bash -c "dokku ps:${CMD} {}" -- $(dokku_apps)
|
||||
else
|
||||
# shellcheck disable=SC2046
|
||||
dokku_apps | parallel $DOKKU_PARALLEL_ARGUMENTS "dokku ps:${CMD} {}"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
dokku_log_info1 "Running 'dokku ps:${CMD}' in serially"
|
||||
for APP in $(dokku_apps); do
|
||||
if ! (is_deployed "$APP"); then
|
||||
dokku_log_warn "App $APP has not been deployed"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$CMD" == "restore" ]]; then
|
||||
local DOKKU_APP_RESTORE=$(config_get "$APP" DOKKU_APP_RESTORE || true)
|
||||
if [[ "$DOKKU_APP_RESTORE" == 0 ]]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
dokku_log_verbose "Running 'dokku ps:${CMD} $APP' ..."
|
||||
if ps_${CMD} "$APP"; then
|
||||
continue
|
||||
fi
|
||||
dokku_log_warn "dokku ps:${CMD} $APP failed"
|
||||
done
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core ps plugin"
|
||||
version = "0.22.0"
|
||||
version = "0.22.3"
|
||||
[plugin.config]
|
||||
|
||||
@@ -99,6 +99,7 @@ func Restore(appName string) error {
|
||||
return fmt.Errorf("Error running pre-restore: %s", err)
|
||||
}
|
||||
|
||||
common.LogInfo1("Clearing potentially invalid proxy configuration")
|
||||
if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil {
|
||||
return fmt.Errorf("Error clearing proxy config: %s", err)
|
||||
}
|
||||
@@ -111,9 +112,11 @@ func Restore(appName string) error {
|
||||
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_RESTORE"}...)
|
||||
restore := strings.TrimSpace(string(b[:]))
|
||||
if restore == "0" {
|
||||
common.LogWarn(fmt.Sprintf("Skipping ps:restore for %s as DOKKU_APP_RESTORE=%s", appName, restore))
|
||||
return nil
|
||||
}
|
||||
|
||||
common.LogInfo1("Starting app")
|
||||
return Start(appName)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/ps"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// main entrypoint to all subcommands
|
||||
@@ -31,10 +32,12 @@ func main() {
|
||||
err = ps.CommandRebuild(appName, *allApps, *parallelCount)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("ps:report", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
infoFlag := args.Arg(1)
|
||||
err = ps.CommandReport(appName, infoFlag)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("ps", os.Args[2:])
|
||||
if err == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = ps.CommandReport(appName, infoFlag)
|
||||
}
|
||||
case "restart":
|
||||
args := flag.NewFlagSet("ps:restart", flag.ExitOnError)
|
||||
allApps := args.Bool("all", false, "--all: restart all apps")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user