Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e435d01258 | ||
|
|
793e9d377e | ||
|
|
a57680fbbf | ||
|
|
eda71e3ffe | ||
|
|
b186d9d66c | ||
|
|
f16a211b48 | ||
|
|
d70a9be97e | ||
|
|
666bb9dfee | ||
|
|
081a44755e | ||
|
|
2eae6c25af | ||
|
|
4bbee232d8 | ||
|
|
441f7ab22a | ||
|
|
714b27f8a4 | ||
|
|
2d841f47eb | ||
|
|
4c98cd922f | ||
|
|
1c3c712629 | ||
|
|
84ec74e97f | ||
|
|
57cc1c7f8e | ||
|
|
0e67ffc41e | ||
|
|
f4e0d19d43 | ||
|
|
07e7988cdf | ||
|
|
d21aca2c59 | ||
|
|
540e066acf | ||
|
|
a49de4e473 | ||
|
|
4c28ae2630 | ||
|
|
2d07d89d60 | ||
|
|
83d8c8448b | ||
|
|
8eccd50ecb | ||
|
|
09ed45534d | ||
|
|
711945147b | ||
|
|
0b3a6687f6 | ||
|
|
1aec869f9e | ||
|
|
6f9a6eb294 | ||
|
|
96ed840d17 | ||
|
|
5acdf4a43c | ||
|
|
6b4c545592 | ||
|
|
dd6cbcf242 | ||
|
|
d6acf5530e | ||
|
|
94696e81fa | ||
|
|
43d6a2ad94 | ||
|
|
e1425a85e4 | ||
|
|
f5fa94cc9c | ||
|
|
fd85b1f605 | ||
|
|
b386783ec8 | ||
|
|
3b76b81edf | ||
|
|
2eb159b0c3 | ||
|
|
596e7b6f24 | ||
|
|
aa0437bb23 | ||
|
|
a6c22a292d | ||
|
|
0635edba17 | ||
|
|
a0491a5ef2 | ||
|
|
38d172c477 | ||
|
|
5e4c918d40 | ||
|
|
e8aaacff5e | ||
|
|
21d4d640c2 | ||
|
|
b927c1b84d | ||
|
|
d456a96cb5 | ||
|
|
1964fc6b65 | ||
|
|
26e270a49f | ||
|
|
3323623289 | ||
|
|
7a43321d1c | ||
|
|
4a5cc71c3e | ||
|
|
660ccf876e | ||
|
|
69dd81860f | ||
|
|
b1c2c026aa | ||
|
|
b7fa97bf9e | ||
|
|
1bdaab6d72 | ||
|
|
3edc14fc97 | ||
|
|
940d258c5e | ||
|
|
2500ca5106 | ||
|
|
c5a7fd6d43 | ||
|
|
d424af5b1e | ||
|
|
ca383739ab | ||
|
|
0176e888af | ||
|
|
0e320d2832 | ||
|
|
38b96c1e27 | ||
|
|
5da5a6fe5f | ||
|
|
28c9f42a25 | ||
|
|
44461e21df | ||
|
|
164c4eefa7 | ||
|
|
ee6c034baa | ||
|
|
4b399df541 | ||
|
|
f1c7e1113f | ||
|
|
90c68ba02f | ||
|
|
7f2180b47b | ||
|
|
21ff68f624 | ||
|
|
fd162f8895 | ||
|
|
03e80a76b6 | ||
|
|
08fdfd1e38 | ||
|
|
2a6c411edf | ||
|
|
65d7fd9cce | ||
|
|
e0570be562 | ||
|
|
ffa303092f | ||
|
|
382dc01b33 | ||
|
|
7f02155ce1 | ||
|
|
8c17a70dc1 | ||
|
|
b39623ab2b | ||
|
|
98e57287e3 | ||
|
|
68047866be | ||
|
|
bacc5cbcab | ||
|
|
549280e2b6 |
5
.github/workflows/bump-formula.yml
vendored
5
.github/workflows/bump-formula.yml
vendored
@@ -14,7 +14,10 @@ jobs:
|
||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Bump Brew
|
||||
env:
|
||||
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
brew tap dokku/repo
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
brew tap dokku/repo "https://$HOMEBREW_GITHUB_USERNAME:$HOMEBREW_GITHUB_API_TOKEN@github.com/dokku/homebrew-repo.git"
|
||||
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
|
||||
|
||||
@@ -53,4 +53,4 @@ RUN \
|
||||
&& rm -f /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
|
||||
&& rm -f /usr/local/openresty/nginx/conf/sites-enabled/default /usr/share/openresty/html/index.html \
|
||||
&& sed -i '/imklog/d' /etc/rsyslog.conf \
|
||||
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/* /var/log/nginx/* /var/log/openresty/*
|
||||
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/*.log /var/log/nginx/* /var/log/openresty/*
|
||||
|
||||
101
HISTORY.md
101
HISTORY.md
@@ -1,5 +1,106 @@
|
||||
# History
|
||||
|
||||
## 0.22.7
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4301: @josegonzalez Ensure vector container starts correctly
|
||||
|
||||
## 0.22.6
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.6/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.6 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4295: @josegonzalez Update ps subcommands and triggers
|
||||
|
||||
### New Features
|
||||
|
||||
- #4286: @josegonzalez Add support for templated CHECKS files
|
||||
- #4294: @josegonzalez Enhance ssh client logging output
|
||||
- #4291: @josegonzalez Add log aggregation support via Vector
|
||||
- #4288: @josegonzalez Add the pid of the dokku process to event logs
|
||||
- #4289: @josegonzalez Clean precheck tmp file on exit
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4287: @josegonzalez Refactor parallelized goroutines to use error groups
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4292: @thomasfedb Update docs to note support for Ubuntu 20.04
|
||||
- #4293: @ltalirz Fix path in persistent storage docs
|
||||
|
||||
### Other
|
||||
|
||||
- #4290: @josegonzalez Add support for debug logging plugin trigger stderr and stdout
|
||||
|
||||
## 0.22.5
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.5 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4279: @josegonzalez Allow vmware-based vm to work on big sur
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4282: @josegonzalez Cleanup brew-bump integration
|
||||
- #4280: @josegonzalez Parallelize report and scheduler retrieval
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4285: @josegonzalez Reference official gitlab-ci integration
|
||||
- #4284: @josegonzalez Drop old doc link to gitlab ci docs
|
||||
- #4283: @josegonzalez Add CI documentation section for Github Actions and Gitlab
|
||||
- #4281: @josegonzalez Add forum link to documentation
|
||||
|
||||
## 0.22.4
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.4 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4274: @josegonzalez Use correct warning message for deprecated code
|
||||
|
||||
### New Features
|
||||
|
||||
- #4273: @josegonzalez Upgrade to golang 1.15
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4275: @josegonzalez Add calls to verify app name in subcommands
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4272: @josegonzalez Correct help output for ssh-keys command
|
||||
|
||||
### Tests
|
||||
|
||||
- #4276: @josegonzalez Upgrade version of plugn used in tests
|
||||
|
||||
## 0.22.3
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@ DOKKU_VERSION ?= master
|
||||
|
||||
HEROKUISH_VERSION ?= 0.5.19
|
||||
PROCFILE_VERSION ?= 0.11.0
|
||||
PLUGN_VERSION ?= 0.5.1
|
||||
PLUGN_VERSION ?= 0.6.0
|
||||
SIGIL_VERSION ?= 0.6.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
|
||||
|
||||
@@ -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.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||
|
||||
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -31,10 +31,12 @@ Vagrant::configure("2") do |config|
|
||||
|
||||
config.vm.provider :vmware_fusion do |v, override|
|
||||
v.vmx["memsize"] = BOX_MEMORY
|
||||
v.ssh_info_public = true
|
||||
end
|
||||
|
||||
config.vm.provider :vmware_desktop do |v, override|
|
||||
v.vmx["memsize"] = BOX_MEMORY
|
||||
v.ssh_info_public = true
|
||||
end
|
||||
|
||||
config.vm.define "empty", autostart: false
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
GO_ARGS ?=
|
||||
GO_PLUGIN_MAKE_TARGET ?= build
|
||||
GO_REPO_ROOT := /go/src/github.com/dokku/dokku
|
||||
BUILD_IMAGE := golang:1.14.4
|
||||
BUILD_IMAGE := golang:1.15.6
|
||||
|
||||
.PHONY: build-in-docker build clean src-clean
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.22.3'
|
||||
VERSION = 'v0.22.7'
|
||||
|
||||
def bytes_to_string(b):
|
||||
if type(b) == bytes:
|
||||
|
||||
@@ -32,8 +32,8 @@ fn-random-name() {
|
||||
}
|
||||
|
||||
fn-client-help-msg() {
|
||||
echo "==> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku" 1>&2
|
||||
echo "--> i.e. git remote add dokku dokku@<dokku-host>:<app-name>" 1>&2
|
||||
echo "=====> Configure the DOKKU_HOST environment variable or run $0 from a repository with a git remote named dokku"
|
||||
echo " i.e. git remote add dokku dokku@<dokku-host>:<app-name>"
|
||||
exit 20 # exit with specific status. only used in units tests for now
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ main() {
|
||||
APP=$(git remote -v 2>/dev/null | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
|
||||
set -e
|
||||
else
|
||||
echo "This is not a git repository"
|
||||
echo " ! This is not a git repository" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -118,7 +118,7 @@ main() {
|
||||
counter=0
|
||||
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps 2>/dev/null | grep -q "$APP"; do
|
||||
if [[ $counter -ge 100 ]]; then
|
||||
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
|
||||
echo " ! Could not reasonably generate a new app name. Try cleaning up some apps..." 1>&2
|
||||
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_REMOTE_HOST" apps
|
||||
exit 1
|
||||
else
|
||||
@@ -133,7 +133,7 @@ main() {
|
||||
echo "-----> Dokku remote added at ${DOKKU_REMOTE_HOST} called ${DOKKU_GIT_REMOTE}"
|
||||
echo "-----> Application name is ${APP}"
|
||||
else
|
||||
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
||||
echo " ! Dokku remote not added! Do you already have a dokku remote?" 1>&2
|
||||
return
|
||||
fi
|
||||
;;
|
||||
@@ -149,7 +149,12 @@ main() {
|
||||
[[ -n "$@" ]] && [[ -n "$APP" ]] && app_arg="--app $APP"
|
||||
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@"
|
||||
# shellcheck disable=SC2068,SC2086
|
||||
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@
|
||||
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_REMOTE_HOST -- $app_arg $@ || {
|
||||
ssh_exit_code="$?"
|
||||
echo " ! Failed to execute dokku command over ssh: exit code $?" 1>&2
|
||||
echo " ! If there was no output from Dokku, ensure your configured SSH Key can connect to the remote server" 1>&2
|
||||
return $ssh_exit_code
|
||||
}
|
||||
}
|
||||
|
||||
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]] || [[ "$0" == $(which dokku) ]]; then
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -1,5 +1,5 @@
|
||||
Package: dokku
|
||||
Version: 0.22.3
|
||||
Version: 0.22.7
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
|
||||
@@ -37,7 +37,7 @@ This example demonstrates how to mount the recommended directory to `/storage` i
|
||||
dokku storage:mount node-js-app /var/lib/dokku/data/storage/node-js-app:/storage
|
||||
```
|
||||
|
||||
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage` to `/storage` inside the container.
|
||||
Dokku will then mount the shared contents of `/var/lib/dokku/data/storage/node-js-app` to `/storage` inside the container.
|
||||
|
||||
Once you have mounted persistent storage, you will also need to restart the application. See the
|
||||
[process scaling documentation](/docs/deployment/process-management.md) for more information.
|
||||
|
||||
@@ -35,35 +35,35 @@ dokku plugin:list
|
||||
|
||||
```
|
||||
plugn: dev
|
||||
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
|
||||
00_dokku-standard 0.22.7 enabled dokku core standard plugin
|
||||
20_events 0.22.7 enabled dokku core events logging plugin
|
||||
app-json 0.22.7 enabled dokku core app-json plugin
|
||||
apps 0.22.7 enabled dokku core apps plugin
|
||||
build-env 0.22.7 enabled dokku core build-env plugin
|
||||
buildpacks 0.22.7 enabled dokku core buildpacks plugin
|
||||
certs 0.22.7 enabled dokku core certificate management plugin
|
||||
checks 0.22.7 enabled dokku core checks plugin
|
||||
common 0.22.7 enabled dokku core common plugin
|
||||
config 0.22.7 enabled dokku core config plugin
|
||||
docker-options 0.22.7 enabled dokku core docker-options plugin
|
||||
domains 0.22.7 enabled dokku core domains plugin
|
||||
enter 0.22.7 enabled dokku core enter plugin
|
||||
git 0.22.7 enabled dokku core git plugin
|
||||
logs 0.22.7 enabled dokku core logs plugin
|
||||
network 0.22.7 enabled dokku core network plugin
|
||||
nginx-vhosts 0.22.7 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.22.7 enabled dokku core plugin plugin
|
||||
proxy 0.22.7 enabled dokku core proxy plugin
|
||||
ps 0.22.7 enabled dokku core ps plugin
|
||||
repo 0.22.7 enabled dokku core repo plugin
|
||||
resource 0.22.7 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.22.7 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.22.7 enabled dokku core shell plugin
|
||||
ssh-keys 0.22.7 enabled dokku core ssh-keys plugin
|
||||
storage 0.22.7 enabled dokku core storage plugin
|
||||
tags 0.22.7 enabled dokku core tags plugin
|
||||
tar 0.22.7 enabled dokku core tar plugin
|
||||
trace 0.22.7 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.
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<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"/>
|
||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.3\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.3\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.22.7\/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.3/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.3/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.3"
|
||||
"0.22.7"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
# Deploying with Gitlab CI
|
||||
|
||||
Gitlab-CI can be used to automatically deploy a Dokku application using the [ilyasemenov/gitlab-ci-git-push image](https://github.com/IlyaSemenov/gitlab-ci-git-push) docker image.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Make sure you have a Gitlab account and a Dokku project hosted on Gitlab. This method works whether if you are using buildpacks or Dockerfile.
|
||||
|
||||
Make sure you have set up an app on the remote machine following [these instructions](http://dokku.viewdocs.io/dokku/deployment/application-deployment/) and can successfully deploy to it from the local machine.
|
||||
|
||||
## Deploy automatically to production
|
||||
|
||||
### Add a secret variable
|
||||
|
||||
Browse to the repository in question and visit the following path: `the Gitlab project > Settings > CI/CD.`
|
||||
|
||||
Click on `Secret variables > Expand` and fill in the blanks.
|
||||
|
||||
- Key: `SSH_PRIVATE_KEY`
|
||||
- Value: paste in an SSH private key registered in Dokku:
|
||||
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
- Environment scope: `production` (This make sure that `SSH_PRIVATE_KEY` is not available on merge requests or tests)
|
||||
- Protected: Do not check this checkbox unless you know what you are doing
|
||||
|
||||
### Add CI script
|
||||
|
||||
Create a file named `.gitlab-ci.yml` at the root directory of the repository with the following contents:
|
||||
|
||||
```yaml
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
APP_NAME: node-js-app
|
||||
|
||||
deploy:
|
||||
image: ilyasemenov/gitlab-ci-git-push
|
||||
stage: deploy
|
||||
environment:
|
||||
name: production
|
||||
url: https://$APP_NAME.dokku.me/
|
||||
only:
|
||||
- master
|
||||
script:
|
||||
- git-push ssh://dokku@dokku.me:22/$APP_NAME
|
||||
```
|
||||
|
||||
You will need to modify the `APP_NAME` variable to the correct value for your application name.
|
||||
|
||||
Running `git push origin master` will now trigger a gitlab-ci pipeline that will automatically deploy your application to your Dokku server. Go to your project on Gitlab and visit "Project > Pipelines" to see the deployment log.
|
||||
|
||||
|
||||
## Review Applications
|
||||
|
||||
One useful feature of gitlab is to be able to create review applications for non-production branches. This allows teams to review changes _before_ they are pushed to production. First, recreate the `SSH_PRIVATE_KEY` secret - do not delete the existing secret - but scoped to the `review/*` environment. This will allow non-production gitlab environments access to the secret.
|
||||
|
||||
Next, we'll need to create the `review_app` gitlab job in our `.gitlab-ci.yaml`.
|
||||
|
||||
```yaml
|
||||
review_app:
|
||||
image: ilyasemenov/gitlab-ci-git-push
|
||||
stage: deploy
|
||||
environment:
|
||||
name: review/$CI_COMMIT_REF_NAME
|
||||
url: https://$CI_ENVIRONMENT_SLUG.dokku.me/
|
||||
on_stop: stop_review_app
|
||||
only:
|
||||
- branches
|
||||
except:
|
||||
- master
|
||||
script:
|
||||
- mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||
- ssh-keyscan -H 22 "dokku.me" >> ~/.ssh/known_hosts
|
||||
- ssh -t dokku@dokku.me -- apps:clone --ignore-existing --skip-deploy "$APP_NAME" "$CI_ENVIRONMENT_SLUG"
|
||||
- git-push ssh://dokku@dokku.me:22/$CI_ENVIRONMENT_SLUG
|
||||
```
|
||||
|
||||
The first two lines ensure that Gitlab can talk to the Dokku server. Next, we take advantage of the `apps:clone` command, and clone the existing application and all of it's configuration to a new location. If the new application already exists, the third line of the `script` step will be ignored. We also ignore the first deploy script to speed up the cloning process. Finally, the fourth line of the `script` step will deploy the code as normal.
|
||||
|
||||
The above only runs for non-master branches, and will _also_ trigger an `on_stop` job called `stop_review_app`. When the branch is deleted or the code is merged, the `stop_review_app` job will be triggered.
|
||||
|
||||
```yaml
|
||||
stop_review_app:
|
||||
image: ilyasemenov/gitlab-ci-git-push
|
||||
stage: deploy
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
environment:
|
||||
name: review/$CI_COMMIT_REF_NAME
|
||||
action: stop
|
||||
when: manual
|
||||
script:
|
||||
- mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||
- ssh-keyscan -H 22 "dokku.me" >> ~/.ssh/known_hosts
|
||||
- ssh -t dokku@dokku.me -- --force apps:destroy "$CI_ENVIRONMENT_SLUG"
|
||||
```
|
||||
|
||||
The `stop_review_app` step will delete the temporary application, cleaning up now unused server resources.
|
||||
|
||||
Going further, the following modifications can be done:
|
||||
|
||||
- Notify via chat whenever a review application is created/destroyed.
|
||||
- Push to a separate, staging server as opposed to a production server.
|
||||
- Clone a "staging" application so that review applications do not affect production datasets.
|
||||
@@ -87,6 +87,7 @@ The following config variables have special meanings and can be set in a variety
|
||||
| `PLUGIN_CORE_AVAILABLE_PATH` | `$PLUGIN_CORE_PATH/available"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that stores all available core plugins. |
|
||||
| `PLUGIN_CORE_ENABLED_PATH` | `$PLUGIN_CORE_PATH/enabled"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that stores all enabled core plugins. |
|
||||
| `DOKKU_LOGS_DIR` | `/var/log/dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where dokku logs should be written to. |
|
||||
| `DOKKU_LOGS_HOST_DIR` | `$DOKKU_LOGS_DIR` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | A path on the host that will be mounted into the vector logging container. |
|
||||
| `DOKKU_EVENTS_LOGFILE` | `$DOKKU_LOGS_DIR/events.log` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | Where the events log file is written to. |
|
||||
| `DOKKU_APP_NAME` | none | `--app APP` flag | Name of application to work on. Respected by core plugins. |
|
||||
| `DOKKU_APPS_FORCE_DELETE` | none | `--force` flag | Whether to force delete an application. Also used by other plugins for destructive actions. |
|
||||
|
||||
25
docs/deployment/continuous-integration/generic.md
Normal file
25
docs/deployment/continuous-integration/generic.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Generic CI/CD Integration
|
||||
|
||||
In cases where there is no direct or documented integration available, the Dokku project provides an [Official Docker Image](https://github.com/dokku/ci-docker-image) for use in Continuous Integration/Continuous Deployment (CI/CD) systems.
|
||||
|
||||
Assuming a Docker image can be run as a CI task with environment variables injected, the following CI systems will have their variables automatically detected:
|
||||
|
||||
- [circleci](https://circleci.com/)
|
||||
- [cloudbees](https://www.cloudbees.com/)
|
||||
- [drone](https://www.drone.io/)
|
||||
- [github actions](https://github.com/features/actions)
|
||||
- [gitlab-ci](https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/)
|
||||
- [semaphoreci](https://semaphoreci.com/)
|
||||
- [travisci](https://travis-ci.com/)
|
||||
|
||||
## Simple Usage
|
||||
|
||||
The simplest usage of the image is as follows.
|
||||
|
||||
```shell
|
||||
# where the `.env` file contains `GIT_REMOTE_URL` and `SSH_PRIVATE_KEY`
|
||||
|
||||
docker run --rm -v="$PWD:/app" --env-file=.env dokku/ci-docker-image dokku-deploy
|
||||
```
|
||||
|
||||
For more configuration examples and further documentation, see the [ci-docker-image](https://github.com/dokku/ci-docker-image) readme.
|
||||
31
docs/deployment/continuous-integration/github-actions.md
Normal file
31
docs/deployment/continuous-integration/github-actions.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Github Actions
|
||||
|
||||
The Dokku project has an official Githb Action available on the [Github Marketplace](https://github.com/marketplace/actions/dokku). The simplest usage example is as follows:
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: 'deploy'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cloning repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Push to dokku
|
||||
uses: dokku/github-action@v1
|
||||
with:
|
||||
git_remote_url: 'ssh://dokku@dokku.me:22/appname'
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
```
|
||||
|
||||
|
||||
For further usage documentation and other advanced examples, see the entry on the [Github Marketplace](https://github.com/marketplace/actions/dokku).
|
||||
25
docs/deployment/continuous-integration/gitlab-ci.md
Normal file
25
docs/deployment/continuous-integration/gitlab-ci.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Gitlab CI
|
||||
|
||||
Gitlab-CI can be used to automatically deploy a Dokku application via the official the [dokku/ci-docker-image](https://github.com/dokku/ci-docker-image). The simplest example is as follows:
|
||||
|
||||
```
|
||||
---
|
||||
image: dokku/ci-docker-image
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
GIT_DEPTH: 0
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
variables:
|
||||
GIT_REMOTE_URL: ssh://dokku@dokku.me:22/appname
|
||||
script: dokku-deploy
|
||||
after_script: dokku-unlock
|
||||
```
|
||||
|
||||
For further usage documentation and other advanced examples, see Dokku's [gitlab-ci](https://github.com/dokku/gitlab-ci) repository.
|
||||
@@ -2,7 +2,12 @@
|
||||
|
||||
```
|
||||
logs <app> [-h] [-t] [-n num] [-q] [-p process] # Display recent log output
|
||||
logs:failed [--parallel count] [--all|<app>] # Shows the last failed deploy logs
|
||||
logs:failed [--all|<app>] # Shows the last failed deploy logs
|
||||
logs:report [<app>] [<flag>] # Displays a logs report for one or more apps
|
||||
logs:set [--global|<app>] <key> <value> # Set or clear a logs property for an app
|
||||
logs:vector-logs [--num num] [--tail] # Display vector log output
|
||||
logs:vector-start # Start the vector logging container
|
||||
logs:vector-stop # Stop the vector logging container
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -40,7 +45,7 @@ will show logs continually from the web process.
|
||||
|
||||
In some cases, it may be useful to retrieve the logs from a previously failed deploy.
|
||||
|
||||
You can retrieve these logs by using the `logs:failed` command
|
||||
You can retrieve these logs by using the `logs:failed` command.
|
||||
|
||||
```shell
|
||||
dokku logs:failed node-js-app
|
||||
@@ -51,3 +56,94 @@ You may also fetch all failed app logs by using the `--all` flag.
|
||||
```shell
|
||||
dokku logs:failed --all
|
||||
```
|
||||
|
||||
### Vector Logging Shipping
|
||||
|
||||
> New as of 0.22.6
|
||||
|
||||
Vector is an open-source, lightweight and ultra-fast tool for building observability pipelines. Dokku integrates with it for shipping container logs for the `docker-local` scheduler. Users may configure log-shipping on a per-app or global basis, neither of which interfere with the `dokku logs` commands.
|
||||
|
||||
#### Starting the Vector container
|
||||
|
||||
> Warning: While the default vector image may be updated over time, this will not impact running vector containers. Users are encouraged to view any Dokku and Vector changelogs to ensure their system will continue running as expected.
|
||||
|
||||
Vector may be started via the `logs:vector-start` command.
|
||||
|
||||
```shell
|
||||
dokku logs:vector-start
|
||||
```
|
||||
|
||||
This will start a new container named `vector` with Dokku's vector config mounted and ready for use. If a running container already exists, this command will do nothing. Additionally, if a container exists but is not running, this command will attempt to start the container.
|
||||
|
||||
While the default vector image is hardcoded, users may specify an alternative via the `--vector-image` flag:
|
||||
|
||||
```shell
|
||||
dokku logs:vector-start --vector-image timberio/vector:latest-debian
|
||||
```
|
||||
|
||||
The `vector` container will be started with the following volume mounts:
|
||||
|
||||
- `/var/lib/dokku/data/logs/vector.json:/etc/vector/vector.json`
|
||||
- `/var/run/docker.sock:/var/run/docker.sock`
|
||||
- `/var/log/dokku/apps:/var/log/dokku/apps`
|
||||
|
||||
The final volume mount - `/var/log/dokku/apps` - may be used for users that wish to ship logs to a file on disk that may be later logrotated. This directory is owned by the `dokku` user and group, with permissions set to `0755`. At this time, log-rotation is not configured for this directory.
|
||||
|
||||
#### Stopping the Vector container
|
||||
|
||||
Vector may be stopped via the `logs:vector-stop` command.
|
||||
|
||||
```shell
|
||||
dokku logs:vector-stop
|
||||
```
|
||||
|
||||
The `vector` container will be stopped and removed from the system. If the container is not running, this command will do nothing.
|
||||
|
||||
#### Configuring a log sink
|
||||
|
||||
Vector uses the concept of log "sinks" to send logs to a given endpoint. Log sinks may be configured globally or on a per-app basis by specifying a `vector-sink` in DSN form with the `logs:set` command. Specifying a sink value will reload any running vector container.
|
||||
|
||||
```shell
|
||||
# setting the sink value in quotes is encouraged to avoid
|
||||
# issues with ampersand encoding in shell commands
|
||||
dokku logs:set node-js-app sink "console://?encoding[codec]=json"
|
||||
```
|
||||
|
||||
A sink may be removed by setting an empty value, which will also reload the running vector container.
|
||||
|
||||
```shell
|
||||
dokku logs:set node-js-app vector-sink
|
||||
```
|
||||
|
||||
Only one sink may be specified on a per-app basis at a given time.
|
||||
|
||||
Log sinks can also be specified globally by specifying the `--global` flag to `logs:set` with no app name specified:
|
||||
|
||||
```shell
|
||||
dokku logs:set --global vector-sink "console://?encoding[codec]=json"
|
||||
```
|
||||
|
||||
As with app-specific sink settings, the global value may also be cleared by setting no value.
|
||||
|
||||
```shell
|
||||
dokku logs:set --global vector-sink
|
||||
```
|
||||
|
||||
##### Log Sink DSN Format
|
||||
|
||||
The DSN form of a sink is as follows:
|
||||
|
||||
```
|
||||
SINK_TYPE://?SINK_OPTIONS
|
||||
```
|
||||
|
||||
Valid values for `SINK_TYPE` include all log vector log sinks, while `SINK_OPTIONS` is a query-string form for the sink's options. The following is a short description on how to set various values:
|
||||
|
||||
- `bool`: form: `key=bool`
|
||||
- `string`: form: `key=string`
|
||||
- `int`: form: `key=int`
|
||||
- `[string]`: form: `key[]=string`
|
||||
- `[int]`: form: `key[]=int`
|
||||
- `table`: form: `option[key]=value
|
||||
|
||||
Please read the [sink documentation](https://vector.dev/docs/reference/sinks/) for your sink of choice to configure the sink as desired.
|
||||
|
||||
@@ -157,6 +157,38 @@ https://static.dokku.me/logo.png
|
||||
|
||||
While a full URL may be used in order to invoke checks, if you are using relative URLs, the port *must* be omitted.
|
||||
|
||||
> Changed as of 0.22.5
|
||||
|
||||
Please note that dollar sign bracket characters (`{` and `}`) must be escaped when used within a `CHECKS` file. Escaping follows golang template rules. The proper way to do this is via one of the following methods:
|
||||
|
||||
```
|
||||
# escaping the `{` character
|
||||
# using double-quotes
|
||||
{{"{"}}
|
||||
|
||||
# using raw string constants
|
||||
{{`{`}}
|
||||
|
||||
# escaping the `}` character
|
||||
# using double-quotes
|
||||
{{"}"}}
|
||||
|
||||
# using raw string constants
|
||||
{{`}`}}
|
||||
```
|
||||
|
||||
### Templating Checks Files
|
||||
|
||||
> New as of 0.22.5
|
||||
|
||||
An app's `CHECKS` file is sent through a single pass of the [`sigil`](https://github.com/gliderlabs/sigil/) templating tool. This enables usage of Golang templating within application `CHECKS` files. In addition to general templating access, access to app environment variables is also allowed via the `var` function:
|
||||
|
||||
```
|
||||
{{ var "SOME_ENV_VAR" }}
|
||||
```
|
||||
|
||||
This may be useful if certain zero-downtime checks require access to an app-specific value, such as a domain name.
|
||||
|
||||
### Check settings
|
||||
|
||||
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.
|
||||
|
||||
@@ -451,7 +451,6 @@ echo -n "$STDIN$output"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -470,7 +469,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
APP="$1"; IMAGE_SOURCE_TYPE="$2"
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -488,7 +486,6 @@ verify_app_name "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; $IMAGE_SOURCE_TYPE="$2" IMAGE_TAG="$3"; PROC_TYPE="$4"; CONTAINER_INDEX="$5"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -506,7 +503,6 @@ verify_app_name "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_SOURCE_TYPE="$3"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -526,7 +522,6 @@ verify_app_name "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1060,7 +1055,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1077,7 +1072,7 @@ APP="$1"; verify_app_name "$APP"
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1199,7 +1194,7 @@ sudo service haproxy reload
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
TMP_WORK_DIR="$2"
|
||||
REV="$3" # optional, may not be sent for tar-based builds
|
||||
|
||||
@@ -1224,7 +1219,7 @@ popd >/dev/null
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/haproxy/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
|
||||
haproxy-build-config "$APP"
|
||||
```
|
||||
@@ -1244,7 +1239,6 @@ haproxy-build-config "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1267,7 +1261,6 @@ verify_app_name "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1287,7 +1280,6 @@ verify_app_name "$APP"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1373,7 +1365,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
if [[ -d $GULP_CACHE_DIR ]]; then
|
||||
docker run "${DOCKER_COMMIT_LABEL_ARGS[@]}" --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||
@@ -1394,7 +1385,6 @@ fi
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1 "Running gulp"
|
||||
CID=$(docker run "${DOCKER_COMMIT_LABEL_ARGS[@]}" -d $IMAGE /bin/bash -c "cd /app && gulp default")
|
||||
@@ -1415,7 +1405,7 @@ docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1432,7 +1422,7 @@ APP="$1"; verify_app_name "$APP"
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
@@ -1470,7 +1460,6 @@ echo "$APP" > "$TMP_WORK_DIR/dokku-is-awesome"
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1 "Installing GraphicsMagick..."
|
||||
|
||||
@@ -1518,7 +1507,6 @@ APP="$1"; IMAGE_TAG="$2";
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
@@ -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.3-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.22.7-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'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Pull the dokku/dokku image:
|
||||
|
||||
```shell
|
||||
docker pull dokku/dokku:0.22.3
|
||||
docker pull dokku/dokku:0.22.7
|
||||
```
|
||||
|
||||
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.3
|
||||
dokku/dokku:0.22.7
|
||||
```
|
||||
|
||||
Dokku is run in the following configuration:
|
||||
|
||||
@@ -6,7 +6,7 @@ Dokku is an extensible, open source Platform as a Service that runs on a single
|
||||
|
||||
To start using Dokku, you'll need a system that meets the following minimum requirements:
|
||||
|
||||
- A fresh installation of [Ubuntu 16.04/18.04 x64](https://www.ubuntu.com/download), [Debian 9+ x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
|
||||
- A fresh installation of [Ubuntu 16.04/18.04/20.04 x64](https://www.ubuntu.com/download), [Debian 9+ x64](https://www.debian.org/distrib/) or [CentOS 7 x64](https://www.centos.org/download/) *(experimental)* with the FQDN set <sup>[1]</sup>
|
||||
- At least 1 GB of system memory <sup>[2]</sup>
|
||||
|
||||
You can *optionally* have a domain name pointed at the host's IP, though this is not necessary.
|
||||
@@ -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.3/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.22.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
|
||||
@@ -8,15 +8,34 @@ If you’re stuck, there are a number of places you can get help:
|
||||
|
||||
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using Dokku.
|
||||
|
||||
## The IRC and Slack Channels
|
||||
## Monitored Locations
|
||||
|
||||
The [Code Of Conduct](https://github.com/dokku/.github/blob/master/CODE_OF_CONDUCT.md) applies to all actively monitored Dokku discussion areas. Please be mindful of your neighbors on the internet.
|
||||
|
||||
### Forums
|
||||
|
||||
- [Github Discussions](https://github.com/dokku/dokku/discussions)
|
||||
|
||||
GitHub Discussions is a new way for the Dokku community to interact with each other! This is a place to ask questions to the community or discuss potential feature requests before filing issues.
|
||||
|
||||
### The Slack Channel
|
||||
|
||||
- [irc.freenode.net/#dokku](https://webchat.freenode.net/?channels=dokku)
|
||||
- [Gliderlabs Slack](https://glider-slackin.herokuapp.com/) (Join the `#dokku` channel)
|
||||
|
||||
If you’re stumped, give us a holler in the Dokku IRC or Slack channels. Someone from the development team is usually there, especially during the daylight hours for North and South America users. We’d love to hear from you, whether you need some help, want to find users in your area, or would like to donate your brand new sports car.
|
||||
If you’re stumped, give us a holler in the Dokku Slack channel. Someone from the development team is usually there, especially during the daylight hours for North and South American users. We’d love to hear from you, whether you need some help, want to find users in your area, or would like to donate your brand new sports car.
|
||||
|
||||
## Stack Overflow
|
||||
## Unmonitored Locations
|
||||
|
||||
- [https://stackoverflow.com/questions/tagged/dokku](https://stackoverflow.com/questions/tagged/dokku)
|
||||
You may find help on these locations, but they are not actively monitored by the development team. The [Code of Conduct](https://github.com/dokku/.github/blob/master/CODE_OF_CONDUCT.md) still applies.
|
||||
|
||||
### Stack Overflow
|
||||
|
||||
- [The Dokku tag on Stack Overflow](https://stackoverflow.com/questions/tagged/dokku)
|
||||
|
||||
Tag your questions with `dokku` to enable existing users of Stack Overflow to find your questions.
|
||||
|
||||
### IRC (on freenode)
|
||||
|
||||
- [irc.freenode.net/#dokku](https://webchat.freenode.net/?channels=dokku)
|
||||
|
||||
This location isn't as well monitored as Slack, and loses history.
|
||||
|
||||
@@ -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.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">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.7/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.7/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.7/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.7/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.7/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.7/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.7/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.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.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="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.3/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
.sponsors {
|
||||
@@ -91,6 +91,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://glider-slackin.herokuapp.com/">Slack</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://github.com/dokku/dokku/discussions">Forums</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://gliderlabs.us10.list-manage.com/subscribe?u=49c4b06ffd30bcf49ec53c277&id=f526006fd5">Newsletter</a>
|
||||
</li>
|
||||
@@ -127,12 +130,12 @@
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.3/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.22.7/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.22.3 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.22.7 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.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">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.7/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.7/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.7/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.7/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.7/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.7/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.7/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.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.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="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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.3/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.22.7/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>
|
||||
@@ -84,6 +84,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://glider-slackin.herokuapp.com/">Slack</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://github.com/dokku/dokku/discussions">Forums</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://gliderlabs.us10.list-manage.com/subscribe?u=49c4b06ffd30bcf49ec53c277&id=f526006fd5">Newsletter</a>
|
||||
</li>
|
||||
@@ -172,12 +175,16 @@
|
||||
<a href="/{{NAME}}/development/testing/" class="list-group-item">Running Tests</a>
|
||||
<a href="/{{NAME}}/development/release-process/" class="list-group-item">Release Process</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Continuous Integration</a>
|
||||
<a href="/{{NAME}}/deployment/continuous-integration/github-actions/" class="list-group-item">Github Actions</a>
|
||||
<a href="/{{NAME}}/deployment/continuous-integration/gitlab-ci/" class="list-group-item">Gitlab CI</a>
|
||||
<a href="/{{NAME}}/deployment/continuous-integration/generic/" class="list-group-item">Generic</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Community Contributions</a>
|
||||
<a href="/{{NAME}}/community/clients/" class="list-group-item">Clients</a>
|
||||
<a href="/{{NAME}}/community/plugins/" class="list-group-item">Plugins</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Community Tutorials</a>
|
||||
<a href="/{{NAME}}/community/tutorials/deploying-with-gitlab-ci/" class="list-group-item">Deploying with Gitlab CI</a>
|
||||
<a href="/{{NAME}}/community/tutorials/run-on-external-volume/" class="list-group-item">Run on External Volume</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
"dokku-events-logs": "advanced-usage/event-logs/",
|
||||
"dokku-storage": "advanced-usage/persistent-storage/",
|
||||
|
||||
"community/tutorials/deploying-with-gitlab-ci": "deployment/continuous-integration/gitlab-ci/",
|
||||
|
||||
"plugins": "community/plugins/"
|
||||
}
|
||||
}
|
||||
|
||||
1
dokku
1
dokku
@@ -59,6 +59,7 @@ export DOKKU_VALID_EXIT=0
|
||||
export DOKKU_PID="$BASHPID"
|
||||
|
||||
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
|
||||
export DOKKU_LOGS_HOST_DIR=${DOKKU_LOGS_HOST_DIR:=$DOKKU_LOGS_DIR}
|
||||
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"}
|
||||
|
||||
export DOKKU_CONTAINER_LABEL=dokku
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -8,8 +8,7 @@ cmd-urls() {
|
||||
declare cmd="url"
|
||||
declare APP="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
|
||||
verify_app_name "$APP"
|
||||
get_app_urls "$@"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -2,6 +2,7 @@ package appjson
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
// AppJSON is a struct that represents an app.json file as understood by Dokku
|
||||
@@ -130,16 +132,31 @@ func getReleaseCommand(appName string, image string) string {
|
||||
}
|
||||
|
||||
func getDokkuAppShell(appName string) string {
|
||||
dokkuAppShell := "/bin/bash"
|
||||
if b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...); strings.TrimSpace(string(b[:])) != "" {
|
||||
dokkuAppShell = strings.TrimSpace(string(b[:]))
|
||||
shell := "/bin/bash"
|
||||
globalShell := ""
|
||||
appShell := ""
|
||||
|
||||
ctx := context.Background()
|
||||
errs, ctx := errgroup.WithContext(ctx)
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-get-global", []string{"DOKKU_APP_SHELL"}...)
|
||||
globalShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
errs.Go(func() error {
|
||||
b, _ := common.PlugnTriggerOutput("config-global", []string{"DOKKU_APP_SHELL"}...)
|
||||
appShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
|
||||
errs.Wait()
|
||||
if appShell != "" {
|
||||
shell = appShell
|
||||
} else if globalShell != "" {
|
||||
shell = globalShell
|
||||
}
|
||||
|
||||
if b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...); strings.TrimSpace(string(b[:])) != "" {
|
||||
dokkuAppShell = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
return dokkuAppShell
|
||||
return shell
|
||||
}
|
||||
|
||||
func executeScript(appName string, imageTag string, phase string) error {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
module github.com/dokku/dokku/plugins/app-json
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
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/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
|
||||
)
|
||||
|
||||
replace github.com/dokku/dokku/plugins/common => ../common
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
|
||||
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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core app-json plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -12,15 +12,7 @@ import (
|
||||
|
||||
// checks if an app exists
|
||||
func appExists(appName string) error {
|
||||
if err := common.IsValidAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !common.DirectoryExists(common.AppRoot(appName)) {
|
||||
return fmt.Errorf("App %s does not exist", appName)
|
||||
}
|
||||
|
||||
return nil
|
||||
return common.VerifyAppName(appName)
|
||||
}
|
||||
|
||||
// checks if an app is locked
|
||||
@@ -52,10 +44,6 @@ func createApp(appName string) error {
|
||||
|
||||
// destroys an app
|
||||
func destroyApp(appName string) error {
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if os.Getenv("DOKKU_APPS_FORCE_DELETE") != "1" {
|
||||
if err := common.AskForDestructiveConfirmation(appName, "app"); err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/dokku/dokku/plugins/apps
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
|
||||
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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -12,23 +12,41 @@ func ReportSingleApp(appName, infoFlag string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
flags := map[string]common.ReportFunc{
|
||||
"--app-dir": reportDir,
|
||||
"--app-deploy-source": reportDeploySource,
|
||||
"--app-locked": reportLocked,
|
||||
}
|
||||
|
||||
flagKeys := []string{}
|
||||
for flagKey := range flags {
|
||||
flagKeys = append(flagKeys, flagKey)
|
||||
}
|
||||
|
||||
trimPrefix := false
|
||||
uppercaseFirstCharacter := true
|
||||
infoFlags := common.CollectReport(appName, infoFlag, flags)
|
||||
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
|
||||
}
|
||||
|
||||
func reportDir(appName string) string {
|
||||
return common.AppRoot(appName)
|
||||
}
|
||||
|
||||
func reportDeploySource(appName string) string {
|
||||
deploySource := ""
|
||||
if b, err := common.PlugnTriggerSetup("deploy-source", []string{appName}...).SetInput("").Output(); err != nil {
|
||||
deploySource = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
return deploySource
|
||||
}
|
||||
|
||||
func reportLocked(appName string) string {
|
||||
locked := "false"
|
||||
if appIsLocked(appName) {
|
||||
locked = "true"
|
||||
}
|
||||
|
||||
infoFlags := map[string]string{
|
||||
"--app-dir": common.AppRoot(appName),
|
||||
"--app-deploy-source": deploySource,
|
||||
"--app-locked": locked,
|
||||
}
|
||||
|
||||
trimPrefix := false
|
||||
uppercaseFirstCharacter := true
|
||||
return common.ReportSingleApp("app", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
|
||||
return locked
|
||||
}
|
||||
@@ -65,8 +65,8 @@ func main() {
|
||||
err = apps.CommandRename(oldAppName, newAppName, *skipDeploy)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("apps:report", flag.ExitOnError)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("apps", os.Args[2:])
|
||||
if err == nil {
|
||||
osArgs, infoFlag, flagErr := common.ParseReportArgs("apps", os.Args[2:])
|
||||
if flagErr == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = apps.CommandReport(appName, infoFlag)
|
||||
|
||||
@@ -79,10 +79,6 @@ func CommandDestroy(appName string, force bool) error {
|
||||
|
||||
// CommandExists checks if an app exists
|
||||
func CommandExists(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
return appExists(appName)
|
||||
}
|
||||
|
||||
@@ -104,10 +100,6 @@ func CommandList() error {
|
||||
|
||||
// CommandLock locks an app for deployment
|
||||
func CommandLock(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -123,10 +115,6 @@ func CommandLock(appName string) error {
|
||||
|
||||
// CommandLocked checks if an app is locked for deployment
|
||||
func CommandLocked(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -206,10 +194,6 @@ func CommandReport(appName string, infoFlag string) error {
|
||||
|
||||
// CommandUnlock unlocks an app for deployment
|
||||
func CommandUnlock(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-cnb plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-dockerfile plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core builder-herokuish plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -13,7 +13,6 @@ trigger-builder-herokuish-pre-build-buildpack() {
|
||||
local DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" "--change" "LABEL org.label-schema.vendor=dokku" "--change" "LABEL com.dokku.app-name=$APP")
|
||||
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
|
||||
|
||||
verify_app_name "$APP"
|
||||
IMAGE=$(get_app_image_name "$APP")
|
||||
|
||||
[[ -z $(config_get --global CURL_CONNECT_TIMEOUT) ]] && config_set --global CURL_CONNECT_TIMEOUT=90
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/dokku/dokku/plugins/buildpacks
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
|
||||
@@ -6,3 +6,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
|
||||
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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core buildpacks plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -12,16 +12,26 @@ func ReportSingleApp(appName, infoFlag string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
if err != nil {
|
||||
return err
|
||||
flags := map[string]common.ReportFunc{
|
||||
"--buildpacks-list": reportList,
|
||||
}
|
||||
|
||||
infoFlags := map[string]string{
|
||||
"--buildpacks-list": strings.Join(buildpacks, ","),
|
||||
flagKeys := []string{}
|
||||
for flagKey := range flags {
|
||||
flagKeys = append(flagKeys, flagKey)
|
||||
}
|
||||
|
||||
trimPrefix := false
|
||||
uppercaseFirstCharacter := true
|
||||
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
|
||||
infoFlags := common.CollectReport(appName, infoFlag, flags)
|
||||
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, flagKeys, trimPrefix, uppercaseFirstCharacter)
|
||||
}
|
||||
|
||||
func reportList(appName string) string {
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return strings.Join(buildpacks, ",")
|
||||
}
|
||||
@@ -44,8 +44,8 @@ func main() {
|
||||
err = buildpacks.CommandRemove(appName, buildpack, *index)
|
||||
case "report":
|
||||
args := flag.NewFlagSet("buildpacks:report", flag.ExitOnError)
|
||||
osArgs, infoFlag, err := common.ParseReportArgs("buildpacks", os.Args[2:])
|
||||
if err == nil {
|
||||
osArgs, infoFlag, flagErr := common.ParseReportArgs("buildpacks", os.Args[2:])
|
||||
if flagErr == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = buildpacks.CommandReport(appName, infoFlag)
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
// CommandAdd implements buildpacks:add
|
||||
func CommandAdd(appName string, buildpack string, index int) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
buildpack, err := validBuildpackURL(buildpack)
|
||||
@@ -23,8 +23,8 @@ func CommandAdd(appName string, buildpack string, index int) error {
|
||||
|
||||
// CommandClear implements buildpacks:clear
|
||||
func CommandClear(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return common.PropertyDelete("buildpacks", appName, "buildpacks")
|
||||
@@ -32,8 +32,8 @@ func CommandClear(appName string) error {
|
||||
|
||||
// CommandList implements buildpacks:list
|
||||
func CommandList(appName string) (err error) {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
@@ -50,8 +50,8 @@ func CommandList(appName string) (err error) {
|
||||
|
||||
// CommandRemove implements buildpacks:remove
|
||||
func CommandRemove(appName string, buildpack string, index int) (err 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 index != 0 && buildpack != "" {
|
||||
@@ -123,8 +123,8 @@ func CommandReport(appName string, infoFlag string) error {
|
||||
|
||||
// CommandSet implements buildpacks:set
|
||||
func CommandSet(appName string, buildpack string, index int) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
buildpack, err := validBuildpackURL(buildpack)
|
||||
|
||||
@@ -6,7 +6,6 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
is_ssl_enabled() {
|
||||
declare desc="returns 0 if ssl is enabled for given app"
|
||||
local APP=$1
|
||||
verify_app_name "$APP"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
if [[ -e "$APP_SSL_PATH/server.crt" ]] && [[ -e "$APP_SSL_PATH/server.key" ]]; then
|
||||
@@ -19,7 +18,6 @@ is_ssl_enabled() {
|
||||
get_ssl_hostnames() {
|
||||
declare desc="returns a string of ssl hostnames extracted from an app's ssl certificate"
|
||||
local APP=$1
|
||||
verify_app_name "$APP"
|
||||
local SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
local SSL_HOSTNAME=$(openssl x509 -in "$SSL_PATH/server.crt" -noout -subject | tr '/' '\n' | grep CN= | cut -c4-)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -34,7 +34,6 @@ cmd-certs-set() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" CRT_FILE="$2" KEY_FILE="$3"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ cmd-certs-generate() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" DOMAIN="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ cmd-certs-remove() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ cmd-certs-show() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" KEY_TYPE="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
is_app_proctype_checks_disabled() {
|
||||
declare desc="return true if app's proctype(s) checks are disabled"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local PROCTYPE="$2" status=false
|
||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||
|
||||
@@ -21,7 +20,6 @@ is_app_proctype_checks_disabled() {
|
||||
is_app_proctype_checks_skipped() {
|
||||
declare desc="return true if app's proctype(s) checks are skipped"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local PROCTYPE="$2" status=false
|
||||
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core checks plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/ryanuber/columnize"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
type errfunc func() error
|
||||
@@ -64,17 +65,37 @@ func CommandUsage(helpHeader string, helpContent string) {
|
||||
|
||||
// GetAppScheduler fetches the scheduler for a given application
|
||||
func GetAppScheduler(appName string) string {
|
||||
if appName == "--global" {
|
||||
appName = ""
|
||||
}
|
||||
appScheduler := ""
|
||||
globalScheduler := ""
|
||||
|
||||
ctx := context.Background()
|
||||
errs, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
if appName != "--global" {
|
||||
errs.Go(func() error {
|
||||
appScheduler = getAppScheduler(appName)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
errs.Go(func() error {
|
||||
globalScheduler = GetGlobalScheduler()
|
||||
return nil
|
||||
})
|
||||
errs.Wait()
|
||||
|
||||
if appScheduler == "" {
|
||||
appScheduler = globalScheduler
|
||||
}
|
||||
return appScheduler
|
||||
}
|
||||
|
||||
func getAppScheduler(appName string) string {
|
||||
b, _ := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_SCHEDULER"}...)
|
||||
value := strings.TrimSpace(string(b[:]))
|
||||
if value != "" {
|
||||
return value
|
||||
}
|
||||
|
||||
return GetGlobalScheduler()
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetGlobalScheduler fetchs the global scheduler
|
||||
@@ -90,27 +111,38 @@ func GetGlobalScheduler() string {
|
||||
|
||||
// GetDeployingAppImageName returns deploying image identifier for a given app, tag tuple. validate if tag is presented
|
||||
func GetDeployingAppImageName(appName, imageTag, imageRepo string) (string, error) {
|
||||
if appName == "" {
|
||||
LogFail("(GetDeployingAppImageName) APP must not be empty")
|
||||
}
|
||||
imageRemoteRepository := ""
|
||||
newImageTag := ""
|
||||
newImageRepo := ""
|
||||
|
||||
b, err := PlugnTriggerOutput("deployed-app-repository", []string{appName}...)
|
||||
if err != nil {
|
||||
ctx := context.Background()
|
||||
errs, ctx := errgroup.WithContext(ctx)
|
||||
errs.Go(func() error {
|
||||
b, err := PlugnTriggerOutput("deployed-app-repository", []string{appName}...)
|
||||
if err == nil {
|
||||
imageRemoteRepository = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
return err
|
||||
})
|
||||
errs.Go(func() error {
|
||||
b, err := PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
|
||||
if err == nil {
|
||||
newImageTag = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
errs.Go(func() error {
|
||||
b, err := PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
|
||||
if err == nil {
|
||||
newImageRepo = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
if err := errs.Wait(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
imageRemoteRepository := strings.TrimSpace(string(b[:]))
|
||||
|
||||
b, err = PlugnTriggerOutput("deployed-app-image-tag", []string{appName}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
newImageTag := strings.TrimSpace(string(b[:]))
|
||||
|
||||
b, err = PlugnTriggerOutput("deployed-app-image-repo", []string{appName}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
newImageRepo := strings.TrimSpace(string(b[:]))
|
||||
|
||||
if newImageRepo != "" {
|
||||
imageRepo = newImageRepo
|
||||
@@ -140,10 +172,6 @@ func GetAppImageRepo(appName string) string {
|
||||
// GetAppContainerIDs returns a list of docker container ids for given app and optional container_type
|
||||
func GetAppContainerIDs(appName string, containerType string) ([]string, error) {
|
||||
var containerIDs []string
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
return containerIDs, err
|
||||
}
|
||||
|
||||
appRoot := AppRoot(appName)
|
||||
containerFilePath := fmt.Sprintf("%v/CONTAINER", appRoot)
|
||||
_, err := os.Stat(containerFilePath)
|
||||
@@ -170,10 +198,6 @@ func GetAppContainerIDs(appName string, containerType string) ([]string, error)
|
||||
// GetAppRunningContainerIDs return a list of running docker container ids for given app and optional container_type
|
||||
func GetAppRunningContainerIDs(appName string, containerType string) ([]string, error) {
|
||||
var runningContainerIDs []string
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
return runningContainerIDs, err
|
||||
}
|
||||
|
||||
if !IsDeployed(appName) {
|
||||
LogFail(fmt.Sprintf("App %v has not been deployed", appName))
|
||||
}
|
||||
@@ -193,10 +217,6 @@ func GetAppRunningContainerIDs(appName string, containerType string) ([]string,
|
||||
|
||||
// GetRunningImageTag retrieves current image tag for a given app and returns empty string if no deployed containers are found
|
||||
func GetRunningImageTag(appName string) (string, error) {
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
containerIDs, err := GetAppContainerIDs(appName, "")
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -241,11 +261,6 @@ func DokkuApps() (apps []string, err error) {
|
||||
|
||||
// GetAppImageName returns image identifier for a given app, tag tuple. validate if tag is presented
|
||||
func GetAppImageName(appName, imageTag, imageRepo string) (imageName string) {
|
||||
err := VerifyAppName(appName)
|
||||
if err != nil {
|
||||
LogFail(err.Error())
|
||||
}
|
||||
|
||||
if imageRepo == "" {
|
||||
imageRepo = GetAppImageRepo(appName)
|
||||
}
|
||||
@@ -308,7 +323,7 @@ func ParseReportArgs(pluginName string, arguments []string) ([]string, string, e
|
||||
}
|
||||
|
||||
// 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 {
|
||||
func ReportSingleApp(reportType string, appName string, infoFlag string, infoFlags map[string]string, infoFlagKeys []string, trimPrefix bool, uppercaseFirstCharacter bool) error {
|
||||
flags := []string{}
|
||||
for key := range infoFlags {
|
||||
flags = append(flags, key)
|
||||
@@ -318,7 +333,11 @@ func ReportSingleApp(reportType string, appName string, infoFlag string, infoFla
|
||||
if len(infoFlag) == 0 {
|
||||
LogInfo2Quiet(fmt.Sprintf("%s %v information", appName, reportType))
|
||||
for _, k := range flags {
|
||||
v := infoFlags[k]
|
||||
v, ok := infoFlags[k]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
prefix := "--"
|
||||
if trimPrefix {
|
||||
prefix = fmt.Sprintf("--%v-", reportType)
|
||||
@@ -337,19 +356,17 @@ func ReportSingleApp(reportType string, appName string, infoFlag string, infoFla
|
||||
|
||||
for _, k := range flags {
|
||||
if infoFlag == k {
|
||||
v := infoFlags[k]
|
||||
v, ok := infoFlags[k]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
fmt.Println(v)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
keys := reflect.ValueOf(infoFlags).MapKeys()
|
||||
strkeys := make([]string, len(keys))
|
||||
for i := 0; i < len(keys); i++ {
|
||||
strkeys[i] = keys[i].String()
|
||||
}
|
||||
|
||||
return fmt.Errorf("Invalid flag passed, valid flags: %s", strings.Join(strkeys, ", "))
|
||||
sort.Strings(infoFlagKeys)
|
||||
return fmt.Errorf("Invalid flag passed, valid flags: %s", strings.Join(infoFlagKeys, ", "))
|
||||
}
|
||||
|
||||
// RightPad right-pads the string with pad up to len runes
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/codeskyblue/go-sh"
|
||||
)
|
||||
@@ -20,12 +21,45 @@ func ContainerIsRunning(containerID string) bool {
|
||||
return strings.TrimSpace(string(b[:])) == "true"
|
||||
}
|
||||
|
||||
// CopyFromImage copies a file from named image to destination
|
||||
func CopyFromImage(appName string, image string, source string, destination string) error {
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
// ContainerStart runs 'docker container start' against an existing container
|
||||
// whether that container is running or not
|
||||
func ContainerStart(containerID string) bool {
|
||||
cmd := sh.Command(DockerBin(), "container", "start", containerID)
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
if err := cmd.Run(); err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// ContainerExists checks to see if a container exists
|
||||
func ContainerExists(containerID string) bool {
|
||||
cmd := sh.Command(DockerBin(), "container", "inspect", containerID)
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
if err := cmd.Run(); err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// ContainerWaitTilReady will wait timeout seconds and then check if a container is running
|
||||
// returning an error if it is not running at the end of the timeout
|
||||
func ContainerWaitTilReady(containerID string, timeout time.Duration) error {
|
||||
time.Sleep(timeout)
|
||||
|
||||
if !ContainerIsRunning(containerID) {
|
||||
return fmt.Errorf("Container %s is not running", containerID)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CopyFromImage copies a file from named image to destination
|
||||
func CopyFromImage(appName string, image string, source string, destination string) error {
|
||||
if !VerifyImage(image) {
|
||||
return fmt.Errorf("Invalid docker image for copying content")
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ dokku_log_plugn_trigger_call() {
|
||||
|
||||
local l_hook="$1"
|
||||
shift
|
||||
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT"
|
||||
dokku_log_event "INVOKED: ${l_hook}( $* ) NAME=$NAME FINGERPRINT=$FINGERPRINT DOKKU_PID=$DOKKU_PID"
|
||||
}
|
||||
|
||||
dokku_container_log_verbose_quiet() {
|
||||
@@ -303,7 +303,6 @@ get_app_scheduler() {
|
||||
get_running_image_tag() {
|
||||
declare desc="retrieve current image tag for a given app. returns empty string if no deployed containers are found"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
|
||||
local CIDS=($(get_app_container_ids "$APP"))
|
||||
local RUNNING_IMAGE_TAG=$("$DOCKER_BIN" container inspect --format '{{ .Config.Image }}' "${CIDS[0]}" 2>/dev/null | awk -F: '{ print $2 }' || echo '')
|
||||
@@ -435,7 +434,6 @@ copy_from_image() {
|
||||
declare desc="copy file from named image to destination"
|
||||
declare IMAGE="$1" SRC_FILE="$2" DST_FILE="$3"
|
||||
local WORK_DIR=""
|
||||
verify_app_name "$APP"
|
||||
|
||||
local DOCKER_CREATE_LABEL_ARGS="--label=com.dokku.app-name=$APP"
|
||||
|
||||
@@ -483,7 +481,6 @@ get_app_container_ids() {
|
||||
declare desc="returns list of docker container ids for given app and optional container_type"
|
||||
local APP="$1"
|
||||
local CONTAINER_TYPE="$2"
|
||||
verify_app_name "$APP"
|
||||
[[ -f $DOKKU_ROOT/$APP/CONTAINER ]] && DOKKU_CIDS+=$(<"$DOKKU_ROOT/$APP/CONTAINER")
|
||||
|
||||
if [[ -n "$CONTAINER_TYPE" ]]; then
|
||||
@@ -581,7 +578,6 @@ is_app_running() {
|
||||
local APP="$1"
|
||||
|
||||
dokku_log_warn "Deprecated: ps#fn-ps-is-app-running"
|
||||
verify_app_name "$APP"
|
||||
|
||||
local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP" 2>/dev/null)
|
||||
|
||||
@@ -596,7 +592,6 @@ dokku_build() {
|
||||
declare desc="build phase"
|
||||
declare APP="$1" IMAGE_SOURCE_TYPE="$2" SOURCECODE_WORK_DIR="$3"
|
||||
|
||||
verify_app_name "$APP"
|
||||
plugn trigger builder-build "$IMAGE_SOURCE_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||
}
|
||||
|
||||
@@ -617,6 +612,7 @@ cmd-deploy() {
|
||||
declare APP="$1" IMAGE_TAG="$2"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
verify_app_name "$APP"
|
||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||
plugn trigger scheduler-deploy "$DOKKU_SCHEDULER" "$APP" "$IMAGE_TAG"
|
||||
}
|
||||
@@ -630,8 +626,6 @@ release_and_deploy() {
|
||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local DOKKU_DOCKERFILE_PORTS
|
||||
|
||||
verify_app_name "$APP"
|
||||
|
||||
if verify_image "$IMAGE"; then
|
||||
if is_image_herokuish_based "$IMAGE" "$APP"; then
|
||||
local IMAGE_SOURCE_TYPE="herokuish"
|
||||
@@ -855,7 +849,6 @@ get_app_raw_tcp_ports() {
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local DOCKERFILE_PORTS="$(config_get "$APP" DOKKU_DOCKERFILE_PORTS)"
|
||||
for p in $DOCKERFILE_PORTS; do
|
||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||
@@ -870,7 +863,6 @@ get_app_raw_tcp_ports() {
|
||||
get_container_ports() {
|
||||
declare desc="returns published ports from app containers"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local APP_CIDS="$(get_app_container_ids "$APP")"
|
||||
local cid
|
||||
|
||||
@@ -886,7 +878,6 @@ get_app_urls() {
|
||||
declare URL_TYPE="$1" APP="$2"
|
||||
local urls
|
||||
|
||||
verify_app_name "$APP"
|
||||
urls=$(plugn trigger app-urls "$APP" "$URL_TYPE")
|
||||
if [[ -n "$urls" ]]; then
|
||||
echo "$urls" | sort
|
||||
@@ -1045,7 +1036,6 @@ merge_dedupe_list() {
|
||||
acquire_app_deploy_lock() {
|
||||
declare desc="acquire advisory lock for use in git/tar deploys"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local LOCK_TYPE="${2:-waiting}"
|
||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||
local LOCK_WAITING_MSG="$APP currently has a deploy lock in place. Waiting..."
|
||||
@@ -1057,7 +1047,6 @@ acquire_app_deploy_lock() {
|
||||
release_app_deploy_lock() {
|
||||
declare desc="release advisory lock used in git/tar deploys"
|
||||
local APP="$1"
|
||||
verify_app_name "$APP"
|
||||
local APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
|
||||
|
||||
release_advisory_lock "$APP_DEPLOY_LOCK_FILE"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
module github.com/dokku/dokku/plugins/common
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
|
||||
)
|
||||
|
||||
@@ -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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -93,6 +95,28 @@ func LogVerboseQuietContainerLogs(containerID string) {
|
||||
}
|
||||
}
|
||||
|
||||
// LogVerboseQuietContainerLogsTail is the verbose log formatter for container logs with tail mode enabled
|
||||
func LogVerboseQuietContainerLogsTail(containerID string, lines int, tail bool) {
|
||||
args := []string{"container", "logs", containerID}
|
||||
if lines > 0 {
|
||||
args = append(args, "--tail", strconv.Itoa(lines))
|
||||
}
|
||||
if tail {
|
||||
args = append(args, "--follow")
|
||||
}
|
||||
sc := NewShellCmdWithArgs(DockerBin(), args...)
|
||||
stdout, _ := sc.Command.StdoutPipe()
|
||||
sc.Command.Start()
|
||||
|
||||
scanner := bufio.NewScanner(stdout)
|
||||
scanner.Split(bufio.ScanLines)
|
||||
for scanner.Scan() {
|
||||
m := scanner.Text()
|
||||
LogVerboseQuiet(m)
|
||||
}
|
||||
sc.Command.Wait()
|
||||
}
|
||||
|
||||
// LogWarn is the warning log formatter
|
||||
func LogWarn(text string) {
|
||||
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ! %s", text))
|
||||
@@ -110,7 +134,7 @@ func LogStderr(text string) {
|
||||
|
||||
// LogDebug is the debug log formatter
|
||||
func LogDebug(text string) {
|
||||
if os.Getenv("DOKKU_TRACE") == "" {
|
||||
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ? %s", text))
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
fmt.Fprintln(os.Stderr, fmt.Sprintf(" ? %s", strings.TrimPrefix(text, " ? ")))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,3 +132,35 @@ func createParallelWorkerPool(jobs chan string, results chan parallelCommandResu
|
||||
wg.Wait()
|
||||
close(results)
|
||||
}
|
||||
|
||||
// ReportFunc is a type that declares functions
|
||||
// useful for :report subcommands
|
||||
type ReportFunc func(string) string
|
||||
|
||||
// CollectReport iterates over a set of report functions
|
||||
// to collect the :report output in parallel
|
||||
func CollectReport(appName string, infoFlag string, flags map[string]ReportFunc) map[string]string {
|
||||
var sm sync.Map
|
||||
var wg sync.WaitGroup
|
||||
for flag, fn := range flags {
|
||||
if infoFlag != "" && infoFlag != flag {
|
||||
continue
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
go func(flag string, fn ReportFunc) {
|
||||
defer wg.Done()
|
||||
s := fn(appName)
|
||||
sm.Store(flag, s)
|
||||
}(flag, fn)
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
infoFlags := map[string]string{}
|
||||
sm.Range(func(key interface{}, value interface{}) bool {
|
||||
infoFlags[key.(string)] = value.(string)
|
||||
return true
|
||||
})
|
||||
|
||||
return infoFlags
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core common plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -12,9 +12,14 @@ import (
|
||||
)
|
||||
|
||||
// CommandPropertySet is a generic function that will set a property for a given plugin/app combination
|
||||
func CommandPropertySet(pluginName, appName, property, value string, properties map[string]string) {
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
LogFail(err.Error())
|
||||
func CommandPropertySet(pluginName, appName, property, value string, properties map[string]string, globalProperties map[string]bool) {
|
||||
if appName != "--global" {
|
||||
if err := VerifyAppName(appName); err != nil {
|
||||
LogFail(err.Error())
|
||||
}
|
||||
}
|
||||
if appName == "--global" && !globalProperties[property] {
|
||||
LogFail("Property cannot be specified globally")
|
||||
}
|
||||
if property == "" {
|
||||
LogFail("No property specified")
|
||||
|
||||
@@ -80,21 +80,34 @@ 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) {
|
||||
rescueStderr := os.Stderr
|
||||
r, w, _ := os.Pipe()
|
||||
os.Stderr = w
|
||||
out, err := PlugnTriggerSetup(triggerName, args...).Output()
|
||||
w.Close()
|
||||
LogDebug(fmt.Sprintf("plugn trigger %s %v", triggerName, args))
|
||||
rE, wE, _ := os.Pipe()
|
||||
rO, wO, _ := os.Pipe()
|
||||
session := PlugnTriggerSetup(triggerName, args...)
|
||||
session.Stderr = wE
|
||||
session.Stdout = wO
|
||||
err := session.Run()
|
||||
wE.Close()
|
||||
wO.Close()
|
||||
|
||||
readStderr, _ := ioutil.ReadAll(r)
|
||||
os.Stderr = rescueStderr
|
||||
readStderr, _ := ioutil.ReadAll(rE)
|
||||
readStdout, _ := ioutil.ReadAll(rO)
|
||||
|
||||
var stderr error
|
||||
stderr := string(readStderr[:])
|
||||
if err != nil {
|
||||
stderr = fmt.Errorf(string(readStderr[:]))
|
||||
err = fmt.Errorf(stderr)
|
||||
}
|
||||
|
||||
return out, stderr
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
for _, line := range strings.Split(stderr, "\n") {
|
||||
LogDebug(fmt.Sprintf("plugn trigger %s stderr: %s", triggerName, line))
|
||||
}
|
||||
for _, line := range strings.Split(string(readStdout[:]), "\n") {
|
||||
LogDebug(fmt.Sprintf("plugn trigger %s stdout: %s", triggerName, line))
|
||||
}
|
||||
}
|
||||
|
||||
return readStdout, err
|
||||
}
|
||||
|
||||
// PlugnTriggerSetup sets up a plugn trigger call
|
||||
|
||||
@@ -13,7 +13,6 @@ trigger-config-docker-args() {
|
||||
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||
STDIN=$(cat)
|
||||
trigger="$0 config_docker_args"
|
||||
verify_app_name "$APP"
|
||||
|
||||
if ! is_image_herokuish_based "$IMAGE" "$APP"; then
|
||||
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/dokku/dokku/plugins/config
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
|
||||
@@ -8,3 +8,5 @@ github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 h1:utdYOikI1X
|
||||
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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core config plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/dokku/dokku/plugins/docker-options
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 // indirect
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core docker-options plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -10,7 +10,6 @@ cmd-docker-options-clear() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" PHASES="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
|
||||
if [[ -z "$PHASES" ]]; then
|
||||
|
||||
@@ -7,7 +7,6 @@ set -eo pipefail
|
||||
disable_app_vhost() {
|
||||
declare desc="disable vhost support for given application"
|
||||
declare APP=$1 RESTART_APP="$2"
|
||||
verify_app_name "$APP"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local APP_URLS_PATH="$DOKKU_ROOT/$APP/URLS"
|
||||
|
||||
@@ -24,7 +23,6 @@ disable_app_vhost() {
|
||||
|
||||
domains_setup() {
|
||||
declare desc="setup domains to default state"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||
@@ -45,7 +43,6 @@ domains_setup() {
|
||||
|
||||
domains_add() {
|
||||
declare desc="add list of domains to app"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
@@ -74,7 +71,6 @@ domains_add() {
|
||||
|
||||
domains_remove() {
|
||||
declare desc="remove list of app domains"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
shift 1
|
||||
@@ -89,7 +85,6 @@ domains_remove() {
|
||||
|
||||
domains_set() {
|
||||
declare desc="set list of domains for app"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
@@ -113,7 +108,6 @@ domains_set() {
|
||||
|
||||
domains_disable() {
|
||||
declare desc="disable domains/VHOST support"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
@@ -127,7 +121,6 @@ domains_disable() {
|
||||
|
||||
domains_enable() {
|
||||
declare desc="enable domains/VHOST support"
|
||||
verify_app_name "$1"
|
||||
local APP="$1" RESTART_APP="$2"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local DEFAULT_VHOSTS="$(get_default_vhosts "$APP")"
|
||||
@@ -202,7 +195,6 @@ domains_set_global() {
|
||||
enable_app_vhost() {
|
||||
declare desc="enable vhost support for given application"
|
||||
declare APP=$1 RESTART_APP="$2"
|
||||
verify_app_name "$APP"
|
||||
|
||||
plugn trigger pre-enable-vhost "$APP"
|
||||
[[ "$RESTART_APP" == "--no-restart" ]] && local CONFIG_SET_ARGS=$RESTART_APP
|
||||
@@ -212,7 +204,6 @@ enable_app_vhost() {
|
||||
|
||||
get_app_domains() {
|
||||
declare desc="return app domains"
|
||||
verify_app_name "$1"
|
||||
local APP=$1
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local GLOBAL_HOSTNAME_PATH="$DOKKU_ROOT/HOSTNAME"
|
||||
@@ -228,7 +219,6 @@ get_app_domains() {
|
||||
|
||||
get_default_vhosts() {
|
||||
declare desc="return default vhosts"
|
||||
verify_app_name "$1"
|
||||
local APP="$1"
|
||||
local RE_IPV4="$(get_ipv4_regex)"
|
||||
local RE_IPV6="$(get_ipv6_regex)"
|
||||
@@ -264,7 +254,6 @@ is_app_vhost_enabled() {
|
||||
declare desc="returns true or false if vhost support is enabled for a given application"
|
||||
|
||||
local APP=$1
|
||||
verify_app_name "$APP"
|
||||
local NO_VHOST=$(config_get "$APP" NO_VHOST)
|
||||
local APP_VHOST_ENABLED=true
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core domains plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -10,8 +10,8 @@ cmd-domains-add() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" DOMAIN_NAME="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
|
||||
verify_app_name "$APP"
|
||||
domains_add "$@"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ cmd-domains-clear() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ cmd-domains-disable() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
domains_disable "$APP"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ cmd-domains-enable() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
domains_enable "$APP"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ cmd-domains-remove() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" DOMAIN_NAME="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
|
||||
verify_app_name "$APP"
|
||||
domains_remove "$@"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ cmd-domains-set() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" DOMAIN_NAME="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
|
||||
verify_app_name "$APP"
|
||||
domains_set "$@"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ cmd-domains-setup() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
domains_setup "$APP"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core enter plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -239,7 +239,6 @@ fn-git-create-hook() {
|
||||
declare APP="$1"
|
||||
local APP_PATH="$DOKKU_ROOT/$APP"
|
||||
local PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
|
||||
verify_app_name "$APP"
|
||||
|
||||
if [[ ! -d "$APP_PATH/refs" ]]; then
|
||||
git init --bare "$APP_PATH" >/dev/null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core git plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.22.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -10,7 +10,7 @@ cmd-git-initialize() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
is_valid_app_name "$APP"
|
||||
verify_app_name "$APP"
|
||||
dokku_log_info1_quiet "Initializing git repository for $APP"
|
||||
fn-git-create-hook "$APP"
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ cmd-git-set() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" KEY="$2" VALUE="$3"
|
||||
local VALID_KEYS=("deploy-branch" "keep-git-dir" "rev-env-var")
|
||||
[[ "$APP" == "--global" ]] || verify_app_name "$APP"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
|
||||
|
||||
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
|
||||
|
||||
5
plugins/logs/.gitignore
vendored
5
plugins/logs/.gitignore
vendored
@@ -1,2 +1,7 @@
|
||||
/commands
|
||||
/subcommands/*
|
||||
/triggers/*
|
||||
/triggers
|
||||
/install
|
||||
/post-*
|
||||
/report
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
SUBCOMMANDS = subcommands/failed
|
||||
BUILD = commands subcommands
|
||||
SUBCOMMANDS = subcommands/failed subcommands/report subcommands/set subcommands/vector-logs subcommands/vector-start subcommands/vector-stop
|
||||
TRIGGERS = triggers/install triggers/post-delete triggers/report
|
||||
BUILD = commands subcommands triggers
|
||||
PLUGIN_NAME = logs
|
||||
|
||||
include ../../common.mk
|
||||
|
||||
223
plugins/logs/functions.go
Normal file
223
plugins/logs/functions.go
Normal file
@@ -0,0 +1,223 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/joncalhoun/qson"
|
||||
)
|
||||
|
||||
type vectorConfig struct {
|
||||
Sources map[string]vectorSource `json:"sources"`
|
||||
Sinks map[string]vectorSink `json:"sinks"`
|
||||
}
|
||||
|
||||
type vectorSource struct {
|
||||
Type string `json:"type"`
|
||||
IncludeLabels []string `json:"include_labels,omitempty"`
|
||||
}
|
||||
|
||||
type vectorSink map[string]interface{}
|
||||
|
||||
const vectorContainerName = "vector"
|
||||
|
||||
func killVectorContainer() error {
|
||||
if !common.ContainerExists(vectorContainerName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := stopVectorContainer(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
time.Sleep(10 * time.Second)
|
||||
if err := removeVectorContainer(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func removeVectorContainer() error {
|
||||
if !common.ContainerExists(vectorContainerName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := common.NewShellCmd(strings.Join([]string{
|
||||
common.DockerBin(), "container", "rm", "-f", vectorContainerName}, " "))
|
||||
|
||||
return common.SuppressOutput(func() error {
|
||||
if cmd.Execute() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if common.ContainerExists(vectorContainerName) {
|
||||
return errors.New("Unable to remove vector container")
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func startVectorContainer(vectorImage string) error {
|
||||
cmd := common.NewShellCmd(strings.Join([]string{
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"run", "--detach", "--name", vectorContainerName, common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"),
|
||||
"--volume", "/var/lib/dokku/data/logs/vector.json:/etc/vector/vector.json",
|
||||
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
|
||||
"--volume", common.MustGetEnv("DOKKU_LOGS_HOST_DIR") + ":/var/logs/dokku/apps",
|
||||
vectorImage,
|
||||
"--config", "/etc/vector/vector.json", "--watch-config", "1"}, " "))
|
||||
cmd.ShowOutput = false
|
||||
|
||||
if !cmd.Execute() {
|
||||
return errors.New("Unable to start vector container")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func stopVectorContainer() error {
|
||||
if !common.ContainerExists(vectorContainerName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !common.ContainerIsRunning(vectorContainerName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := common.NewShellCmd(strings.Join([]string{
|
||||
common.DockerBin(), "container", "stop", vectorContainerName}, " "))
|
||||
|
||||
return common.SuppressOutput(func() error {
|
||||
if cmd.Execute() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if common.ContainerIsRunning(vectorContainerName) {
|
||||
return errors.New("Unable to stop vector container")
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func valueToConfig(appName string, value string) (vectorSink, error) {
|
||||
var data vectorSink
|
||||
u, err := url.Parse(value)
|
||||
if err != nil {
|
||||
return data, err
|
||||
}
|
||||
|
||||
if u.Query().Get("sinks") != "" {
|
||||
return data, errors.New("Invalid option sinks")
|
||||
}
|
||||
|
||||
t := fmt.Sprintf("type=%s", u.Scheme)
|
||||
i := fmt.Sprintf("inputs[]=docker-source:%s", appName)
|
||||
if appName == "--global" {
|
||||
i = "inputs[]=docker-global-source"
|
||||
}
|
||||
if appName == "--null" {
|
||||
i = "inputs[]=docker-null-source"
|
||||
}
|
||||
|
||||
initialQuery := fmt.Sprintf("%s&%s", t, i)
|
||||
query := u.RawQuery
|
||||
if query == "" {
|
||||
query = initialQuery
|
||||
} else if strings.HasPrefix(query, "&") {
|
||||
query = fmt.Sprintf("%s%s", initialQuery, query)
|
||||
} else {
|
||||
query = fmt.Sprintf("%s&%s", initialQuery, query)
|
||||
}
|
||||
|
||||
b, err := qson.ToJSON(query)
|
||||
if err != nil {
|
||||
return data, err
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(b, &data); err != nil {
|
||||
return data, err
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func writeVectorConfig() error {
|
||||
apps, _ := common.DokkuApps()
|
||||
data := vectorConfig{
|
||||
Sources: map[string]vectorSource{},
|
||||
Sinks: map[string]vectorSink{},
|
||||
}
|
||||
for _, appName := range apps {
|
||||
value := common.PropertyGet("logs", appName, "vector-sink")
|
||||
if value == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
sink, err := valueToConfig(appName, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
data.Sources[fmt.Sprintf("docker-source:%s", appName)] = vectorSource{
|
||||
Type: "docker_logs",
|
||||
IncludeLabels: []string{fmt.Sprintf("com.dokku.app-name=%s", appName)},
|
||||
}
|
||||
|
||||
data.Sinks[fmt.Sprintf("docker-sink:%s", appName)] = sink
|
||||
}
|
||||
|
||||
value := common.PropertyGet("logs", "--global", "vector-sink")
|
||||
if value != "" {
|
||||
sink, err := valueToConfig("--global", value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
data.Sources["docker-global-source"] = vectorSource{
|
||||
Type: "docker_logs",
|
||||
IncludeLabels: []string{"com.dokku.app-name"},
|
||||
}
|
||||
|
||||
data.Sinks["docker-global-sink"] = sink
|
||||
}
|
||||
|
||||
if len(data.Sources) == 0 {
|
||||
// pull from no containers
|
||||
data.Sources["docker-null-source"] = vectorSource{
|
||||
Type: "docker_logs",
|
||||
IncludeLabels: []string{"com.dokku.vector-null"},
|
||||
}
|
||||
}
|
||||
|
||||
if len(data.Sinks) == 0 {
|
||||
// write logs to a blackhole
|
||||
sink, err := valueToConfig("--null", "blackhole://?print_amount=1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
data.Sinks["docker-null-sink"] = sink
|
||||
}
|
||||
|
||||
b, err := json.MarshalIndent(data, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vectorConfig := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")
|
||||
if err := common.WriteSliceToFile(vectorConfig, []string{string(b)}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
module github.com/dokku/dokku/plugins/logs
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27
|
||||
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
|
||||
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0
|
||||
github.com/ryanuber/columnize v1.1.2-0.20190319233515-9e6335e58db3 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
)
|
||||
|
||||
@@ -2,7 +2,11 @@ github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+Bu
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4quafGxDT9LDasjGdlGkzLbfmmrlng3kA=
|
||||
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
|
||||
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0 h1:ct2XA1aDw8A07Dr8gtrrZgIgLKcZNAl2o9nn0WRMK4Y=
|
||||
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA=
|
||||
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=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user