Compare commits
382 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d09cfb82f8 | ||
|
|
d02efdcc05 | ||
|
|
06bdee37ff | ||
|
|
e4c0c6b9d9 | ||
|
|
72c5172873 | ||
|
|
36e02c74fd | ||
|
|
3ae9feba8f | ||
|
|
757a829137 | ||
|
|
f7e218637e | ||
|
|
dbe80de925 | ||
|
|
4de1937e41 | ||
|
|
d4a634d24e | ||
|
|
2480b773a1 | ||
|
|
7f0b43c18f | ||
|
|
68efb73be6 | ||
|
|
2b76903bf3 | ||
|
|
6a4a94e236 | ||
|
|
9139c81db9 | ||
|
|
14249de8e5 | ||
|
|
b4db0c1a6c | ||
|
|
cd97ac3388 | ||
|
|
73f3ce7579 | ||
|
|
da67ebed5d | ||
|
|
36c2266196 | ||
|
|
6b357fdcb4 | ||
|
|
2ed3c6c356 | ||
|
|
528bd744e0 | ||
|
|
4ab42e846d | ||
|
|
d2cbb02342 | ||
|
|
e2e18cc0fc | ||
|
|
a31a7a231c | ||
|
|
669259eace | ||
|
|
45c543adde | ||
|
|
627a6bf8a5 | ||
|
|
f5e55540e9 | ||
|
|
d7f3a2b003 | ||
|
|
9ce309bed9 | ||
|
|
b62264c275 | ||
|
|
d4e832c27b | ||
|
|
59c45ea1d6 | ||
|
|
f64a754211 | ||
|
|
d8895bb64b | ||
|
|
882889a962 | ||
|
|
7338a77285 | ||
|
|
af014750aa | ||
|
|
02a8409114 | ||
|
|
3681c17aa2 | ||
|
|
f56023bb74 | ||
|
|
5ef41861d3 | ||
|
|
a679e80187 | ||
|
|
85c841da88 | ||
|
|
7cabb4dd9a | ||
|
|
286be7f3df | ||
|
|
1e915968b5 | ||
|
|
3dfb84048c | ||
|
|
78a3570bb2 | ||
|
|
9733bf9fa1 | ||
|
|
effaa8e81c | ||
|
|
7558a9898e | ||
|
|
eca6cde934 | ||
|
|
197f0c7c95 | ||
|
|
ef2682945c | ||
|
|
5e7ea4217f | ||
|
|
123fbea7c0 | ||
|
|
0673fdff2d | ||
|
|
e07befb93c | ||
|
|
8e1f890322 | ||
|
|
8ca713f6bb | ||
|
|
da1ddee0ba | ||
|
|
d48cf24c4d | ||
|
|
5614475521 | ||
|
|
b826770687 | ||
|
|
34807028db | ||
|
|
0405b36ab4 | ||
|
|
291f59999c | ||
|
|
1568fc7827 | ||
|
|
681fd6abf6 | ||
|
|
031159c1b9 | ||
|
|
812e34c6f5 | ||
|
|
5921692f83 | ||
|
|
33d5dd44d9 | ||
|
|
d7562d36e6 | ||
|
|
49a2f8ab82 | ||
|
|
82afae6447 | ||
|
|
25ab915883 | ||
|
|
0963c403ab | ||
|
|
9c1852fcdb | ||
|
|
a6aef82236 | ||
|
|
8b4e31bb22 | ||
|
|
7c923a0fa1 | ||
|
|
169f202994 | ||
|
|
4448e60a8b | ||
|
|
c744c25d35 | ||
|
|
f9ebdae66d | ||
|
|
767ba96186 | ||
|
|
55213e1045 | ||
|
|
1843d42e0b | ||
|
|
065f5e5922 | ||
|
|
f7beb3d95d | ||
|
|
c09dfb8ec8 | ||
|
|
87b90e96b6 | ||
|
|
e556be1a0d | ||
|
|
88fddf2a6d | ||
|
|
97fe71a829 | ||
|
|
988cdbd6bb | ||
|
|
be84325de1 | ||
|
|
e7d9d6b19e | ||
|
|
bd378e8a44 | ||
|
|
82da43cfba | ||
|
|
a96ad0c10c | ||
|
|
670e679a09 | ||
|
|
b03485a85b | ||
|
|
aac0408f76 | ||
|
|
5b9ed4f373 | ||
|
|
033b0952dd | ||
|
|
12e2686e3f | ||
|
|
cc2f054e6a | ||
|
|
a799630fac | ||
|
|
77f0f55ee7 | ||
|
|
48428ed777 | ||
|
|
0c7afb26b0 | ||
|
|
4f2c968daa | ||
|
|
411f0550e0 | ||
|
|
f9fcad257e | ||
|
|
b0d699f281 | ||
|
|
4e8242fe5e | ||
|
|
5ceccbdf68 | ||
|
|
324c08a8a2 | ||
|
|
103e47b6dd | ||
|
|
09831c3b93 | ||
|
|
99336870b8 | ||
|
|
c81e980fcf | ||
|
|
dbdf2ad55d | ||
|
|
9306011f70 | ||
|
|
162abcee4f | ||
|
|
c1ff3d4652 | ||
|
|
f9693e78c8 | ||
|
|
fe549f2fb5 | ||
|
|
d9300ad210 | ||
|
|
8ddf4888db | ||
|
|
bf5fbf4412 | ||
|
|
dfc98ecc0f | ||
|
|
86e53f96a9 | ||
|
|
3d4205b206 | ||
|
|
f81c802ecc | ||
|
|
5d9157bc40 | ||
|
|
6a85d6a58b | ||
|
|
8ddb214b0e | ||
|
|
308927adce | ||
|
|
7caa95b3f3 | ||
|
|
b5c85ad5be | ||
|
|
bad90b2b1d | ||
|
|
4c74e0dfba | ||
|
|
46933051b9 | ||
|
|
aeb9241d3b | ||
|
|
0d9b6b9852 | ||
|
|
5cac43fe55 | ||
|
|
8cc92680c5 | ||
|
|
b583f80221 | ||
|
|
6ab9f28d77 | ||
|
|
67c8af3869 | ||
|
|
12a9bdbf6e | ||
|
|
8c3fd77cfd | ||
|
|
9137be814c | ||
|
|
aad7f67f7c | ||
|
|
815b839eeb | ||
|
|
608f9d0333 | ||
|
|
ccbe2c719a | ||
|
|
76b36aa3f6 | ||
|
|
8c81d520f6 | ||
|
|
afe1e8b33c | ||
|
|
6eb0bd8c87 | ||
|
|
f3d53fbba4 | ||
|
|
b7ff627368 | ||
|
|
9ffddf3561 | ||
|
|
56ff76584d | ||
|
|
324d98d231 | ||
|
|
277e9691e1 | ||
|
|
bce0671057 | ||
|
|
ff10ef2c26 | ||
|
|
1d8a98e5ce | ||
|
|
cb43d0cc64 | ||
|
|
065bba5851 | ||
|
|
8efac2923b | ||
|
|
fc8c58a1e6 | ||
|
|
20b2773ea2 | ||
|
|
0bd7613da4 | ||
|
|
f7ef14d737 | ||
|
|
e00e498e50 | ||
|
|
17fb2ace91 | ||
|
|
2deb575961 | ||
|
|
a7465f9d81 | ||
|
|
9d55e37687 | ||
|
|
3c5a3fdd7c | ||
|
|
4477c92df9 | ||
|
|
a6062d4ab4 | ||
|
|
41f24a58b1 | ||
|
|
352900fcff | ||
|
|
62424633fc | ||
|
|
e2184a6f12 | ||
|
|
755cd909ed | ||
|
|
6338b368d4 | ||
|
|
ca56fa1b8b | ||
|
|
7c818eda47 | ||
|
|
bdb160bec1 | ||
|
|
25b90d62d2 | ||
|
|
7cd6f7666c | ||
|
|
2cdfa1cae1 | ||
|
|
17d2866153 | ||
|
|
d459b4171d | ||
|
|
e4ec973a6e | ||
|
|
3df9a5629f | ||
|
|
02b98e4736 | ||
|
|
f45b5bfd5e | ||
|
|
e39a5663bf | ||
|
|
89cc896c27 | ||
|
|
be95a619bc | ||
|
|
cafbf44e2f | ||
|
|
e64b69248a | ||
|
|
441ac29c7c | ||
|
|
ed84f21c08 | ||
|
|
5884576fc2 | ||
|
|
922b6e3722 | ||
|
|
cca507da6a | ||
|
|
d58fe853d6 | ||
|
|
03dc90b4fd | ||
|
|
2a4918c7ce | ||
|
|
7bb130edb7 | ||
|
|
3af1342a9b | ||
|
|
d16ff7fa12 | ||
|
|
d5dbd456ea | ||
|
|
3f25514e1a | ||
|
|
e3d0f693a7 | ||
|
|
97b33a9138 | ||
|
|
f73c927512 | ||
|
|
97750f8b28 | ||
|
|
827dbbc740 | ||
|
|
89e92749a6 | ||
|
|
e877a996be | ||
|
|
6bfbe0bb66 | ||
|
|
d728237697 | ||
|
|
279a706f78 | ||
|
|
dbd48356f5 | ||
|
|
6dc55624bd | ||
|
|
5e645e1489 | ||
|
|
87a786fec5 | ||
|
|
c9fc203596 | ||
|
|
f87525d8cf | ||
|
|
df4dbe5d88 | ||
|
|
31332a5061 | ||
|
|
1a66102e30 | ||
|
|
8c0380beec | ||
|
|
a7ef06028e | ||
|
|
c80fcf7b8e | ||
|
|
db5630eb32 | ||
|
|
1dc63eecbd | ||
|
|
530066875d | ||
|
|
59aef9a408 | ||
|
|
7b51bcd4ac | ||
|
|
80b782e6ed | ||
|
|
c179958afc | ||
|
|
a3ab4d1b68 | ||
|
|
575ae84e68 | ||
|
|
102c3b3007 | ||
|
|
18f3b940c3 | ||
|
|
baa15d7437 | ||
|
|
9804d42e67 | ||
|
|
0c182415a7 | ||
|
|
1599120c3e | ||
|
|
a53b5953ea | ||
|
|
0d7c4cd036 | ||
|
|
e42e26e16b | ||
|
|
b35a89c5a9 | ||
|
|
a1f4a9a386 | ||
|
|
12531dfb3e | ||
|
|
652b90a074 | ||
|
|
bdd7c58a62 | ||
|
|
3419f18c9f | ||
|
|
87ce52ded1 | ||
|
|
1db1411331 | ||
|
|
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 | ||
|
|
7115839fd5 |
@@ -1,116 +1,14 @@
|
||||
---
|
||||
version: 2.1
|
||||
|
||||
commands:
|
||||
init-tests:
|
||||
description: "Setup dokku for testing"
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /home/circleci/project
|
||||
- run:
|
||||
name: resolve dokku.me
|
||||
command: |
|
||||
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to ens4
|
||||
# this is maybe eth0 on github
|
||||
ifconfig
|
||||
sudo ip addr add 10.0.0.2/24 broadcast 10.0.0.255 dev ens4
|
||||
- run:
|
||||
name: install ci-dependencies
|
||||
command: make ci-dependencies
|
||||
- run:
|
||||
name: setup tests
|
||||
command: ./tests/ci/setup.sh
|
||||
- run:
|
||||
name: dokku cleanup:skip
|
||||
command: echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup
|
||||
- run:
|
||||
name: dokku report
|
||||
command: dokku report
|
||||
|
||||
executors:
|
||||
default:
|
||||
machine:
|
||||
image: ubuntu-1604:201903-01
|
||||
working_directory: /home/circleci/project
|
||||
|
||||
jobs:
|
||||
build:
|
||||
executor: default
|
||||
noop:
|
||||
docker:
|
||||
- image: cimg/base:2020.01
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: build package
|
||||
command: ./tests/ci/setup.sh build
|
||||
- persist_to_workspace:
|
||||
root: /home/circleci/project
|
||||
paths:
|
||||
- build
|
||||
- store_artifacts:
|
||||
path: /home/circleci/project/build/dokku.deb
|
||||
- store_artifacts:
|
||||
path: /home/circleci/project/build/dokku.rpm
|
||||
docker-deploy-tests:
|
||||
executor: default
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run docker deploy tests
|
||||
shell: /bin/bash
|
||||
no_output_timeout: 20
|
||||
command: |
|
||||
./tests/ci/setup.sh docker
|
||||
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
||||
go-tests:
|
||||
executor: default
|
||||
parallelism: 4
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run go tests
|
||||
command: |
|
||||
case $CIRCLE_NODE_INDEX in
|
||||
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
||||
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
||||
2) sudo -E make -e deploy-test-multi ;;
|
||||
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||
esac
|
||||
- store_artifacts:
|
||||
path: ./coverage.out
|
||||
test:
|
||||
executor: default
|
||||
parallelism: 4
|
||||
steps:
|
||||
- init-tests
|
||||
- run:
|
||||
name: run bats tests
|
||||
command: |
|
||||
if ! sudo -E make -e test-ci; then
|
||||
sudo -E make tests-ci-retry-failed
|
||||
fi
|
||||
no_output_timeout: 60m
|
||||
shell: /bin/bash
|
||||
- run:
|
||||
name: output oomkills
|
||||
command: cat /var/log/syslog
|
||||
when: on_fail
|
||||
- store_artifacts:
|
||||
path: ./test-results
|
||||
destination: test-results
|
||||
- store_test_results:
|
||||
path: test-results
|
||||
- run: echo "this is a noop"
|
||||
|
||||
workflows:
|
||||
workflow:
|
||||
noop:
|
||||
jobs:
|
||||
- build
|
||||
- docker-deploy-tests:
|
||||
requires:
|
||||
- build
|
||||
- test
|
||||
- go-tests:
|
||||
requires:
|
||||
- build
|
||||
- test:
|
||||
requires:
|
||||
- build
|
||||
- go-tests
|
||||
- noop
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- vendor/**/*
|
||||
- tests/**/*
|
||||
- "**_test.go"
|
||||
- contrib/*
|
||||
- vendor/**/*
|
||||
- tests/**/*
|
||||
- "**_test.go"
|
||||
- contrib/*
|
||||
|
||||
15
.github/commands/ci-run
vendored
Executable file
15
.github/commands/ci-run
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
main() {
|
||||
declare FILE_NAME="$1"
|
||||
|
||||
mkdir -p test-results/bats
|
||||
pushd tests/unit >/dev/null
|
||||
bats --report-formatter junit --output ../../test-results/bats "$FILE_NAME.bats"
|
||||
popd >/dev/null
|
||||
|
||||
ls -lah test-results/bats
|
||||
}
|
||||
|
||||
main "$@"
|
||||
28
.github/commands/ci-setup
vendored
Executable file
28
.github/commands/ci-setup
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
echo "=====> set hostname"
|
||||
hostname
|
||||
internal_ip="$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')"
|
||||
sudo hostname "dokku.me"
|
||||
echo "dokku.me" | sudo tee /etc/hostname
|
||||
hostname
|
||||
sudo cat /etc/hostname
|
||||
|
||||
echo "=====> resolve dokku.me"
|
||||
sudo apt -qq -y --no-install-recommends install net-tools
|
||||
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0
|
||||
ifconfig
|
||||
sudo ip addr add 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
|
||||
|
||||
echo "=====> install ci-dependencies"
|
||||
make ci-dependencies
|
||||
|
||||
echo "=====> setup tests"
|
||||
./tests/ci/setup.sh
|
||||
|
||||
echo "=====> dokku cleanup:skip"
|
||||
echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup
|
||||
|
||||
echo "=====> dokku report"
|
||||
dokku report
|
||||
9
.github/commands/matrix
vendored
Executable file
9
.github/commands/matrix
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
import json
|
||||
import os
|
||||
|
||||
keys = ["index"]
|
||||
values = [[s.replace(".bats", "") for s in os.listdir("tests/unit/") if s.endswith(".bats")]]
|
||||
zi = zip(keys, values)
|
||||
data = json.dumps(dict(zi))
|
||||
print(data.replace(" ", ""))
|
||||
10
.github/linters/.markdown-lint.yml
vendored
Normal file
10
.github/linters/.markdown-lint.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
default: true
|
||||
|
||||
# Line length
|
||||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013
|
||||
MD013: false
|
||||
|
||||
# Inline HTML
|
||||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md033
|
||||
MD033: false
|
||||
5
.github/linters/.yamllint.yml
vendored
Normal file
5
.github/linters/.yamllint.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length: disable
|
||||
32
.github/workflows/bump-formula.yml
vendored
32
.github/workflows/bump-formula.yml
vendored
@@ -1,20 +1,26 @@
|
||||
---
|
||||
name: bump-formula
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
bump-formula:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Bump Brew
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
brew tap dokku/repo
|
||||
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Bump Brew
|
||||
env:
|
||||
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
run: |
|
||||
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
|
||||
|
||||
159
.github/workflows/ci.yml
vendored
Normal file
159
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
---
|
||||
name: CI
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-16.04
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: build package
|
||||
run: ./tests/ci/setup.sh build
|
||||
|
||||
- name: set matrix for build
|
||||
id: set-matrix
|
||||
run: |
|
||||
json=$(python .github/commands/matrix)
|
||||
echo $json
|
||||
echo "::set-output name=matrix::$(echo "$json")"
|
||||
|
||||
- name: upload packages
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: build
|
||||
|
||||
unit-tests:
|
||||
name: unit.${{ matrix.index }}
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.build.outputs.matrix)}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
# - name: start ssh session
|
||||
# uses: luchihoratiu/debug-via-ssh@main
|
||||
# with:
|
||||
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
||||
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
||||
|
||||
- name: run ci
|
||||
timeout-minutes: 30
|
||||
run: sudo -E ./.github/commands/ci-run ${{ matrix.index }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-results-${{ matrix.index }}
|
||||
path: test-results
|
||||
|
||||
docker-deploy-tests:
|
||||
name: docker
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
- name: test docker deploys
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
./tests/ci/setup.sh docker
|
||||
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
||||
|
||||
go-tests:
|
||||
name: go.${{ matrix.index }}
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
index: [0, 1, 2, 3]
|
||||
env:
|
||||
GITHUB_NODE_INDEX: ${{ matrix.index }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: download packages
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: build
|
||||
|
||||
- name: ci-setup
|
||||
run: ./.github/commands/ci-setup
|
||||
|
||||
- name: run go tests
|
||||
run: |
|
||||
export CIRCLE_SHA1=$GITHUB_SHA
|
||||
echo "CODACY_TOKEN=$CODACY_TOKEN"
|
||||
if [ "$CODACY_TOKEN" != "" ]; then
|
||||
echo "Detected value for CODACY_TOKEN"
|
||||
fi
|
||||
case $GITHUB_NODE_INDEX in
|
||||
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
||||
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
||||
2) sudo -E make -e deploy-test-multi ;;
|
||||
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||
esac
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: coverage.${{ matrix.index }}
|
||||
path: test-results/coverage
|
||||
|
||||
publish-test-results:
|
||||
name: publish-test-results
|
||||
needs: unit-tests
|
||||
runs-on: ubuntu-16.04
|
||||
# the build-and-test job might be skipped, we don't need to run this job then
|
||||
if: success() || failure()
|
||||
|
||||
steps:
|
||||
- name: download test-results
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: test-results
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
|
||||
with:
|
||||
check_name: Unit Test Results
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: test-results/**/*.xml
|
||||
comment_on_pr: false
|
||||
58
.github/workflows/codeql-analysis.yml
vendored
58
.github/workflows/codeql-analysis.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
@@ -12,12 +13,13 @@
|
||||
|
||||
name: "CodeQL"
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '18 22 * * 2'
|
||||
|
||||
@@ -29,40 +31,40 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
language: ['go']
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
# - run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
74
.github/workflows/lint.yml
vendored
Normal file
74
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
name: 'lint'
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
name: hadolint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run hadolint
|
||||
uses: brpaz/hadolint-action@1623ba61710b974b55ba455930e6f2c8ef919778
|
||||
# v1.3.1 => 1623ba61710b974b55ba455930e6f2c8ef919778
|
||||
|
||||
markdown-lint:
|
||||
name: markdown-lint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run markdown-lint
|
||||
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb
|
||||
# v1.5.0 => 04d43ee9191307b50935a753da3b775ab695eceb
|
||||
with:
|
||||
config: '.github/linters/.markdown-lint.yml'
|
||||
args: './README.md'
|
||||
|
||||
shellcheck:
|
||||
name: shellcheck
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run shellcheck
|
||||
uses: ludeeus/action-shellcheck@d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||
# 1.0.0 => d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||
env:
|
||||
# keep in sync with tests/shellcheck-exclude
|
||||
SHELLCHECK_OPTS: -e SC1001 -e SC1003 -e SC1090 -e SC1091 -e SC1117 -e SC2029 -e SC2034 -e SC2046 -e SC2064 -e SC2068 -e SC2086 -e SC2119 -e SC2120 -e SC2128 -e SC2148 -e SC2153 -e SC2154 -e SC2155 -e SC2162 -e SC2174 -e SC2179 -e SC2191 -e SC2199 -e SC2207 -e SC2219 -e SC2220 -e SC2230 -e SC2231 -e SC2235
|
||||
|
||||
shfmt:
|
||||
name: shfmt
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run shfmt
|
||||
uses: luizm/action-sh-checker@442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||
# v0.1.12 => 442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||
env:
|
||||
SHFMT_OPTS: -l -bn -ci -i 2 -d
|
||||
with:
|
||||
sh_checker_shellcheck_disable: true
|
||||
|
||||
yamllint:
|
||||
name: yamllint
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v2
|
||||
- name: Run yamllint
|
||||
uses: ibiqlik/action-yamllint@b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||
# v3.0.0 => b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||
with:
|
||||
config_file: '.github/linters/.yamllint.yml'
|
||||
49
.github/workflows/release.yml
vendored
Normal file
49
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: 'release'
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_type:
|
||||
description: 'Release type [build, betafish, patch, minor, major]'
|
||||
required: true
|
||||
default: 'build'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: release
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: install package_cloud
|
||||
run: gem install package_cloud
|
||||
|
||||
- name: configure git
|
||||
run: |
|
||||
git config --global user.name 'Dokku Bot'
|
||||
git config --global user.email no-reply@dokku.com
|
||||
|
||||
- name: build package
|
||||
run: contrib/release-dokku ${{ github.event.inputs.release_type }}
|
||||
|
||||
- name: upload packages
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: build
|
||||
@@ -5,11 +5,11 @@ several ways to help out:
|
||||
|
||||
* Create an [issue](https://github.com/dokku/dokku/issues) on GitHub, if you
|
||||
have found a bug
|
||||
* Write test cases for open bug issues
|
||||
* Write [test cases](http://dokku.viewdocs.io/dokku/development/testing/) for open bug issues
|
||||
* Write patches for open bug/feature issues, preferably with test cases
|
||||
included
|
||||
* Contribute to the [documentation](http://dokku.viewdocs.io/dokku/)
|
||||
* Come up with new ways to show off our [lovely logo](https://avatars1.githubusercontent.com/u/13455795)
|
||||
* Come up with new ways, non-commercial to show off our [lovely logo](https://avatars1.githubusercontent.com/u/13455795)
|
||||
* Blog about different ways you are using dokku
|
||||
* Sponsor the Dokku project financially on [OpenCollective](https://opencollective.com/dokku#support) or [Patreon](https://www.patreon.com/dokku)
|
||||
|
||||
@@ -25,7 +25,7 @@ a chance of keeping on top of things.
|
||||
* [Which branch to base the work](#which-branch-to-base-the-work)
|
||||
* [Submitting Changes](#submitting-changes)
|
||||
* [When will my change be merged?](#when-will-my-change-be-merged)
|
||||
* [Test cases and codesniffs](#test-cases-and-codesniffs)
|
||||
* [Running tests locally](#running-tests-locally)
|
||||
* [Additional Resources](#additional-resources)
|
||||
|
||||
## Reporting security issues
|
||||
@@ -127,21 +127,10 @@ requests:
|
||||
- backwards incompatible change (minor)
|
||||
- major feature (minor)
|
||||
|
||||
### Test cases and codesniffs
|
||||
### Running tests locally
|
||||
|
||||
Dokku tests require [bats](https://github.com/sstephenson/bats).
|
||||
To run the test cases locally use the following command:
|
||||
|
||||
make ci-dependencies
|
||||
make unit-tests deploy-tests
|
||||
|
||||
To run the shellcheck sniffs for Dokku coding standards:
|
||||
|
||||
make ci-dependencies
|
||||
make lint
|
||||
|
||||
The [testing docs](http://dokku.viewdocs.io/dokku/development/testing/)
|
||||
contains installation info for bats and shellcheck.
|
||||
Please read the [testing docs](http://dokku.viewdocs.io/dokku/development/testing/),
|
||||
which contains test setup information as well as tips for running tests.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ RUN addgroup --gid $DOKKU_GID dokku \
|
||||
|
||||
COPY ./tests/dhparam.pem /tmp/dhparam.pem
|
||||
COPY ./build/dokku.deb /tmp/dokku.deb
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
# hadolint ignore=DL3005,DL3008
|
||||
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
|
||||
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
|
||||
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
|
||||
@@ -25,8 +28,8 @@ RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections
|
||||
&& cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \
|
||||
&& apt-get update -qq \
|
||||
&& apt-get upgrade -qq -y \
|
||||
&& apt-get install --no-install-recommends --only-upgrade -qq -y openssl openssh-server \
|
||||
&& apt install --no-install-recommends -qq -y rsync /tmp/dokku.deb \
|
||||
&& apt-get -qq -y --no-install-recommends --only-upgrade install openssl openssh-server \
|
||||
&& apt-get -qq -y --no-install-recommends install rsync /tmp/dokku.deb \
|
||||
&& apt-get purge -qq -y syslog-ng-core \
|
||||
&& apt-get autoremove -qq -y \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
@@ -53,4 +56,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/*
|
||||
|
||||
391
HISTORY.md
391
HISTORY.md
@@ -1,5 +1,396 @@
|
||||
# History
|
||||
|
||||
## 0.23.7
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4421: @josegonzalez Keep the git directory for worktree-enabled installations
|
||||
|
||||
### New Features
|
||||
|
||||
- #4420: @josegonzalez Add ability to specify X-Forwarded-Ssl header for proxied requests
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4422: @josegonzalez Add warning regarding shallow clone pushes
|
||||
- #4417: @andrewk17 Correct vector sink example command
|
||||
- #4414: @josegonzalez Use correct html for offsite digitalocean link
|
||||
- #4413: @josegonzalez Fix SSL documentation link in troubleshooting docs
|
||||
|
||||
### Other
|
||||
|
||||
- #4423: @josegonzalez Drop unused sigil packaging code
|
||||
- #4418: @josegonzalez Drop unused skip-restart flag for proxy:disable
|
||||
|
||||
## 0.23.6
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.6/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.6 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4412: @markuspoerschke Fix generation of crontab
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4411: @ltalirz Replace nginx:build-config => proxy:build-config
|
||||
|
||||
## 0.23.5
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.5/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.5 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4406: @znz Fix typo in error message
|
||||
|
||||
### New Features
|
||||
|
||||
- #4404: @josegonzalez Add ability to trigger release via github actions
|
||||
|
||||
### Tests
|
||||
|
||||
- #4403: @josegonzalez Llint files during CI
|
||||
|
||||
## 0.23.4
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.4 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4402: @josegonzalez fix: correctly handle is-deployed check
|
||||
- #4399: @josegonzalez Drop extra log output in cron plugin
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4400: @solvethex Add tail option
|
||||
|
||||
## 0.23.3
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4397: @josegonzalez Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
|
||||
- #4394: @josegonzalez Swap order of arguments on config-get call
|
||||
|
||||
### New Features
|
||||
|
||||
- #4395: @josegonzalez Add environment variable support to CNB-based containers
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4393: @josegonzalez Use docker-image-labeler in cnb builder-build trigger
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4396: @nerg4l Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
|
||||
|
||||
### Tests
|
||||
|
||||
- #4390: @josegonzalez Run tests faster by not cloning the buildpack each time
|
||||
|
||||
### Other
|
||||
|
||||
- #4389: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
|
||||
|
||||
## 0.23.2
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4388: @josegonzalez Do not inject max-size option when not using local or json-file log-drivers
|
||||
- #4386: @josegonzalez Update to docker-image-labeler that handles in-use images
|
||||
|
||||
### New Features
|
||||
|
||||
- #4387: @josegonzalez Only warn if the vector container is stopped when fetching logs
|
||||
- #4372: @josegonzalez Add ability to clear an individual resource
|
||||
- #4384: @josegonzalez Add support for injected cron entries from external plugins
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4373: @josegonzalez Do not attempt to extract Procfile in ps:scale
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4377: @josegonzalez Add note about the dokku user cron being overwritten by Dokku
|
||||
|
||||
### Other
|
||||
|
||||
- #3757: @pickettd Add provision line to Windows Vagrant box for dokku-installer
|
||||
|
||||
## 0.23.1
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.1/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.1 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4368: @josegonzalez Always report resources
|
||||
|
||||
### New Features
|
||||
|
||||
- #4369: @josegonzalez Allow formatting :report command output as json
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4367: @josegonzalez Update deeplink to digitalocean marketplace image on homepage
|
||||
- #4366: @josegonzalez Update Digitalocean docs
|
||||
- #4363: @josegonzalez Refer to the monitored slack and github discussions channels in the issue template
|
||||
- #4359: @josegonzalez Fix command call for set-property
|
||||
- #4358: @Cellane Update header on cron documentation
|
||||
- #4357: @Cellane Fix spelling in nginx documentation
|
||||
|
||||
### Other
|
||||
|
||||
- #4365: @dependabot-preview[bot] chore(deps): bump jinja2 from 2.11.2 to 2.11.3 in /tests/apps/python-flask
|
||||
|
||||
## 0.23.0
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.0/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.0 bash bootstrap.sh
|
||||
```
|
||||
|
||||
See the [0.23.0 migration guide](/docs/appendices/0.23.0-migration-guide.md) for more information on migrating to 0.23.0.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4356: @josegonzalez Do not retag images unnecessarily
|
||||
- #4355: @josegonzalez Allow underscores in vector schemes
|
||||
- #4350: @josegonzalez Add missing trigger to events plugin
|
||||
- #4348: @josegonzalez Correct app-specific shell handling
|
||||
- #4333: @josegonzalez Drop tmpdir environment variables when not running as dokku user
|
||||
|
||||
### New Features
|
||||
|
||||
- #4336: @josegonzalez Add ability to manage stacks on an app or global level …
|
||||
- #4354: @josegonzalez Log all triggers called by golang in trace output
|
||||
- #4300: @AubreyHewes allow disabling hsts globally and explicitly enable per app
|
||||
- #4337: @josegonzalez Add logrotation to container log files
|
||||
- #4318: @josegonzalez Add ability to set client max body size via nginx:set
|
||||
- #4343: @josegonzalez feat: add initial scheduled task implementation
|
||||
- #4297: @josegonzalez Add support for cloning/syncing from a remote repository
|
||||
- #4340: @bjornpost Allow configuring x-forwarded-* proxy headers via nginx:set
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4349: @josegonzalez Remove need for internal dokku calls
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4347: @fomojola Add post-deploy webhook to list of community plugins
|
||||
- #4342: @AubreyHewes Point to current testing docs
|
||||
- #4341: @josegonzalez Add testing link to contributing.md
|
||||
|
||||
### Tests
|
||||
|
||||
- #4352: @josegonzalez Add a test for application renames
|
||||
- #4351: @josegonzalez Set hostname for CI runs
|
||||
- #4322: @josegonzalez Switch to Github Actions for CI
|
||||
|
||||
### Other
|
||||
|
||||
- #4353: @josegonzalez Drop unused flag introduced by logs max-size feature
|
||||
|
||||
## 0.22.9
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.9/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.9 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4334: @josegonzalez allow git pushes to apps that already exist but have old names
|
||||
- #4335: @josegonzalez Add error checking to plugin:install and plugin:update
|
||||
- #4338: @josegonzalez Strip trailing slashes in hostname from web installer
|
||||
- #4332: @josegonzalez Correct aws release check in release-plugin script
|
||||
- #4311: @nisseknudsen Allow named volume mounts in regex
|
||||
- #4320: @josegonzalez Hardcode cnb workdir to /workspace
|
||||
|
||||
### New Features
|
||||
|
||||
- #4321: @josegonzalez Add git version to output
|
||||
|
||||
### Refactors
|
||||
|
||||
- #4329: @josegonzalez Standardize apt-get usage
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4323: @stianlik Fix typo in nginx documentation
|
||||
|
||||
### Tests
|
||||
|
||||
- #4331: @josegonzalez Switch to upstream bats-core
|
||||
- #4330: @josegonzalez Switch to using uuidgen for unique app names
|
||||
|
||||
### Other
|
||||
|
||||
- #4325: @WaviestBalloon Updated bootstrap.sh to not show when $DOKKU_TAG equals nothing
|
||||
- #4324: @dependabot-preview[bot] chore(deps): bump socket.io from 3.0.5 to 3.1.0 in /tests/apps/.websocket.disabled
|
||||
- #4319: @josegonzalez Update ruby dependencies in test app
|
||||
- #4312: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 187 to 188 in /tests/apps/php
|
||||
|
||||
## 0.22.8
|
||||
|
||||
Install/update via the bootstrap script:
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.22.8/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.22.8 bash bootstrap.sh
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #4309: @josegonzalez Correct issue where verifying an app name would bail early
|
||||
|
||||
### Documentation
|
||||
|
||||
- #4307: @josegonzalez Specify that the dokku logo is for non-commercial use
|
||||
|
||||
## 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,7 +2,7 @@
|
||||
>
|
||||
> If you'd like to sponsor specific functionality, see the project's [Sponsoring](https://github.com/dokku/.github/blob/master/SPONSORING.md) document.
|
||||
>
|
||||
> If you need help figuring out how to use a specific buildpack, or are having issues using multiple buildpacks, please see our [irc or slack channels](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#the-irc-and-slack-channels). Issues pertaining to buildpacks may be closed and locked.
|
||||
> If you need help figuring out how to use a specific buildpack, are seeing an issue in during the buildpack process, or are having issues using multiple buildpacks, please see our [slack channels or github discussion board](http://dokku.viewdocs.io/dokku/getting-started/where-to-get-help/#monitored-locations). Issues pertaining to buildpacks may be closed and locked.
|
||||
>
|
||||
> If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version.
|
||||
|
||||
|
||||
30
Makefile
30
Makefile
@@ -1,14 +1,16 @@
|
||||
DOKKU_VERSION ?= master
|
||||
|
||||
HEROKUISH_VERSION ?= 0.5.19
|
||||
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
|
||||
HEROKUISH_VERSION ?= 0.5.25
|
||||
PLUGN_VERSION ?= 0.6.1
|
||||
PROCFILE_VERSION ?= 0.11.0
|
||||
PLUGN_VERSION ?= 0.5.1
|
||||
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
|
||||
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
|
||||
DOCKER_IMAGE_LABELER_URL ?= https://github.com/dokku/docker-image-labeler/releases/download/v${DOCKER_IMAGE_LABELER_VERSION}/docker-image-labeler_${DOCKER_IMAGE_LABELER_VERSION}_linux_x86_64.tgz
|
||||
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_x86_64.tgz
|
||||
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_x86_64.tgz
|
||||
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/sigil_${SIGIL_VERSION}_Linux_x86_64.tgz
|
||||
SSHCOMMAND_URL ?= https://github.com/dokku/sshcommand/releases/download/v${SSHCOMMAND_VERSION}/sshcommand_${SSHCOMMAND_VERSION}_linux_x86_64.tgz
|
||||
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
|
||||
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
|
||||
DOKKU_LIB_ROOT ?= /var/lib/dokku
|
||||
@@ -32,7 +34,7 @@ endif
|
||||
|
||||
include common.mk
|
||||
|
||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build
|
||||
|
||||
include tests.mk
|
||||
include package.mk
|
||||
@@ -123,23 +125,27 @@ plugin-dependencies: plugn procfile-util
|
||||
plugins: plugn procfile-util docker
|
||||
sudo -E dokku plugin:install --core
|
||||
|
||||
dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq
|
||||
dependencies: apt-update docker-image-labeler sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq
|
||||
$(MAKE) -e stack
|
||||
|
||||
apt-update:
|
||||
apt-get update -qq
|
||||
|
||||
jq:
|
||||
apt-get install -qq -y jq
|
||||
apt-get -qq -y --no-install-recommends install jq
|
||||
|
||||
dos2unix:
|
||||
apt-get install -qq -y dos2unix
|
||||
apt-get -qq -y --no-install-recommends install dos2unix
|
||||
|
||||
help2man:
|
||||
apt-get install -qq -y help2man
|
||||
apt-get -qq -y --no-install-recommends install help2man
|
||||
|
||||
man-db:
|
||||
apt-get install -qq -y man-db
|
||||
apt-get -qq -y --no-install-recommends install man-db
|
||||
|
||||
docker-image-labeler:
|
||||
wget -qO /tmp/docker-image-labeler_latest.tgz ${DOCKER_IMAGE_LABELER_URL}
|
||||
tar xzf /tmp/docker-image-labeler_latest.tgz -C /usr/local/bin
|
||||
|
||||
sshcommand:
|
||||
wget -qO /tmp/sshcommand_latest.tgz ${SSHCOMMAND_URL}
|
||||
@@ -159,13 +165,13 @@ sigil:
|
||||
tar xzf /tmp/sigil_latest.tgz -C /usr/local/bin
|
||||
|
||||
docker:
|
||||
apt-get install -qq -y curl
|
||||
apt-get -qq -y --no-install-recommends install curl
|
||||
grep -i -E "^docker" /etc/group || groupadd docker
|
||||
usermod -aG docker dokku
|
||||
ifndef CI
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
ifdef DOCKER_VERSION
|
||||
apt-get install -qq -y docker-engine=${DOCKER_VERSION} || (apt-cache madison docker-engine ; exit 1)
|
||||
apt-get -qq -y --no-install-recommends install docker-engine=${DOCKER_VERSION} || (apt-cache madison docker-engine ; exit 1)
|
||||
endif
|
||||
sleep 2 # give docker a moment i guess
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Dokku
|
||||
[](https://circleci.com/gh/dokku/dokku/tree/master)
|
||||
|
||||
[](https://github.com/dokku/dokku/actions?query=workflow%3ACI)
|
||||
[](https://packagecloud.io/dokku/dokku)
|
||||
[](https://aur.archlinux.org/packages/dokku/)
|
||||
[](https://webchat.freenode.net/?channels=dokku)
|
||||
@@ -46,7 +47,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
|
||||
<a href="https://opencollective.com/dokku/sponsor/28/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/dokku/sponsor/29/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/29/avatar.svg"></a>
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/dokku#backer)]
|
||||
@@ -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.23.7/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.23.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.
|
||||
|
||||
9
Vagrantfile
vendored
9
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
|
||||
@@ -53,7 +55,7 @@ Vagrant::configure("2") do |config|
|
||||
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
|
||||
end
|
||||
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git build-essential >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git build-essential >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
vm.vm.provision :shell do |s|
|
||||
s.inline = <<-EOT
|
||||
@@ -70,8 +72,9 @@ Vagrant::configure("2") do |config|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git dos2unix >/dev/null"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git dos2unix >/dev/null"
|
||||
vm.vm.provision :shell, :inline => "cd /vagrant/ && export DOKKU_BRANCH=`git symbolic-ref -q --short HEAD 2>/dev/null` && export DOKKU_TAG=`git describe --tags --exact-match 2>/dev/null` && cd /root/ && cp /vagrant/bootstrap.sh ./ && dos2unix bootstrap.sh && bash bootstrap.sh"
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
|
||||
end
|
||||
|
||||
config.vm.define "dokku-deb", autostart: false do |vm|
|
||||
@@ -96,7 +99,7 @@ Vagrant::configure("2") do |config|
|
||||
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
|
||||
vm.vm.hostname = "#{DOKKU_DOMAIN}"
|
||||
vm.vm.network :private_network, ip: DOKKU_IP
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update >/dev/null && apt-get -qq -y install git >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git >/dev/null && cd /root/dokku && #{make_cmd}"
|
||||
vm.vm.provision :shell, :inline => "export IS_RELEASE=true && cd /root/dokku && make deb-all rpm-all"
|
||||
end
|
||||
|
||||
|
||||
14
bootstrap.sh
14
bootstrap.sh
@@ -22,7 +22,11 @@ log-fail() {
|
||||
|
||||
ensure-environment() {
|
||||
local FREE_MEMORY
|
||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||
if [[ -z "$DOKKU_TAG" ]]; then
|
||||
echo "Preparing to install $DOKKU_REPO..."
|
||||
else
|
||||
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
|
||||
fi
|
||||
|
||||
hostname -f >/dev/null 2>&1 || {
|
||||
log-fail "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
|
||||
@@ -42,13 +46,13 @@ install-requirements() {
|
||||
debian)
|
||||
if ! dpkg -l | grep -q software-properties-common; then
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install software-properties-common
|
||||
fi
|
||||
;;
|
||||
ubuntu)
|
||||
if ! dpkg -l | grep -q software-properties-common; then
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install software-properties-common
|
||||
fi
|
||||
|
||||
add-apt-repository universe >/dev/null
|
||||
@@ -100,7 +104,7 @@ install-dokku-from-source() {
|
||||
log-fail "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
|
||||
fi
|
||||
|
||||
apt-get -qq -y install sudo git make software-properties-common
|
||||
apt-get -qq -y --no-install-recommends install sudo git make software-properties-common
|
||||
cd /root
|
||||
if [[ ! -d /root/dokku ]]; then
|
||||
git clone "$DOKKU_REPO" /root/dokku
|
||||
@@ -151,7 +155,7 @@ install-dokku-from-deb-package() {
|
||||
|
||||
echo "--> Initial apt-get update"
|
||||
apt-get update -qq >/dev/null
|
||||
apt-get -qq -y install apt-transport-https
|
||||
apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
if ! command -v docker &>/dev/null; then
|
||||
echo "--> Installing docker"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
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
|
||||
GO_BUILD_CACHE ?= /tmp/dokku-go-build-cache
|
||||
GO_MOD_CACHE ?= /tmp/dokku-go-mod-mod
|
||||
|
||||
.PHONY: build-in-docker build clean src-clean
|
||||
|
||||
@@ -11,7 +13,8 @@ build-in-docker: clean
|
||||
mkdir -p /tmp/dokku-go-build-cache
|
||||
docker run --rm \
|
||||
-v $$PWD/../..:$(GO_REPO_ROOT) \
|
||||
-v /tmp/dokku-go-build-cache:/root/.cache \
|
||||
-v $(GO_BUILD_CACHE):/root/.cache \
|
||||
-v $(GO_MOD_CACHE):/go/pkg/mod \
|
||||
-e PLUGIN_NAME=$(PLUGIN_NAME) \
|
||||
-e GO111MODULE=on \
|
||||
-w $(GO_REPO_ROOT)/plugins/$(PLUGIN_NAME) \
|
||||
|
||||
@@ -2,5 +2,5 @@ FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
@@ -2,7 +2,7 @@ FROM dokku/build-base:0.0.1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
ARG WORKDIR=/go/src/github.com/dokku/dokku
|
||||
|
||||
@@ -2,7 +2,7 @@ FROM dokku/build-base:0.0.1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN apt-get update -qq && apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db
|
||||
RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
|
||||
ARG GOLANG_VERSION
|
||||
@@ -35,7 +35,6 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \
|
||||
IS_RELEASE=${IS_RELEASE} \
|
||||
SKIP_GO_CLEAN=true \
|
||||
make version copyfiles \
|
||||
&& make deb-dokku deb-sigil \
|
||||
rpm-dokku rpm-sigil
|
||||
&& make deb-dokku rpm-dokku
|
||||
|
||||
RUN ls -lha /tmp/
|
||||
|
||||
@@ -15,7 +15,7 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.22.3'
|
||||
VERSION = 'v0.23.7'
|
||||
|
||||
def bytes_to_string(b):
|
||||
if type(b) == bytes:
|
||||
@@ -154,7 +154,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
if 'vhost' in params and params['vhost'].value == 'true':
|
||||
vhost_enable = 'true'
|
||||
with open(vhost_filename, 'w') as f:
|
||||
f.write(params['hostname'].value)
|
||||
f.write(params['hostname'].value.strip("/"))
|
||||
shutil.chown(vhost_filename, dokku_user, dokku_group)
|
||||
else:
|
||||
try:
|
||||
@@ -165,7 +165,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
hostname_filename = '{0}/HOSTNAME'.format(dokku_root)
|
||||
|
||||
with open(hostname_filename, 'w') as f:
|
||||
f.write(params['hostname'].value)
|
||||
f.write(params['hostname'].value.strip("/"))
|
||||
|
||||
shutil.chown(hostname_filename, dokku_user, dokku_group)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"sudo apt-get update -qq >/dev/null",
|
||||
|
||||
"echo '--> Installing make requirement'",
|
||||
"sudo apt-get -qq -y install build-essential",
|
||||
"sudo apt-get -qq -y --no-install-recommends install build-essential",
|
||||
|
||||
"cd /tmp && make install-from-deb",
|
||||
"rm /root/.ssh/authorized_keys"
|
||||
|
||||
@@ -95,7 +95,7 @@ EOF
|
||||
local AWS_RELEASE=true
|
||||
fi
|
||||
|
||||
if [[ "$CI" != "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
|
||||
if [[ "$AWS_RELEASE" == "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
|
||||
log-info "You are running this without a DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN environment variable."
|
||||
log-info "Doing so disables uploading releases to S3, which may be necessary for installing private plugins."
|
||||
while true; do
|
||||
|
||||
47
deb.mk
47
deb.mk
@@ -10,31 +10,17 @@ DOKKU_UPDATE_VERSION ?= 0.2.0
|
||||
DOKKU_UPDATE_ARCHITECTURE = amd64
|
||||
DOKKU_UPDATE_PACKAGE_NAME = dokku-update_$(DOKKU_UPDATE_VERSION)_$(DOKKU_UPDATE_ARCHITECTURE).deb
|
||||
|
||||
define SIGIL_DESCRIPTION
|
||||
Standalone string interpolator and template processor
|
||||
Sigil is a command line tool for template processing
|
||||
and POSIX-compliant variable expansion. It was created
|
||||
for configuration templating, but can be used for any
|
||||
text processing.
|
||||
endef
|
||||
SIGIL_REPO_NAME ?= gliderlabs/sigil
|
||||
SIGIL_VERSION ?= 0.4.0
|
||||
SIGIL_ARCHITECTURE = amd64
|
||||
SIGIL_PACKAGE_NAME = gliderlabs_sigil_$(SIGIL_VERSION)_$(SIGIL_ARCHITECTURE).deb
|
||||
SIGIL_URL = https://github.com/gliderlabs/sigil/releases/download/v$(SIGIL_VERSION)/sigil_$(SIGIL_VERSION)_Linux_x86_64.tgz
|
||||
|
||||
ifndef IS_RELEASE
|
||||
IS_RELEASE = true
|
||||
endif
|
||||
|
||||
export SIGIL_DESCRIPTION
|
||||
|
||||
.PHONY: install-from-deb deb-all deb-dokku deb-dokku-update deb-setup deb-sigil
|
||||
.PHONY: install-from-deb deb-all deb-dokku deb-dokku-update deb-setup
|
||||
|
||||
install-from-deb:
|
||||
@echo "--> Initial apt-get update"
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y apt-transport-https
|
||||
sudo apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
@echo "--> Installing docker"
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
@@ -43,16 +29,16 @@ install-from-deb:
|
||||
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | apt-key add -
|
||||
@echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $(shell lsb_release -cs 2>/dev/null || echo "bionic") main" | sudo tee /etc/apt/sources.list.d/dokku.list
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
|
||||
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get -qq -y --no-install-recommends install dokku
|
||||
|
||||
deb-all: deb-setup deb-dokku deb-sigil deb-dokku-update
|
||||
deb-all: deb-setup deb-dokku deb-dokku-update
|
||||
mv $(BUILD_DIRECTORY)/*.deb .
|
||||
@echo "Done"
|
||||
|
||||
deb-setup:
|
||||
@echo "-> Updating deb repository and installing build requirements"
|
||||
@sudo apt-get update -qq >/dev/null
|
||||
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 lintian >/dev/null 2>&1
|
||||
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get -qq -y --no-install-recommends install gcc git build-essential wget ruby-dev ruby1.9.1 lintian >/dev/null 2>&1
|
||||
@command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc
|
||||
@ssh -o StrictHostKeyChecking=no git@github.com || true
|
||||
|
||||
@@ -84,26 +70,3 @@ deb-dokku-update:
|
||||
--license 'MIT License' \
|
||||
contrib/dokku-update=/usr/local/bin/dokku-update \
|
||||
contrib/dokku-update-version=/var/lib/dokku-update/VERSION
|
||||
|
||||
deb-sigil:
|
||||
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Downloading package"
|
||||
wget -q -O /tmp/tmp/sigil-$(SIGIL_VERSION).tgz $(SIGIL_URL)
|
||||
cd /tmp/tmp/ && tar zxf /tmp/tmp/sigil-$(SIGIL_VERSION).tgz
|
||||
|
||||
@echo "-> Copying files into place"
|
||||
cp /tmp/tmp/sigil /tmp/build/usr/bin/sigil && chmod +x /tmp/build/usr/bin/sigil
|
||||
|
||||
@echo "-> Creating $(SIGIL_PACKAGE_NAME)"
|
||||
sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \
|
||||
--version $(SIGIL_VERSION) \
|
||||
--architecture $(SIGIL_ARCHITECTURE) \
|
||||
--package $(BUILD_DIRECTORY)/$(SIGIL_PACKAGE_NAME) \
|
||||
--url "https://github.com/$(SIGIL_REPO_NAME)" \
|
||||
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
|
||||
--category utils \
|
||||
--description "$$SIGIL_DESCRIPTION" \
|
||||
--license 'MIT License' \
|
||||
.
|
||||
|
||||
4
debian/control
vendored
4
debian/control
vendored
@@ -1,9 +1,9 @@
|
||||
Package: dokku
|
||||
Version: 0.22.3
|
||||
Version: 0.23.7
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.2), net-tools, software-properties-common, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsyslog, dos2unix, jq
|
||||
Recommends: herokuish (>= 0.3.4), parallel, dokku-update, dokku-event-listener
|
||||
Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
|
||||
@@ -1 +1 @@
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler
|
||||
|
||||
20
docker/usr/local/bin/docker-image-labeler
Executable file
20
docker/usr/local/bin/docker-image-labeler
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $TRACE ]] && set -x
|
||||
|
||||
main() {
|
||||
declare desc="re-runs docker-image-labeler commands as sudo"
|
||||
local DOCKER_IMAGE_LABELER_BIN=""
|
||||
if [[ -x "/usr/bin/docker-image-labeler" ]]; then
|
||||
DOCKER_IMAGE_LABELER_BIN="/usr/bin/docker-image-labeler"
|
||||
fi
|
||||
|
||||
if [[ -z "$DOCKER_IMAGE_LABELER_BIN" ]]; then
|
||||
echo "! No docker-image-labeler binary found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo -E "$DOCKER_IMAGE_LABELER_BIN" "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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.23.7 enabled dokku core standard plugin
|
||||
20_events 0.23.7 enabled dokku core events logging plugin
|
||||
app-json 0.23.7 enabled dokku core app-json plugin
|
||||
apps 0.23.7 enabled dokku core apps plugin
|
||||
build-env 0.23.7 enabled dokku core build-env plugin
|
||||
buildpacks 0.23.7 enabled dokku core buildpacks plugin
|
||||
certs 0.23.7 enabled dokku core certificate management plugin
|
||||
checks 0.23.7 enabled dokku core checks plugin
|
||||
common 0.23.7 enabled dokku core common plugin
|
||||
config 0.23.7 enabled dokku core config plugin
|
||||
docker-options 0.23.7 enabled dokku core docker-options plugin
|
||||
domains 0.23.7 enabled dokku core domains plugin
|
||||
enter 0.23.7 enabled dokku core enter plugin
|
||||
git 0.23.7 enabled dokku core git plugin
|
||||
logs 0.23.7 enabled dokku core logs plugin
|
||||
network 0.23.7 enabled dokku core network plugin
|
||||
nginx-vhosts 0.23.7 enabled dokku core nginx-vhosts plugin
|
||||
plugin 0.23.7 enabled dokku core plugin plugin
|
||||
proxy 0.23.7 enabled dokku core proxy plugin
|
||||
ps 0.23.7 enabled dokku core ps plugin
|
||||
repo 0.23.7 enabled dokku core repo plugin
|
||||
resource 0.23.7 enabled dokku core resource plugin
|
||||
scheduler-docker-local 0.23.7 enabled dokku core scheduler-docker-local plugin
|
||||
shell 0.23.7 enabled dokku core shell plugin
|
||||
ssh-keys 0.23.7 enabled dokku core ssh-keys plugin
|
||||
storage 0.23.7 enabled dokku core storage plugin
|
||||
tags 0.23.7 enabled dokku core tags plugin
|
||||
tar 0.23.7 enabled dokku core tar plugin
|
||||
trace 0.23.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.
|
||||
|
||||
@@ -71,6 +71,17 @@ dokku resource:limit --cpu 100 --memory 100 --process-type worker node-js-app
|
||||
memory: 100
|
||||
```
|
||||
|
||||
A resource value can be individually cleared by setting the value to the special value `clear`.
|
||||
|
||||
```shell
|
||||
dokku resource:limit --cpu clear node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> Setting resource limits for node-js-app
|
||||
cpu: cleared
|
||||
```
|
||||
|
||||
#### Displaying Resource Limits
|
||||
|
||||
Running the `resource:limit` command without any flags will display the currently configured default app limits.
|
||||
@@ -169,6 +180,17 @@ dokku resource:reserve --cpu 100 --memory 100 --process-type worker node-js-app
|
||||
memory: 100
|
||||
```
|
||||
|
||||
A resource value can be individually cleared by setting the value to the special value `clear`.
|
||||
|
||||
```shell
|
||||
dokku resource:reserve --cpu clear node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> Setting resource reservation for node-js-app
|
||||
cpu: cleared
|
||||
```
|
||||
|
||||
#### Displaying Resource Reservations
|
||||
|
||||
Running the `resource:reserve` command without any flags will display the currently configured default app reservations.
|
||||
|
||||
8
docs/appendices/0.23.0-migration-guide.md
Normal file
8
docs/appendices/0.23.0-migration-guide.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# 0.23.0 Migration Guide
|
||||
|
||||
## Changes
|
||||
|
||||
- The `plugin:list` command no longer outputs the version for the `plugn` binary.
|
||||
- Users building docker images that run Dokku will need to use a new sudoer wrapper for the `docker-image-labeler` binary to work correctly. A reference version has been placed in the `docker` skeleton directory. This should only impact platform developers, and users of our Docker image will already have the file available.
|
||||
- The `dokku` user's cron is now in use by Dokku itself. Customizations will be overwritten. Users are encouraged to use a cron entry in `/etc/cron.d/dokku` to avoid this issue.
|
||||
- As of 0.23.0, Dokku will now inject the `max-size` log driver option for applications. This is restricted to app-configured log driver values empty, `local` or `json-file` in 0.23.1 to increase setup compatibility. Users who configure alternative log drivers at the system level will need to either set the global `max-size` property to `unlimited` or switch to the built-in `vector` logging support.
|
||||
@@ -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.23.7/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.7/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"0.19.13",
|
||||
"0.20.4",
|
||||
"0.21.4",
|
||||
"0.22.3"
|
||||
"0.22.9",
|
||||
"0.23.7"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ The following plugins are available and provided by Dokku maintainers. Please f
|
||||
| [Application build hook](https://github.com/fteychene/dokku-build-hook) | [fteychene][] | 0.4.0+ |
|
||||
| [Post Deploy Script](https://github.com/baikunz/dokku-post-deploy-script) | [baikunz][] | 0.4.0+ |
|
||||
| [Auto Sync](https://github.com/IdeaSynthesis/dokku-autosync)<sup>4</sup> | [fomojola][] | 0.8.1+ |
|
||||
| [Deploy Webhook](https://github.com/IdeaSynthesis/dokku-deploy-webhook)<sup>5</sup> | [fomojola][] | 0.8.1+ |
|
||||
|
||||
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
|
||||
|
||||
@@ -211,7 +212,9 @@ The following plugins are available and provided by Dokku maintainers. Please f
|
||||
|
||||
<sup>3</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
|
||||
|
||||
<sup>4</sup> Adds the ability to sync an application repo with a remote Github repo (useful for automated rebuilds without needing a git push from an external system).
|
||||
<sup>4</sup> Adds the ability to sync an application repo with a remote Github repo (useful for automated rebuilds without needing a git push from an external system
|
||||
|
||||
<sup>5</sup> Adds the ability to invoke a post-deploy webhook with the IP, port and app name, all with a single config:set).
|
||||
|
||||
### Other Plugins
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -78,7 +78,7 @@ The following config variables have special meanings and can be set in a variety
|
||||
| Name | Default | How to modify | Description |
|
||||
| ------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `DOKKU_ROOT` | `~dokku` | `/etc/environment` | The root directory where dokku will store application repositories, as well as certain configuration files. |
|
||||
| `DOKKU_IMAGE` | `gliderlabs/herokuish` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The default image to use when building herokuish containers. |
|
||||
| `DOKKU_IMAGE` | `gliderlabs/herokuish` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The default image to use when building herokuish containers. Deprecated in favor of using `buildpacks:set-property` |
|
||||
| `DOKKU_LIB_ROOT` | `/var/lib/dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory where plugins, certain data, and general configuration is stored. |
|
||||
| `PLUGIN_PATH` | `$DOKKU_LIB_ROOT/plugins"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The top-level directory where plugins are stored. |
|
||||
| `PLUGIN_AVAILABLE_PATH` | `$PLUGIN_PATH/available"` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | The directory that holds all available plugins, including core. |
|
||||
@@ -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. |
|
||||
|
||||
@@ -61,6 +61,20 @@ The following options are also available via the `nginx:set` command:
|
||||
|
||||
Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails until the max-age is reached.
|
||||
|
||||
#### Globally disabling the HSTS Header
|
||||
|
||||
HSTS Header can be disabled for all apps by setting the `hsts` property to false after passing the `--global` flag to `nginx:set`. Changing this value globally or on a per-app basis will require rebuilding the nginx config via the `proxy:build-config` command.
|
||||
|
||||
```shell
|
||||
dokku nginx:set --global hsts false
|
||||
```
|
||||
|
||||
Once the HSTS setting is disabled globally, it can be re-enabled on a per-app basis by setting the `hsts` property as normal.
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app hsts true
|
||||
```
|
||||
|
||||
### Checking access logs
|
||||
|
||||
You may check nginx access logs via the `nginx:access-logs` command. This assumes that app access logs are being stored in `/var/log/nginx/$APP-access.log`, as is the default in the generated `nginx.conf`.
|
||||
@@ -77,7 +91,7 @@ dokku nginx:access-logs node-js-app -t
|
||||
|
||||
### Checking error logs
|
||||
|
||||
You may check nginx error logs via the `nginx:access-logs` command. This assumes that app error logs are being stored in `/var/log/nginx/$APP-error.log`, as is the default in the generated `nginx.conf`.
|
||||
You may check nginx error logs via the `nginx:error-logs` command. This assumes that app error logs are being stored in `/var/log/nginx/$APP-error.log`, as is the default in the generated `nginx.conf`.
|
||||
|
||||
```shell
|
||||
dokku nginx:error-logs node-js-app
|
||||
@@ -144,6 +158,28 @@ dokku nginx:set node-js-app proxy-read-timeout
|
||||
|
||||
In all cases, the nginx config must be regenerated after setting the above value.
|
||||
|
||||
### Specifying a custom client_max_body_size
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
Users can override the default `client_max_body_size` value - which limits file uploads - via `nginx:set`. Changing this value will only apply to every `server` stanza of the default `nginx.conf.sigil`; users of custom `nginx.conf.sigil` files must update their templates to support the new value.
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app client-max-body-size 50m
|
||||
```
|
||||
|
||||
The default value is empty string, which will result in nginx falling back to any configured, higher-level defaults (or `1m` if unconfigued; all numerical values _must_ have a size unit specified (`k` for kilobytes, `m` for megabytes).
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app client-max-body-size
|
||||
```
|
||||
|
||||
In all cases, the nginx config must be regenerated after setting the above value.
|
||||
|
||||
Changing this value when using the PHP buildpack (or any other buildpack that uses an intermediary server) will require changing the value in the server config shipped with that buildpack. Consult your buildpack documentation for further details.
|
||||
|
||||
### Showing the nginx config
|
||||
|
||||
For debugging purposes, it may be useful to show the nginx config. This can be achieved via the `nginx:show-config` command.
|
||||
@@ -233,11 +269,11 @@ The default nginx.conf template will include everything from your apps `nginx.co
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
```
|
||||
|
||||
That means you can put additional configuration in separate files, for example to limit the uploaded body size to 50 megabytes, do
|
||||
That means you can put additional configuration in separate files. To increase the client request header timeout, the following can be performed:
|
||||
|
||||
```shell
|
||||
mkdir /home/dokku/node-js-app/nginx.conf.d/
|
||||
echo 'client_max_body_size 50m;' > /home/dokku/node-js-app/nginx.conf.d/upload.conf
|
||||
echo 'client_header_timeout 50s;' > /home/dokku/node-js-app/nginx.conf.d/timeout.conf
|
||||
chown dokku:dokku /home/dokku/node-js-app/nginx.conf.d/upload.conf
|
||||
service nginx reload
|
||||
```
|
||||
@@ -250,7 +286,7 @@ For PHP Buildpack users, you will also need to provide a `Procfile` and an accom
|
||||
|
||||
Your `nginx.conf` file - not to be confused with Dokku's `nginx.conf.sigil` - would also need to be configured as shown in this example:
|
||||
|
||||
client_max_body_size 50m;
|
||||
client_header_timeout 50s;
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
|
||||
@@ -136,35 +136,12 @@ Certain versions of nginx have bugs that prevent [HTTP/2](https://nginx.org/en/d
|
||||
|
||||
Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarded-Port` and `X-Forwarded-For`. These headers indicate the protocol of the original request (HTTP or HTTPS), the port number, and the IP address of the client making the request, respectively. The default configuration is for Nginx to set these headers.
|
||||
|
||||
If your server runs behind an HTTP(S) load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by using a [custom nginx template](/docs/configuration/nginx.md#customizing-the-nginx-configuration). The following is a simple example of how to do so.
|
||||
If your server runs behind an HTTP(S) load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application via `nginx:set`:
|
||||
|
||||
```go
|
||||
server {
|
||||
listen [::]:{{ .PROXY_PORT }};
|
||||
listen {{ .PROXY_PORT }};
|
||||
server_name {{ .NOSSL_SERVER_NAME }};
|
||||
access_log /var/log/nginx/{{ .APP }}-access.log;
|
||||
error_log /var/log/nginx/{{ .APP }}-error.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://{{ .APP }};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
|
||||
proxy_set_header X-Request-Start $msec;
|
||||
}
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
}
|
||||
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_WEB_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
```shell
|
||||
dokku nginx:set node-js-app x-forwarded-for-value "\$http_x_forwarded_for"
|
||||
dokku nginx:set node-js-app x-forwarded-port-value "\$http_x_forwarded_port"
|
||||
dokku nginx:set node-js-app x-forwarded-proto-value "\$http_x_forwarded_proto"
|
||||
```
|
||||
|
||||
Only use this option if:
|
||||
@@ -173,7 +150,18 @@ Only use this option if:
|
||||
|
||||
If it's possible to make HTTP(S) requests directly to Nginx, bypassing the load balancer, or if the load balancer is not configured to set these headers, then it becomes possible for a client to set these headers to arbitrary values.
|
||||
|
||||
This could result in security issue, for example, if your application looks at the value of the `X-Forwarded-Proto` to determine if the request was made over HTTPS.
|
||||
The `x-forwarded-ssl` property may also be set for application frameworks that require this value. Note that this is a non-standard version of setting `x-forwarded-proto` to `https`, and should only be done as a last resort.
|
||||
|
||||
```shell
|
||||
# force-setting value to `on`
|
||||
dokku nginx:set node-js-app x-forwarded-ssl on
|
||||
|
||||
# force-setting value to `off`
|
||||
dokku nginx:set node-js-app x-forwarded-ssl on
|
||||
|
||||
# removing the value from nginx.conf (default)
|
||||
dokku nginx:set node-js-app x-forwarded-ssl
|
||||
```
|
||||
|
||||
### SSL Port Exposure
|
||||
|
||||
|
||||
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.
|
||||
@@ -1,8 +1,13 @@
|
||||
# Log Management
|
||||
|
||||
```
|
||||
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 <app> [-h] [-t|--tail] [-n|--num num] [-q|--quiet] [-p|--ps process] # Display recent log output
|
||||
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,122 @@ You may also fetch all failed app logs by using the `--all` flag.
|
||||
```shell
|
||||
dokku logs:failed --all
|
||||
```
|
||||
|
||||
### Docker Log Retention
|
||||
|
||||
Docker log retention can be specified via the `logs:set` command by specifying a value for `max-size`. Log retention is set via injected docker options for all applications, but is also available via the `logs-get-property` trigger for alternative schedulers.
|
||||
|
||||
```shell
|
||||
dokku logs:set node-js-app max-size 20m
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
```shell
|
||||
dokku logs:set node-js-app max-size
|
||||
```
|
||||
|
||||
Valid values include any integer number followed by a unit of measure (`k`, `m`, or `g`) or the string `unlimited`. Setting to `unlimited` will result in Dokku omitting the log option.
|
||||
|
||||
The `max-size` property can also be set globally. The global default is `10m`, and the global value is used when no app-specific value is set.
|
||||
|
||||
```shell
|
||||
dokku logs:set --global max-size 20m
|
||||
```
|
||||
|
||||
The default value may be set by passing an empty value for the option.
|
||||
|
||||
```shell
|
||||
dokku logs:set --global max-size
|
||||
```
|
||||
|
||||
### 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 vector-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.
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
> New as of 0.22.0
|
||||
|
||||
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish.md) for more information on how to clear buildpack build cache for an application.
|
||||
```
|
||||
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
||||
```
|
||||
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) for more information on how to clear buildpack build cache for an application.
|
||||
|
||||
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
|
||||
|
||||
@@ -22,10 +25,8 @@ Builds will proceed with the `pack` cli for the app from then on.
|
||||
|
||||
As this functionality is highly experimental, there are a number of caveats. Please note that not all issuesare listed below.
|
||||
|
||||
- The `heroku/buildpacks:latest` CNB builder is currently enforced. Specifying specific builders is not currently possible.
|
||||
- A future release will allow modifying the chosen builder.
|
||||
- Specifying specific buildpacks is not currently possible.
|
||||
- A future release will add support for the `buildpacks` plugin.
|
||||
- A future release will add support for specifying buildpacks via the `buildpacks` plugin.
|
||||
- There is currently no way to specify extra arguments for `pack` cli invocations.
|
||||
- A future release will add support for injecting extra arguments during the build process.
|
||||
- The default process type is `web`.
|
||||
@@ -33,3 +34,31 @@ As this functionality is highly experimental, there are a number of caveats. Ple
|
||||
- A future version will add integration with the `repo` plugin.
|
||||
- `pack` is not currently included with Dokku, nor is it added as a package dependency.
|
||||
- A future version will include it as a package dependency.
|
||||
|
||||
### Customizing the Buildpack stack builder
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
The default stack builder in use by CNB buildpacks in Dokku is based on `heroku/buildpacks`. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack paketobuildpacks/build:base-cnb
|
||||
```
|
||||
|
||||
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack
|
||||
```
|
||||
|
||||
A change in the stack builder value will execute the `post-stack-set` trigger.
|
||||
|
||||
Finally, stack builders can be set or unset globally as a fallback. This will take precedence over a globally set `DOKKU_CNB_STACK` environment variable (`heroku/buildpacks` by default).
|
||||
|
||||
```shell
|
||||
# set globally
|
||||
dokku buildpacks:set-property --global stack paketobuildpacks/build:base-cnb
|
||||
|
||||
# unset globally
|
||||
dokku buildpacks:set-property --global stack
|
||||
```
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
> Subcommands new as of 0.12.0
|
||||
|
||||
```
|
||||
git:initialize <app> # Initialize a git repository for an app
|
||||
git:report [<app>] [<flag>] # Displays a git report for one or more apps
|
||||
git:set <app> <key> (<value>) # Set or clear a git property for an app
|
||||
git:allow-host <host> # Adds a host to known_hosts
|
||||
git:sync [--build] <app> <repository> [<git-ref>] # Clone or fetch an app from remote git repo
|
||||
git:initialize <app> # Initialize a git repository for an app
|
||||
git:public-key # Outputs the dokku public deploy key
|
||||
git:report [<app>] [<flag>] # Displays a git report for one or more apps
|
||||
git:set <app> <key> (<value>) # Set or clear a git property for an app
|
||||
```
|
||||
|
||||
Git-based deployment has been the traditional method of deploying applications in Dokku. As of v0.12.0, Dokku introduces a few ways to customize the experience of deploying via `git push`. A Git-based deployment currently supports building applications via:
|
||||
@@ -16,6 +19,8 @@ Git-based deployment has been the traditional method of deploying applications i
|
||||
|
||||
## Usage
|
||||
|
||||
> Warning: Pushing from a shallow clone is not currently supported and may have undefined behavior. Please unshallow your local repository before pushing to a Dokku app to avoid potential errors in the deployment process.
|
||||
|
||||
### Initializing an application
|
||||
|
||||
When an application is created via `git push`, Dokku will create the proper `pre-receive` hook in order to execute the build pipeline. In certain cases - such as when fronting deploys with the [`git-http-backend`](https://git-scm.com/docs/git-http-backend) - this may not be correctly created. As an alternative, the `git:initialize` command can be used to trigger this creation:
|
||||
@@ -105,3 +110,52 @@ dokku git:set node-js-app keep-git-dir false
|
||||
# delete the .git directory during builds (default)
|
||||
dokku git:set node-js-app keep-git-dir ""
|
||||
```
|
||||
|
||||
Please keep in mind that setting `keep-git-dir` to `true` may result in unstaged changes shown within the built container due to the build process generating application changes within the built app directory.
|
||||
|
||||
### Initializing an app repository from a remote repository
|
||||
|
||||
> The application must exist before the repository can be initialized
|
||||
|
||||
A Dokku app repository can be initialized or updated from a remote git repository via the `git:sync` command. This command will either clone or fetch updates from a remote repository and has undefined behavior if the history cannot be fast-fowarded to the referenced repository reference. Any repository that can be cloned by the `dokku` user can be specified.
|
||||
|
||||
```shell
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git
|
||||
```
|
||||
|
||||
The `git:sync` command optionally takes an optional third parameter containing a git reference, which may be a branch, tag, or specific commit.
|
||||
|
||||
```shell
|
||||
# specify a branch
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git main
|
||||
|
||||
# specify a tag
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git 1
|
||||
|
||||
# specify a commit
|
||||
dokku git:sync node-js-app https://github.com/heroku/node-js-getting-started.git 97e6c72491c7531507bfc5413903e0e00e31e1b0
|
||||
```
|
||||
|
||||
By default, this command does not trigger an application build. To do so during a `git:sync`, specify the `--build` flag.
|
||||
|
||||
```shell
|
||||
dokku git:sync --build node-js-app https://github.com/heroku/node-js-getting-started.git
|
||||
```
|
||||
|
||||
### Allowing remote repository hosts
|
||||
|
||||
By default, the Dokku host may not have access to a server containing the remote repository. This can be initialized via the `git:allow-host` command.
|
||||
|
||||
```shell
|
||||
dokku git:allow-host github.com
|
||||
```
|
||||
|
||||
Note that this command is currently not idempotent and may add duplicate entries to the `~dokku/.ssh/known_hosts` file.
|
||||
|
||||
### Verifying the cloning public key
|
||||
|
||||
In order to clone a remote repository, the remote server should have the Dokku host's public key configured. This plugin does not currently create this key, but if there is one available, it can be shown via the `git:public-key` command.
|
||||
|
||||
```shell
|
||||
dokku git:public-key
|
||||
```
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
> Subcommands new as of 0.15.0
|
||||
|
||||
```
|
||||
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary
|
||||
buildpacks:clear <app> # Clear all buildpacks set on the app
|
||||
buildpacks:list <app> # List all buildpacks for an app
|
||||
buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app
|
||||
buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps
|
||||
buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
|
||||
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary
|
||||
buildpacks:clear <app> # Clear all buildpacks set on the app
|
||||
buildpacks:list <app> # List all buildpacks for an app
|
||||
buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app
|
||||
buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps
|
||||
buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
|
||||
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
||||
```
|
||||
|
||||
> Warning: If using the `buildpacks` plugin, be sure to unset any `BUILDPACK_URL` and remove any such entries from a committed `.env` file. A specified `BUILDPACK_URL` will always override a `.buildpacks` file or the buildpacks plugin.
|
||||
@@ -123,6 +124,34 @@ The `buildpacks:clear` command can be used to clear all configured buildpacks fo
|
||||
dokku buildpacks:clear node-js-app
|
||||
```
|
||||
|
||||
### Customizing the Buildpack stack builder
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
The default stack builder in use by Herokuish buildpacks in Dokku is based on `gliderlabs/herokuish:latest`. Typically, this is installed via an OS package which pulls the requisite Docker image. Users may desire to switch the stack builder to a custom version, either to update the operating system or to customize packages included with the stack builder. This can be performed via the `buildpacks:set-property` command.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack gliderlabs/herokuish:latest
|
||||
```
|
||||
|
||||
The specified stack builder can also be unset by omitting the name of the stack builder when calling `buildpacks:set-property`.
|
||||
|
||||
```shell
|
||||
dokku buildpacks:set-property node-js-app stack
|
||||
```
|
||||
|
||||
A change in the stack builder value will execute the `post-stack-set` trigger.
|
||||
|
||||
Finally, stack builders can be set or unset globally as a fallback. This will take precedence over a globally set `DOKKU_IMAGE` environment variable (`gliderlabs/herokuish:latest` by default).
|
||||
|
||||
```shell
|
||||
# set globally
|
||||
dokku buildpacks:set-property --global stack gliderlabs/herokuish:latest
|
||||
|
||||
# unset globally
|
||||
dokku buildpacks:set-property --global stack
|
||||
```
|
||||
|
||||
### Displaying buildpack reports for an app
|
||||
|
||||
You can get a report about the app's buildpacks status using the `buildpacks:report` command:
|
||||
@@ -133,11 +162,20 @@ dokku buildpacks:report
|
||||
|
||||
```
|
||||
=====> node-js-app buildpacks information
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
|
||||
Buildpacks stack: gliderlabs/herokuish:v0.5.23-20
|
||||
=====> python-sample buildpacks information
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git
|
||||
Buildpacks stack:
|
||||
=====> ruby-sample buildpacks information
|
||||
Buildpacks computed stack: gliderlabs/herokuish:v0.5.23-20
|
||||
Buildpacks global stack: gliderlabs/herokuish:latest
|
||||
Buildpacks list:
|
||||
Buildpacks stack:
|
||||
```
|
||||
|
||||
You can run the command for a specific app also.
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
# One-off Processes and Cron
|
||||
|
||||
Sometimes you need to either inspect running containers or run a one-off command under an application. In those cases, Dokku makes it easy to either connect to a running container or run a fresh container.
|
||||
|
||||
## Run a command in an app environment
|
||||
|
||||
```
|
||||
run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
|
||||
```
|
||||
|
||||
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
||||
|
||||
```shell
|
||||
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
||||
dokku run node-js-app ls -lah
|
||||
|
||||
# optionally, run can be passed custom environment variables
|
||||
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
|
||||
```
|
||||
|
||||
The `run` command can also be used to run a command defined in your Procfile:
|
||||
|
||||
```
|
||||
console: bundle exec racksh
|
||||
```
|
||||
|
||||
```shell
|
||||
# runs `bundle exec racksh` in the `/app` directory of the application `my-app`
|
||||
dokku run my-app console
|
||||
```
|
||||
|
||||
If you want to remove the container after a command has started, you can run the following command:
|
||||
|
||||
```shell
|
||||
# don't keep `run` containers around
|
||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||
|
||||
# revert the above setting and keep containers around
|
||||
dokku config:unset --global DOKKU_RM_CONTAINER
|
||||
```
|
||||
|
||||
You may also use the `--rm-container` or `--rm` Dokku flags to remove the containers automatically:
|
||||
|
||||
```shell
|
||||
dokku --rm-container run node-js-app ls -lah
|
||||
dokku --rm run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Containers may have specific labels attached. In order to avoid issues with dokku internals, do not use any labels beginning with either `com.dokku` or `org.label-schema`.
|
||||
|
||||
```shell
|
||||
dokku --label=com.example.test-label=value run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Finally, you may wish to run a container in "detached" mode via the `--detach` Dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as Dokku will *not* automatically terminate the container.
|
||||
|
||||
```shell
|
||||
dokku --detach run node-js-app ls -lah
|
||||
# returns the ID of the new container
|
||||
```
|
||||
|
||||
> Note that you may not use the `--rm-container` or `--rm` flags when running containers in detached mode, and attempting to do so will result in the `--detach` flag being ignored.
|
||||
|
||||
### Using `run` for cron tasks
|
||||
|
||||
You can always use a one-off container to run an application task:
|
||||
|
||||
```shell
|
||||
dokku --rm run node-js-app some-command
|
||||
dokku --rm-container run node-js-app some-command
|
||||
```
|
||||
|
||||
For tasks that should not be interrupted, run is the *preferred* method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
|
||||
|
||||
## Entering existing containers
|
||||
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
enter <app> [<container-type> || --container-id <container-id>] # Connect to a specific app container
|
||||
```
|
||||
|
||||
The `enter` command can be used to enter a running container. The following variations of the command exist:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app web
|
||||
dokku enter node-js-app web.1
|
||||
dokku enter node-js-app --container-id ID
|
||||
```
|
||||
|
||||
Additionally, you can run `enter` with no `<container-type>`. If only a single `<container-type>` is defined in your app, you will be dropped into the only running container. This behavior is not supported when specifying a custom command; as described below.
|
||||
|
||||
By default, it runs a `/bin/bash`, but can also be used to run a custom command:
|
||||
|
||||
```shell
|
||||
# just echo hi
|
||||
dokku enter node-js-app web echo hi
|
||||
|
||||
# run a long-running command, as one might for a cron task
|
||||
dokku enter node-js-app web python script/background-worker.py
|
||||
```
|
||||
|
||||
### Using `enter` for cron tasks
|
||||
|
||||
Your Procfile can have the following entry:
|
||||
|
||||
```Procfile
|
||||
cron: sleep infinity
|
||||
```
|
||||
|
||||
With the `cron` process scaled to `1`:
|
||||
|
||||
```shell
|
||||
dokku ps:scale node-js-app cron=1
|
||||
```
|
||||
|
||||
You can now run all your commands in that container:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app cron some-command
|
||||
```
|
||||
|
||||
Note that you can also run multiple commands at the same time to reduce memory usage, though that may result in polluting the container environment.
|
||||
|
||||
For tasks that will properly resume, you *should* use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
|
||||
|
||||
## General cron recommendations
|
||||
|
||||
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
|
||||
|
||||
- Use the `dokku` user's crontab.
|
||||
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
|
||||
- Add a `MAILTO` environment variable to ship cron emails to yourself.
|
||||
- Add a `PATH` environment variable or specify the full path to binaries on the host.
|
||||
- Add a `SHELL` environment variable to specify Bash when running commands.
|
||||
- Keep your cron tasks in time-sorted order.
|
||||
- Keep your server time in UTC so you don't need to translate daylight savings time when reading the cronfile.
|
||||
- Run tasks at the lowest traffic times if possible.
|
||||
- Use cron to *trigger* jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
|
||||
- Try to keep tasks quiet so that mails only send on errors.
|
||||
- Do not silence standard error or standard out. If you silence the former, you will miss failures. Silencing the latter means you should actually make application changes to handle log levels.
|
||||
- Use a service such as [Dead Man's Snitch](https://deadmanssnitch.com) to verify that cron tasks completed successfully.
|
||||
- Add lots of comments to your cronfile, including what a task is doing, so that you don't spend time deciphering the file later.
|
||||
- Place your cronfiles in a pattern such as `/etc/cron.d/APP`.
|
||||
- Do not use non-ASCII characters in your cronfile names. cron is finicky.
|
||||
- Remember to have trailing newlines in your cronfile! cron is finicky.
|
||||
|
||||
The following is a sample cronfile that you can use for your applications:
|
||||
|
||||
```cron
|
||||
# server cron jobs
|
||||
MAILTO="mail@dokku.me"
|
||||
PATH=/usr/local/bin:/usr/bin:/bin
|
||||
SHELL=/bin/bash
|
||||
|
||||
# m h dom mon dow username command
|
||||
# * * * * * dokku command to be executed
|
||||
# - - - - -
|
||||
# | | | | |
|
||||
# | | | | +----- day of week (0 - 6) (Sunday=0)
|
||||
# | | | +------- month (1 - 12)
|
||||
# | | +--------- day of month (1 - 31)
|
||||
# | +----------- hour (0 - 23)
|
||||
# +----------- min (0 - 59)
|
||||
|
||||
### HIGH TRAFFIC TIME IS B/W 00:00 - 04:00 AND 14:00 - 23:59
|
||||
### RUN YOUR TASKS FROM 04:00 - 14:00
|
||||
### KEEP SORTED IN TIME ORDER
|
||||
|
||||
### PLACE ALL CRON TASKS BELOW
|
||||
|
||||
# removes unresponsive users from the subscriber list to decrease bounce rates
|
||||
0 0 * * * dokku dokku --rm run node-js-app some-command
|
||||
|
||||
# sends out our email alerts to users
|
||||
0 1 * * * dokku dokku ps:scale node-js-app cron=1 && dokku enter node-js-app cron some-other-command && dokku ps:scale node-js-app cron=0
|
||||
|
||||
### PLACE ALL CRON TASKS ABOVE, DO NOT REMOVE THE WHITESPACE AFTER THIS LINE
|
||||
|
||||
```
|
||||
@@ -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.
|
||||
|
||||
@@ -261,6 +261,21 @@ help_content
|
||||
esac
|
||||
```
|
||||
|
||||
### `config-export`
|
||||
|
||||
- Description: Returns the environment variables in a specified format
|
||||
- Invoked by: app-json plugin
|
||||
- Arguments: `$APP $GLOBAL $MERGED $FORMAT`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `config-get`
|
||||
|
||||
- Description: Fetches the app config value for a key
|
||||
@@ -309,6 +324,40 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
curl "http://httpstat.us/200"
|
||||
```
|
||||
|
||||
### `cron-write`
|
||||
|
||||
- Description: Force triggers writing out cron entries
|
||||
- Invoked by:
|
||||
- Arguments:
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `cron-entries`
|
||||
|
||||
- Description: Allows injecting cron entries into the written out scheduled cron task list. Each entry is newline delimited, and individual entries come in the form `$SCHEDULE;$FULL_COMMAND;$ARBITRARY_DATA`. Individual implementations of cron writing can decide whether and how to include these cron entries. The `ARBITRARY_DATA` includes the log file path for the basic `docker-local` cron implementation.
|
||||
- Invoked by:
|
||||
- Arguments: `$DOKKU_SCHEDULER`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
DOKKU_SCHEDULER="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `dependencies`
|
||||
|
||||
- Description: Used to install system-level dependencies.
|
||||
@@ -327,7 +376,7 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
apt-get install -qq -y nginx
|
||||
apt-get -qq -y --no-install-recommends install nginx
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
@@ -451,7 +500,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 +518,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 +535,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 +552,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 +571,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
|
||||
```
|
||||
@@ -704,6 +748,22 @@ if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
fi
|
||||
```
|
||||
|
||||
### `logs-get-property`
|
||||
|
||||
- Description: Fetches a given logs property value
|
||||
- Invoked by:
|
||||
- Arguments: `$APP` `$PROPERTY`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; PROPERTY="$2"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `network-build-config`
|
||||
|
||||
- Description: Rebuilds network configuration
|
||||
@@ -1060,7 +1120,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 +1137,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 +1259,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 +1284,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 +1304,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 +1326,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 +1345,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 +1430,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 +1450,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 +1470,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 +1487,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,13 +1525,12 @@ 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..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s graphicsmagick >/dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
|
||||
(apt-get update -qq && apt-get -qq -y --no-install-recommends install graphicsmagick && apt-get clean)"
|
||||
|
||||
CID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $CID) -eq 0
|
||||
@@ -1518,7 +1572,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
|
||||
```
|
||||
@@ -1894,25 +1947,6 @@ DOKKU_SCHEDULER="$1"; APP="$2";
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-is-deployed`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
> between minor releases until the 1.0 release.
|
||||
|
||||
- Description: Allows you to check if an app has been deployed
|
||||
- Invoked by: `dokku ps:rebuild`
|
||||
- Arguments: `$DOKKU_SCHEDULER $APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
DOKKU_SCHEDULER="$1"; APP="$2";
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `scheduler-logs`
|
||||
|
||||
> Warning: The scheduler plugin trigger apis are under development and may change
|
||||
@@ -2104,6 +2138,21 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_REPO="$3"; IMAGE_TAG="$4";
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `storage-list`
|
||||
|
||||
- Description: Returns a list of storage mounts
|
||||
- Invoked by: `dokku storage:list` and `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"
|
||||
|
||||
# TODO
|
||||
```
|
||||
### `tags-create`
|
||||
|
||||
- Description: Allows you to run commands once a tag for an app image has been added
|
||||
|
||||
@@ -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.23.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'
|
||||
|
||||
@@ -5,7 +5,7 @@ As of 0.3.18, Dokku defaults to being installed via Debian package. While certai
|
||||
```shell
|
||||
# install prerequisites
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y apt-transport-https
|
||||
sudo apt-get -qq -y --no-install-recommends install apt-transport-https
|
||||
|
||||
# install docker
|
||||
wget -nv -O - https://get.docker.com/ | sh
|
||||
@@ -16,7 +16,7 @@ OS_ID="$(lsb_release -cs 2>/dev/null || echo "bionic")"
|
||||
echo "xenial bionic focal" | grep -q "$OS_ID" || OS_ID="bionic"
|
||||
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
|
||||
sudo apt-get update -qq >/dev/null
|
||||
sudo apt-get install -qq -y dokku
|
||||
sudo apt-get -qq -y install dokku
|
||||
sudo dokku plugin:install-dependencies --core
|
||||
```
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# DigitalOcean Droplet Installation Notes
|
||||
|
||||
[DigitalOcean](https://www.digitalocean.com/products/compute/) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
|
||||
[DigitalOcean](https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083) offers a pre-installed Dokku image. You can run this image on any sized Droplet, although larger Droplets will allow you to run larger applications.
|
||||
|
||||
> **Please disable IPv6**. There are known issues with IPv6 on DigitalOcean and Docker. If you would like to run Dokku on an IPv6 DigitalOcean Droplet, please consult [this guide](https://jeffloughridge.wordpress.com/2015/01/17/native-ipv6-functionality-in-docker/).
|
||||
|
||||
1. Login to your [DigitalOcean](https://m.do.co/c/fe06b043a083) account.
|
||||
2. Click **Create a Droplet**.
|
||||
3. Under **Choose an image > One-click apps**, choose the latest **Dokku** release for 18.04 _(version numbers may vary)_.
|
||||
3. Under **Choose an image > Marketplace**, search latest **Dokku** release for Ubuntu 20.04 _(version numbers may vary)_.
|
||||
4. Under **Choose a size**, select your machine spec.
|
||||
5. Under **Choose a datacenter region**, select your region.
|
||||
6. Add an SSH Key.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Pull the dokku/dokku image:
|
||||
|
||||
```shell
|
||||
docker pull dokku/dokku:0.22.3
|
||||
docker pull dokku/dokku:0.23.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.23.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.23.7/bootstrap.sh;
|
||||
sudo DOKKU_TAG=v0.23.7 bash bootstrap.sh
|
||||
```
|
||||
|
||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||
|
||||
@@ -235,4 +235,4 @@ This isn't usually an issue with Dokku, but rather an app config problem. This c
|
||||
|
||||
In Rails at least, if your `application.rb` or `environmnents/production.rb` include the line `configure.force_ssl = true` which includes HSTS, try commenting that out and redeploying.
|
||||
|
||||
If this solves the issue temporarily, longer term you should consider [configuring SSL](http://dokku.viewdocs.io/dokku/configuration/ssl/).
|
||||
If this solves the issue temporarily, longer term you should consider [configuring SSL](/docs/configuration/ssl.md).
|
||||
|
||||
@@ -19,6 +19,7 @@ Docker releases updates periodically to their engine. We recommend reading their
|
||||
|
||||
Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded.
|
||||
|
||||
- [Upgrading to 0.23](/docs/appendices/0.23.0-migration-guide.md)
|
||||
- [Upgrading to 0.22](/docs/appendices/0.22.0-migration-guide.md)
|
||||
- [Upgrading to 0.21](/docs/appendices/0.21.0-migration-guide.md)
|
||||
- [Upgrading to 0.20](/docs/appendices/0.20.0-migration-guide.md)
|
||||
@@ -89,17 +90,17 @@ When installing from source, this is available from `contrib/dokku-update`, and
|
||||
|
||||
## Upgrading using `apt`
|
||||
|
||||
If Dokku was installed in a Debian or Ubuntu system, via `apt install dokku` or `bootstrap.sh`, you can upgrade with `apt`:
|
||||
If Dokku was installed in a Debian or Ubuntu system, via `apt-get install dokku` or `bootstrap.sh`, you can upgrade with `apt-get`:
|
||||
|
||||
```shell
|
||||
# update your local apt cache
|
||||
sudo apt update
|
||||
sudo apt-get update -qq
|
||||
|
||||
# update dokku and its dependencies
|
||||
sudo apt install -qq -y dokku herokuish sshcommand plugn gliderlabs-sigil
|
||||
sudo apt-get -qq -y --no-install-recommends install dokku herokuish sshcommand plugn gliderlabs-sigil dokku-update dokku-event-listener
|
||||
|
||||
# or just upgrade every package:
|
||||
sudo apt upgrade
|
||||
sudo apt-get upgrade
|
||||
```
|
||||
|
||||
## Upgrading from source
|
||||
|
||||
@@ -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.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.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.23.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.23.7 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
@@ -212,7 +215,7 @@
|
||||
</div>
|
||||
|
||||
<div class="alternate-instructions">
|
||||
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://www.digitalocean.com/features/one-click-apps/dokku/" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
|
||||
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://marketplace.digitalocean.com/apps/dokku?refcode=fe06b043a083" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/dreamhost/">DreamHost Cloud</a> instructions.</p>
|
||||
<p>Still no love? <a href="https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md" target="_blank">Contributions welcome</a>!</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
29
docs/processes/entering-containers.md
Normal file
29
docs/processes/entering-containers.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Entering containers
|
||||
|
||||
> New as of 0.4.0
|
||||
|
||||
```
|
||||
enter <app> [<container-type> || --container-id <container-id>] # Connect to a specific app container
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The `enter` command can be used to enter a running container. The following variations of the command exist:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app web
|
||||
dokku enter node-js-app web.1
|
||||
dokku enter node-js-app --container-id ID
|
||||
```
|
||||
|
||||
Additionally, the `enter` command can be executed with no `<container-type>`. If only a single `<container-type>` is defined in the app's Procfile, executing `enter` will drop the terminal into the only running container. This behavior is not supported when specifying a custom command; as described below.
|
||||
|
||||
By default, it runs a `/bin/bash`, but can also be used to run a custom command:
|
||||
|
||||
```shell
|
||||
# just echo hi
|
||||
dokku enter node-js-app web echo hi
|
||||
|
||||
# run a long-running command, as one might for a cron task
|
||||
dokku enter node-js-app web python script/background-worker.py
|
||||
```
|
||||
62
docs/processes/one-off-tasks.md
Normal file
62
docs/processes/one-off-tasks.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# One-off Tasks
|
||||
|
||||
```
|
||||
run [ --env KEY=VALUE | -e KEY=VALUE ] <app> <cmd> # Run a command in a new container using the current application image
|
||||
```
|
||||
|
||||
Sometimes it is necessary to run a one-off command under an application. Dokku makes it easy to run a fresh container via the `run` command.
|
||||
|
||||
## Usage
|
||||
|
||||
The `run` command can be used to run a one-off process for a specific command. This will start a new container and run the desired command within that container. Note that this container will be stay around even after command completes. The container will be the same container as was used to start the currently deployed application.
|
||||
|
||||
```shell
|
||||
# runs `ls -lah` in the `/app` directory of the application `node-js-app`
|
||||
dokku run node-js-app ls -lah
|
||||
|
||||
# optionally, run can be passed custom environment variables
|
||||
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
|
||||
```
|
||||
|
||||
The `run` command can also be used to run a command defined in the app `Procfile`:
|
||||
|
||||
```
|
||||
console: bundle exec racksh
|
||||
```
|
||||
|
||||
```shell
|
||||
# runs `bundle exec racksh` in the `/app` directory of the application `my-app`
|
||||
dokku run my-app console
|
||||
```
|
||||
|
||||
If the container running the command should be removed after exit, the `--rm-container` or `--rm` global flags can be specified to remove the containers automatically:
|
||||
|
||||
```shell
|
||||
dokku --rm-container run node-js-app ls -lah
|
||||
dokku --rm run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Alternatively, a global property can be set to always remove `run` containers.
|
||||
|
||||
```shell
|
||||
# don't keep `run` containers around
|
||||
dokku config:set --global DOKKU_RM_CONTAINER=1
|
||||
|
||||
# revert the above setting and keep containers around
|
||||
dokku config:unset --global DOKKU_RM_CONTAINER
|
||||
```
|
||||
|
||||
Containers may have specific labels attached. In order to avoid issues with dokku internals, do not use any labels beginning with either `com.dokku` or `org.label-schema`.
|
||||
|
||||
```shell
|
||||
dokku --label=com.example.test-label=value run node-js-app ls -lah
|
||||
```
|
||||
|
||||
Finally, a container can be run in "detached" mode via the `--detach` Dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as Dokku will *not* automatically terminate the container.
|
||||
|
||||
```shell
|
||||
dokku --detach run node-js-app ls -lah
|
||||
# returns the ID of the new container
|
||||
```
|
||||
|
||||
> Note that the `--rm-container` or `--rm` flags cannot be used when running containers in detached mode, and attempting to do so will result in the `--detach` flag being ignored.
|
||||
193
docs/processes/scheduled-cron-tasks.md
Normal file
193
docs/processes/scheduled-cron-tasks.md
Normal file
@@ -0,0 +1,193 @@
|
||||
# Scheduled Cron Tasks
|
||||
|
||||
> New as of 0.23.0
|
||||
|
||||
```
|
||||
cron:list <app> # List scheduled cron tasks for an app
|
||||
cron:report [<app>] [<flag>] # Display report about an app
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Dokku Managed Cron
|
||||
|
||||
Dokku automates scheduled `dokku run` commands via it's `app.json` cron integration.
|
||||
|
||||
#### Specifying commands
|
||||
|
||||
The `app.json` file for a given app can define a special `cron` key that contains a list of commands to run on given schedules. The following is a simple example `app.json` that simply runs the command `true` once a day:
|
||||
|
||||
```
|
||||
{
|
||||
"cron": [
|
||||
{
|
||||
"command": "true",
|
||||
"schedule": "@daily"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
A cron entry takes the following properties:
|
||||
|
||||
- `command`: A command to be run within the built app image. Specified commands can also be `Procfile` entries.
|
||||
- `schedule`: A [cron-compatible](https://en.wikipedia.org/wiki/Cron#Overview) scheduling definition upon which to run the command. Seconds are generally not supported.
|
||||
|
||||
Zero or more cron commands can be specified per app. Cron entries are validated after the build artifact is created but before the app is deployed, and the cron schedule is updated during the post-deploy phase.
|
||||
|
||||
#### Task Environment
|
||||
|
||||
When running scheduled cron tasks, there are a few items to be aware of:
|
||||
|
||||
- Scheduled cron tasks are performed within the app environment available at runtime. If the app image does not exist, the command may fail to execute.
|
||||
- Schedules are performed on the hosting server's timezone, which is typically UTC.
|
||||
- At this time, only the `PATH` and `SHELL` environment variables are specified in the cron template.
|
||||
- Each scheduled task is executed within a one-off `run` container, and thus inherit any docker-options specified for `run` containers.Resources are never shared between scheduled tasks.
|
||||
- Tasks are always executed using the `--rm` flag, and are never executed in detached mode.
|
||||
- Scheduled cron tasks are supported on a per-scheduler basis, and are currently only implemented by the `docker-local` scheduler.
|
||||
- Tasks for _all_ apps managed by the `docker-local` scheduler are written to a single crontab file owned by the `dokku` user. The `dokku` user's crontab should be considered reserved for this purpose.
|
||||
|
||||
#### Listing Cron tasks
|
||||
|
||||
Cron tasks for an app can be listed via the `cron:list` command. This command takes an `app` argument.
|
||||
|
||||
```shell
|
||||
dokku cron:list node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
ID Schedule Command
|
||||
cGhwPT09cGhwIHRlc3QucGhwPT09QGRhaWx5 @daily node index.js
|
||||
cGhwPT09dHJ1ZT09PSogKiAqICogKg== * * * * * true
|
||||
```
|
||||
|
||||
#### Displaying reports for an app
|
||||
|
||||
You can get a report about the cron configuration for apps using the `cron:report` command:
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app cron information
|
||||
Cron task count: 2
|
||||
=====> python-sample cron information
|
||||
Cron task count: 0
|
||||
=====> ruby-sample cron information
|
||||
Cron task count: 10
|
||||
```
|
||||
|
||||
You can run the command for a specific app also.
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app
|
||||
```
|
||||
|
||||
```
|
||||
=====> node-js-app cron information
|
||||
Cron task count: 2
|
||||
```
|
||||
|
||||
You can pass flags which will output only the value of the specific information you want. For example:
|
||||
|
||||
```shell
|
||||
dokku cron:report node-js-app --cron-task-count
|
||||
```
|
||||
|
||||
### Self Managed Cron
|
||||
|
||||
> Warning: Self-managed cron tasks should be considered advanced usage. While the instructions are available, users are highly encouraged to use the built-in scheduled cron task support unless absolutely necessary.
|
||||
|
||||
Some installations may require more fine-grained control over cron usage. The following are advanced instructions for configuring cron.
|
||||
|
||||
#### Using `run` for cron tasks
|
||||
|
||||
You can always use a one-off container to run an app task:
|
||||
|
||||
```shell
|
||||
dokku --rm run node-js-app some-command
|
||||
dokku --rm-container run node-js-app some-command
|
||||
```
|
||||
|
||||
For tasks that should not be interrupted, run is the *preferred* method of handling cron tasks, as the container will continue running even during a deploy or scaling event. The trade-off is that there will be an increase in memory usage if there are multiple concurrent tasks running.
|
||||
|
||||
|
||||
#### Using `enter` for cron tasks
|
||||
|
||||
Your Procfile can have the following entry:
|
||||
|
||||
```Procfile
|
||||
cron: sleep infinity
|
||||
```
|
||||
|
||||
With the `cron` process scaled to `1`:
|
||||
|
||||
```shell
|
||||
dokku ps:scale node-js-app cron=1
|
||||
```
|
||||
|
||||
You can now run all your commands in that container:
|
||||
|
||||
```shell
|
||||
dokku enter node-js-app cron some-command
|
||||
```
|
||||
|
||||
Note that you can also run multiple commands at the same time to reduce memory usage, though that may result in polluting the container environment.
|
||||
|
||||
For tasks that will properly resume, you *should* use the above method, as running tasks will be interrupted during deploys and scaling events, and subsequent commands will always run with the latest container. Note that if you scale the cron container down, this may interrupt proper running of the task.
|
||||
|
||||
#### General cron recommendations
|
||||
|
||||
Regularly scheduled tasks can be a bit of a pain with Dokku. The following are general recommendations to follow to help ensure successful task runs.
|
||||
|
||||
- Use the `dokku` user in your cron entry.
|
||||
- If you do not, the `dokku` binary will attempt to execute with `sudo`, and your cron run with fail with `sudo: no tty present and no askpass program specified`.
|
||||
- Add a `MAILTO` environment variable to ship cron emails to yourself.
|
||||
- Add a `PATH` environment variable or specify the full path to binaries on the host.
|
||||
- Add a `SHELL` environment variable to specify Bash when running commands.
|
||||
- Keep your cron tasks in time-sorted order.
|
||||
- Keep your server time in UTC so you don't need to translate daylight savings time when reading the cronfile.
|
||||
- Run tasks at the lowest traffic times if possible.
|
||||
- Use cron to *trigger* jobs, not run them. Use a real queuing system such as rabbitmq to actually process jobs.
|
||||
- Try to keep tasks quiet so that mails only send on errors.
|
||||
- Do not silence standard error or standard out. If you silence the former, you will miss failures. Silencing the latter means you should actually make app changes to handle log levels.
|
||||
- Use a service such as [Dead Man's Snitch](https://deadmanssnitch.com) to verify that cron tasks completed successfully.
|
||||
- Add lots of comments to your cronfile, including what a task is doing, so that you don't spend time deciphering the file later.
|
||||
- Place your cronfiles in a pattern such as `/etc/cron.d/APP`.
|
||||
- Do not use non-ASCII characters in your cronfile names. cron is finicky.
|
||||
- Remember to have trailing newlines in your cronfile! cron is finicky.
|
||||
|
||||
The following is a sample cronfile that you can use for your apps:
|
||||
|
||||
```cron
|
||||
# server cron jobs
|
||||
MAILTO="mail@dokku.me"
|
||||
PATH=/usr/local/bin:/usr/bin:/bin
|
||||
SHELL=/bin/bash
|
||||
|
||||
# m h dom mon dow username command
|
||||
# * * * * * dokku command to be executed
|
||||
# - - - - -
|
||||
# | | | | |
|
||||
# | | | | +----- day of week (0 - 6) (Sunday=0)
|
||||
# | | | +------- month (1 - 12)
|
||||
# | | +--------- day of month (1 - 31)
|
||||
# | +----------- hour (0 - 23)
|
||||
# +----------- min (0 - 59)
|
||||
|
||||
### HIGH TRAFFIC TIME IS B/W 00:00 - 04:00 AND 14:00 - 23:59
|
||||
### RUN YOUR TASKS FROM 04:00 - 14:00
|
||||
### KEEP SORTED IN TIME ORDER
|
||||
|
||||
### PLACE ALL CRON TASKS BELOW
|
||||
|
||||
# removes unresponsive users from the subscriber list to decrease bounce rates
|
||||
0 0 * * * dokku dokku --rm run node-js-app some-command
|
||||
|
||||
# sends out our email alerts to users
|
||||
0 1 * * * dokku dokku ps:scale node-js-app cron=1 && dokku enter node-js-app cron some-other-command && dokku ps:scale node-js-app cron=0
|
||||
|
||||
### PLACE ALL CRON TASKS ABOVE, DO NOT REMOVE THE WHITESPACE AFTER THIS LINE
|
||||
|
||||
```
|
||||
@@ -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.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.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.23.7/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.7/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.7/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.7/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.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.23.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>
|
||||
@@ -121,8 +124,6 @@
|
||||
<a href="/{{NAME}}/deployment/application-management/" class="list-group-item">Application Management</a>
|
||||
<a href="/{{NAME}}/deployment/logs/" class="list-group-item">Application Logs</a>
|
||||
<a href="/{{NAME}}/deployment/remote-commands/" class="list-group-item">Remote Commands</a>
|
||||
<a href="/{{NAME}}/deployment/one-off-processes/" class="list-group-item">One-Off Processes/Cron</a>
|
||||
<a href="/{{NAME}}/deployment/process-management/" class="list-group-item">Process Scaling</a>
|
||||
<a href="/{{NAME}}/deployment/user-management/" class="list-group-item">User Management</a>
|
||||
<a href="/{{NAME}}/deployment/zero-downtime-deploys/" class="list-group-item">Zero Downtime Deploy Checks</a>
|
||||
|
||||
@@ -142,6 +143,13 @@
|
||||
<a href="/{{NAME}}/configuration/nginx/" class="list-group-item">Nginx Configuration</a>
|
||||
<a href="/{{NAME}}/configuration/ssl/" class="list-group-item">SSL Configuration</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Process Management</a>
|
||||
|
||||
<a href="/{{NAME}}/processes/entering-containers/" class="list-group-item">Entering Containers</a>
|
||||
<a href="/{{NAME}}/processes/one-off-tasks/" class="list-group-item">One-Off Tasks</a>
|
||||
<a href="/{{NAME}}/processes/process-management/" class="list-group-item">Process Scaling</a>
|
||||
<a href="/{{NAME}}/processes/scheduled-cron-tasks/" class="list-group-item">Scheduled Cron Tasks</a>
|
||||
|
||||
<a href="#" class="list-group-item disabled">Network Management</a>
|
||||
|
||||
<a href="/{{NAME}}/networking/dns/" class="list-group-item">DNS Configuration</a>
|
||||
@@ -172,12 +180,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>
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
|
||||
"application-deployment": "deployment/application-deployment/",
|
||||
"checks-examples": "deployment/zero-downtime-deploys/",
|
||||
"process-management": "deployment/process-management/",
|
||||
"remote-commands": "deployment/remote-commands/",
|
||||
|
||||
"process-management": "processes/process-management/",
|
||||
"deployment/process-management": "processes/process-management/",
|
||||
"deployment/one-off-processes": "processes/one-off-tasks/",
|
||||
|
||||
"deployment/buildpacks": "deployment/methods/herokuish-buildpacks/",
|
||||
"deployment/methods/buildpacks": "deployment/methods/herokuish-buildpacks/",
|
||||
"deployment/dockerfiles": "deployment/methods/dockerfiles/",
|
||||
@@ -30,6 +33,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/"
|
||||
}
|
||||
}
|
||||
|
||||
22
dokku
22
dokku
@@ -42,6 +42,7 @@ DOKKU_DISTRO=$(
|
||||
export DOCKER_BIN=${DOCKER_BIN:="docker"}
|
||||
|
||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish:latest"}
|
||||
export DOKKU_CNB_BUILDER=${DOKKU_CNB_BUILDER:="heroku/buildpacks"}
|
||||
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
|
||||
|
||||
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
|
||||
@@ -59,6 +60,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
|
||||
@@ -87,10 +89,13 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||
fi
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H "$0" "$@"
|
||||
exit $?
|
||||
if [[ $(id -un) != "dokku" ]]; then
|
||||
unset TMP TMPDIR TEMP TEMPDIR
|
||||
if [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]] || [[ $1 == "ssh-keys:remove" ]]; then
|
||||
@@ -236,14 +241,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
version | -v | --version)
|
||||
if [[ -f "$DOKKU_LIB_ROOT/STABLE_VERSION" ]]; then
|
||||
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/STABLE_VERSION")
|
||||
elif [[ -f "$DOKKU_LIB_ROOT/VERSION" ]]; then
|
||||
DOKKU_VERSION=$(cat "${DOKKU_LIB_ROOT}/VERSION")
|
||||
else
|
||||
dokku_log_fail "Unable to determine dokku's version"
|
||||
fi
|
||||
echo "dokku version ${DOKKU_VERSION}"
|
||||
dokku_version
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.23.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -9,6 +9,10 @@ cmd-report() {
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
if [[ "$APP" == "--format" ]]; then
|
||||
dokku_log_fail "--format flag not supported on global report"
|
||||
fi
|
||||
|
||||
dokku_log_info1 "uname: $(uname -a)"
|
||||
dokku_log_info1 "memory: "
|
||||
free -m | sed "s/^/ /"
|
||||
@@ -16,12 +20,14 @@ cmd-report() {
|
||||
"$DOCKER_BIN" version | sed "s/^/ /"
|
||||
dokku_log_info1 "docker daemon info: "
|
||||
"$DOCKER_BIN" -D system info | sed "s/^/ /"
|
||||
dokku_log_info1 "git version: $(git --version)"
|
||||
dokku_log_info1 "sigil version: $(sigil -v)"
|
||||
dokku_log_info1 "herokuish version: "
|
||||
"$DOCKER_BIN" container run $DOKKU_GLOBAL_RUN_ARGS --rm "$DOKKU_IMAGE" herokuish version | sed "s/^/ /"
|
||||
dokku_log_info1 "dokku version: $(dokku version)"
|
||||
dokku_log_info1 "dokku version: $(dokku_version)"
|
||||
dokku_log_info1 "plugn version: $(plugn version)"
|
||||
dokku_log_info1 "dokku plugins: "
|
||||
dokku plugin:list | sed "s/^/ /"
|
||||
plugn list | sed "s/^/ /"
|
||||
|
||||
if [[ "$APP" == "--all" ]]; then
|
||||
for app in $(dokku_apps); do
|
||||
|
||||
@@ -8,11 +8,24 @@ cmd-run() {
|
||||
declare cmd="run"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP=""
|
||||
|
||||
local SCHEDULER_ID
|
||||
declare -a RUN_ENV
|
||||
RUN_ENV=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--cron-id=*)
|
||||
local arg=$(printf "%s" "$1" | sed -E 's/(^--cron-id=)//g')
|
||||
SCHEDULER_ID+=("$arg")
|
||||
shift
|
||||
;;
|
||||
--cron-id)
|
||||
if [[ ! $2 ]]; then
|
||||
dokku_log_warn "expected $1 to have an argument"
|
||||
break
|
||||
fi
|
||||
CRON_ID+=("$2")
|
||||
shift 2
|
||||
;;
|
||||
-e=* | --env=*)
|
||||
local arg=$(printf "%s" "$1" | sed -E 's/(^-e=)|(^--env=)//g')
|
||||
RUN_ENV+=("$arg")
|
||||
@@ -37,7 +50,7 @@ cmd-run() {
|
||||
verify_app_name "$APP"
|
||||
|
||||
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
|
||||
plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
|
||||
DOKKU_CRON_ID="$CRON_ID" plugn trigger scheduler-run "$DOKKU_SCHEDULER" "$APP" "${#RUN_ENV[@]}" "${RUN_ENV[@]}" "$@"
|
||||
}
|
||||
|
||||
cmd-run "$@"
|
||||
|
||||
@@ -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
plugins/20_events/config-export
Symbolic link
1
plugins/20_events/config-export
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/cron-entries
Symbolic link
1
plugins/20_events/cron-entries
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/cron-write
Symbolic link
1
plugins/20_events/cron-write
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -8,8 +8,8 @@ cmd-events-help() {
|
||||
local plugin_name="events"
|
||||
local plugin_description="Manage event logging"
|
||||
|
||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
||||
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||
echo ''
|
||||
echo "$plugin_description"
|
||||
echo ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.23.7"
|
||||
[plugin.config]
|
||||
|
||||
1
plugins/20_events/scheduler-register-retired
Symbolic link
1
plugins/20_events/scheduler-register-retired
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/storage-list
Symbolic link
1
plugins/20_events/storage-list
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/app-json/.gitignore
vendored
1
plugins/app-json/.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/triggers
|
||||
/pre-*
|
||||
/post-*
|
||||
/install
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
TRIGGERS = triggers/post-deploy triggers/pre-deploy
|
||||
TRIGGERS = triggers/install triggers/post-delete triggers/post-deploy triggers/pre-deploy
|
||||
BUILD = triggers
|
||||
PLUGIN_NAME = app-json
|
||||
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
package appjson
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
)
|
||||
|
||||
// AppJSON is a struct that represents an app.json file as understood by Dokku
|
||||
type AppJSON struct {
|
||||
Cron []CronCommand `json:"cron"`
|
||||
Scripts struct {
|
||||
Dokku struct {
|
||||
Predeploy string `json:"predeploy"`
|
||||
@@ -23,367 +17,18 @@ type AppJSON struct {
|
||||
} `json:"scripts"`
|
||||
}
|
||||
|
||||
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
|
||||
if hasEntrypoint {
|
||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||
if err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
|
||||
return nil
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
script := []string{"set -eo pipefail;"}
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
script = append(script, "set -x;")
|
||||
}
|
||||
|
||||
if isHerokuishImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/app' ]]; then",
|
||||
" export HOME=/app;",
|
||||
" cd $HOME;",
|
||||
"fi;",
|
||||
"if [[ -d '/app/.profile.d' ]]; then",
|
||||
" for file in /app/.profile.d/*; do source $file; done;",
|
||||
"fi;",
|
||||
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -rf /tmp/cache ;",
|
||||
" ln -sf /cache /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(command, "/") {
|
||||
commandBin := strings.Split(command, " ")[0]
|
||||
script = append(script, []string{
|
||||
fmt.Sprintf("if [[ ! -x \"%s\" ]]; then", commandBin),
|
||||
" echo specified binary is not executable;",
|
||||
" exit 1;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
||||
|
||||
if isHerokuishImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -f /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
return []string{shell, "-c", strings.Join(script, " ")}
|
||||
// CronCommand is a struct that represents a single cron command from an app.json file
|
||||
type CronCommand struct {
|
||||
Command string `json:"command"`
|
||||
Schedule string `json:"schedule"`
|
||||
}
|
||||
|
||||
// getPhaseScript extracts app.json from app image and returns the appropriate json key/value
|
||||
func getPhaseScript(appName string, image string, phase string) (string, error) {
|
||||
appJSONFile, err := ioutil.TempFile(os.TempDir(), fmt.Sprintf("dokku-%s-%s", common.MustGetEnv("DOKKU_PID"), "getPhaseScript"))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot create temporary file: %v", err)
|
||||
}
|
||||
|
||||
defer os.Remove(appJSONFile.Name())
|
||||
|
||||
common.CopyFromImage(appName, image, "app.json", appJSONFile.Name())
|
||||
if !common.FileExists(appJSONFile.Name()) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadFile(appJSONFile.Name())
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(string(b)) == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var appJSON AppJSON
|
||||
if err = json.Unmarshal(b, &appJSON); err != nil {
|
||||
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
||||
}
|
||||
|
||||
if phase == "predeploy" {
|
||||
return appJSON.Scripts.Dokku.Predeploy, nil
|
||||
}
|
||||
|
||||
return appJSON.Scripts.Dokku.Postdeploy, nil
|
||||
// GetAppjsonDirectory returns the directory containing a given app's extracted app.json file
|
||||
func GetAppjsonDirectory(appName string) string {
|
||||
return filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json", appName)
|
||||
}
|
||||
|
||||
// getReleaseCommand extracts the release command from a given app's procfile
|
||||
func getReleaseCommand(appName string, image string) string {
|
||||
err := common.SuppressOutput(func() error {
|
||||
return common.PlugnTrigger("procfile-extract", []string{appName, image}...)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
processType := "release"
|
||||
port := "5000"
|
||||
b, _ := common.PlugnTriggerOutput("procfile-get-command", []string{appName, processType, port}...)
|
||||
return strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
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[:]))
|
||||
}
|
||||
|
||||
if b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...); strings.TrimSpace(string(b[:])) != "" {
|
||||
dokkuAppShell = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
return dokkuAppShell
|
||||
}
|
||||
|
||||
func executeScript(appName string, imageTag string, phase string) error {
|
||||
common.LogInfo1(fmt.Sprintf("Checking for %s task", phase))
|
||||
image, err := common.GetDeployingAppImageName(appName, imageTag, "")
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
command := ""
|
||||
phaseSource := ""
|
||||
if phase == "release" {
|
||||
command = getReleaseCommand(appName, image)
|
||||
phaseSource = "Procfile"
|
||||
} else {
|
||||
var err error
|
||||
phaseSource = "app.json"
|
||||
if command, err = getPhaseScript(appName, image, phase); err != nil {
|
||||
common.LogExclaim(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
common.LogVerbose(fmt.Sprintf("No %s task found, skipping", phase))
|
||||
return nil
|
||||
}
|
||||
|
||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||
dockerfileEntrypoint := ""
|
||||
dockerfileCommand := ""
|
||||
if !isHerokuishImage {
|
||||
dockerfileEntrypoint, _ = getEntrypointFromImage(image)
|
||||
dockerfileCommand, _ = getCommandFromImage(image)
|
||||
}
|
||||
|
||||
hasEntrypoint := dockerfileEntrypoint != ""
|
||||
dokkuAppShell := getDokkuAppShell(appName)
|
||||
script := constructScript(command, dokkuAppShell, isHerokuishImage, hasEntrypoint)
|
||||
|
||||
imageSourceType := "dockerfile"
|
||||
if isHerokuishImage {
|
||||
imageSourceType = "herokuish"
|
||||
}
|
||||
|
||||
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
||||
cacheHostDir := fmt.Sprintf("%s/cache", common.AppHostRoot(appName))
|
||||
if !common.DirectoryExists(cacheDir) {
|
||||
os.MkdirAll(cacheDir, 0755)
|
||||
}
|
||||
|
||||
var dockerArgs []string
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-deploy", []string{appName, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-process-deploy", []string{appName, imageSourceType, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
filteredArgs := []string{"restart", "cpus", "memory", "memory-swap", "memory-reservation", "gpus"}
|
||||
for _, filteredArg := range filteredArgs {
|
||||
// re := regexp.MustCompile("--" + filteredArg + "=[0-9A-Za-z!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]+ ")
|
||||
|
||||
var filteredDockerArgs []string
|
||||
for _, dockerArg := range dockerArgs {
|
||||
if !strings.HasPrefix(dockerArg, "--"+filteredArg+"=") {
|
||||
filteredDockerArgs = append(filteredDockerArgs, dockerArg)
|
||||
}
|
||||
}
|
||||
|
||||
dockerArgs = filteredDockerArgs
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, "--label=dokku_phase_script="+phase)
|
||||
dockerArgs = append(dockerArgs, "-v", cacheHostDir+":/cache")
|
||||
if os.Getenv("DOKKU_TRACE") != "" {
|
||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||
}
|
||||
|
||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||
if err != nil {
|
||||
common.LogFail(fmt.Sprintf("Failed to create %s execution container: %s", phase, err.Error()))
|
||||
}
|
||||
|
||||
if !waitForExecution(containerID) {
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogFail(fmt.Sprintf("Execution of %s task failed: %s", phase, command))
|
||||
}
|
||||
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
|
||||
if phase != "predeploy" {
|
||||
return nil
|
||||
}
|
||||
|
||||
commitArgs := []string{"container", "commit"}
|
||||
if !isHerokuishImage {
|
||||
if dockerfileEntrypoint != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
||||
}
|
||||
|
||||
if dockerfileCommand != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileCommand)
|
||||
}
|
||||
}
|
||||
|
||||
commitArgs = append(commitArgs, []string{
|
||||
"--change",
|
||||
"LABEL org.label-schema.schema-version=1.0",
|
||||
"--change",
|
||||
"LABEL org.label-schema.vendor=dokku",
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.app-name=%s", appName),
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.%s-phase=true", phase),
|
||||
}...)
|
||||
commitArgs = append(commitArgs, containerID, image)
|
||||
containerCommitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
commitArgs...,
|
||||
)
|
||||
containerCommitCmd.ShowOutput = false
|
||||
containerCommitCmd.Command.Stderr = os.Stderr
|
||||
if !containerCommitCmd.Execute() {
|
||||
common.LogFail(fmt.Sprintf("Commiting of '%s' to image failed: %s", phase, command))
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("scheduler-register-retired", []string{appName, containerID}...)
|
||||
}
|
||||
|
||||
func getEntrypointFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Entrypoint}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var entrypoint []string
|
||||
if err = json.Unmarshal([]byte(output), &entrypoint); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(entrypoint) == 3 && entrypoint[0] == "/bin/sh" && entrypoint[1] == "-c" {
|
||||
return fmt.Sprintf("ENTRYPOINT %s", entrypoint[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(entrypoint)
|
||||
return fmt.Sprintf("ENTRYPOINT %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func getCommandFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Cmd}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var command []string
|
||||
if err = json.Unmarshal([]byte(output), &command); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(command) == 3 && command[0] == "/bin/sh" && command[1] == "-c" {
|
||||
return fmt.Sprintf("CMD %s", command[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(command)
|
||||
return fmt.Sprintf("CMD %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func waitForExecution(containerID string) bool {
|
||||
containerStartCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"start",
|
||||
containerID,
|
||||
)
|
||||
containerStartCmd.ShowOutput = false
|
||||
containerStartCmd.Command.Stderr = os.Stderr
|
||||
if !containerStartCmd.Execute() {
|
||||
return false
|
||||
}
|
||||
|
||||
containerWaitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"wait",
|
||||
containerID,
|
||||
)
|
||||
|
||||
containerWaitCmd.ShowOutput = false
|
||||
containerWaitCmd.Command.Stderr = os.Stderr
|
||||
b, err := containerWaitCmd.Output()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
containerExitCode := strings.TrimSpace(string(b[:]))
|
||||
return containerExitCode == "0"
|
||||
}
|
||||
|
||||
func createdContainerID(appName string, dockerArgs []string, image string, command []string, phase string) (string, error) {
|
||||
runLabelArgs := fmt.Sprintf("--label=com.dokku.app-name=%s", appName)
|
||||
|
||||
arguments := strings.Split(common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"), " ")
|
||||
arguments = append(arguments, runLabelArgs)
|
||||
arguments = append(arguments, dockerArgs...)
|
||||
|
||||
arguments = append([]string{"container", "create"}, arguments...)
|
||||
arguments = append(arguments, image)
|
||||
arguments = append(arguments, command...)
|
||||
|
||||
containerCreateCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
arguments...,
|
||||
)
|
||||
var stderr bytes.Buffer
|
||||
containerCreateCmd.ShowOutput = false
|
||||
containerCreateCmd.Command.Stderr = &stderr
|
||||
|
||||
b, err := containerCreateCmd.Output()
|
||||
if err != nil {
|
||||
return "", errors.New(stderr.String())
|
||||
}
|
||||
|
||||
containerID := strings.TrimSpace(string(b))
|
||||
err = common.PlugnTrigger("post-container-create", []string{"app", appName, containerID, phase}...)
|
||||
return containerID, err
|
||||
// GetAppjsonPath returns the path to a given app's extracted app.json file
|
||||
func GetAppjsonPath(appName string) string {
|
||||
return filepath.Join(GetAppjsonDirectory(appName), "app.json")
|
||||
}
|
||||
|
||||
429
plugins/app-json/functions.go
Normal file
429
plugins/app-json/functions.go
Normal file
@@ -0,0 +1,429 @@
|
||||
package appjson
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func constructScript(command string, shell string, isHerokuishImage bool, isCnbImage bool, hasEntrypoint bool) []string {
|
||||
if hasEntrypoint {
|
||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||
if err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
|
||||
return nil
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
script := []string{"set -eo pipefail;"}
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
script = append(script, "set -x;")
|
||||
}
|
||||
|
||||
if isHerokuishImage && !isCnbImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/app' ]]; then",
|
||||
" export HOME=/app;",
|
||||
" cd $HOME;",
|
||||
"fi;",
|
||||
"if [[ -d '/app/.profile.d' ]]; then",
|
||||
" for file in /app/.profile.d/*; do source $file; done;",
|
||||
"fi;",
|
||||
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -rf /tmp/cache ;",
|
||||
" ln -sf /cache /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(command, "/") {
|
||||
commandBin := strings.Split(command, " ")[0]
|
||||
script = append(script, []string{
|
||||
fmt.Sprintf("if [[ ! -x \"%s\" ]]; then", commandBin),
|
||||
" echo specified binary is not executable;",
|
||||
" exit 1;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
||||
|
||||
if isHerokuishImage && !isCnbImage {
|
||||
script = append(script, []string{
|
||||
"if [[ -d '/cache' ]]; then",
|
||||
" rm -f /tmp/cache;",
|
||||
"fi;",
|
||||
}...)
|
||||
}
|
||||
|
||||
return []string{shell, "-c", strings.Join(script, " ")}
|
||||
}
|
||||
|
||||
// getPhaseScript extracts app.json from app image and returns the appropriate json key/value
|
||||
func getPhaseScript(appName string, phase string) (string, error) {
|
||||
if !common.FileExists(GetAppjsonPath(appName)) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
b, err := ioutil.ReadFile(GetAppjsonPath(appName))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(string(b)) == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var appJSON AppJSON
|
||||
if err = json.Unmarshal(b, &appJSON); err != nil {
|
||||
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
||||
}
|
||||
|
||||
if phase == "predeploy" {
|
||||
return appJSON.Scripts.Dokku.Predeploy, nil
|
||||
}
|
||||
|
||||
return appJSON.Scripts.Dokku.Postdeploy, nil
|
||||
}
|
||||
|
||||
// getReleaseCommand extracts the release command from a given app's procfile
|
||||
func getReleaseCommand(appName string, image string) string {
|
||||
err := common.SuppressOutput(func() error {
|
||||
return common.PlugnTrigger("procfile-extract", []string{appName, image}...)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
processType := "release"
|
||||
port := "5000"
|
||||
b, _ := common.PlugnTriggerOutput("procfile-get-command", []string{appName, processType, port}...)
|
||||
return strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
func getDokkuAppShell(appName string) string {
|
||||
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-get", []string{appName, "DOKKU_APP_SHELL"}...)
|
||||
appShell = strings.TrimSpace(string(b[:]))
|
||||
return nil
|
||||
})
|
||||
|
||||
errs.Wait()
|
||||
if appShell != "" {
|
||||
shell = appShell
|
||||
} else if globalShell != "" {
|
||||
shell = globalShell
|
||||
}
|
||||
|
||||
return shell
|
||||
}
|
||||
|
||||
func executeScript(appName string, image string, imageTag string, phase string) error {
|
||||
common.LogInfo1(fmt.Sprintf("Checking for %s task", phase))
|
||||
command := ""
|
||||
phaseSource := ""
|
||||
if phase == "release" {
|
||||
command = getReleaseCommand(appName, image)
|
||||
phaseSource = "Procfile"
|
||||
} else {
|
||||
var err error
|
||||
phaseSource = "app.json"
|
||||
if command, err = getPhaseScript(appName, phase); err != nil {
|
||||
common.LogExclaim(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if command == "" {
|
||||
common.LogVerbose(fmt.Sprintf("No %s task found, skipping", phase))
|
||||
return nil
|
||||
}
|
||||
|
||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||
isCnbImage := common.IsImageCnbBased(image)
|
||||
dockerfileEntrypoint := ""
|
||||
dockerfileCommand := ""
|
||||
if !isHerokuishImage {
|
||||
dockerfileEntrypoint, _ = getEntrypointFromImage(image)
|
||||
dockerfileCommand, _ = getCommandFromImage(image)
|
||||
}
|
||||
|
||||
hasEntrypoint := dockerfileEntrypoint != ""
|
||||
dokkuAppShell := getDokkuAppShell(appName)
|
||||
script := constructScript(command, dokkuAppShell, isHerokuishImage, isCnbImage, hasEntrypoint)
|
||||
|
||||
imageSourceType := "dockerfile"
|
||||
if isHerokuishImage {
|
||||
imageSourceType = "herokuish"
|
||||
} else if isCnbImage {
|
||||
imageSourceType = "cnb"
|
||||
}
|
||||
|
||||
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
||||
cacheHostDir := fmt.Sprintf("%s/cache", common.AppHostRoot(appName))
|
||||
if !common.DirectoryExists(cacheDir) {
|
||||
os.MkdirAll(cacheDir, 0755)
|
||||
}
|
||||
|
||||
var dockerArgs []string
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-deploy", []string{appName, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
if b, err := common.PlugnTriggerSetup("docker-args-process-deploy", []string{appName, imageSourceType, imageTag}...).SetInput("").Output(); err == nil {
|
||||
words, err := shellquote.Split(strings.TrimSpace(string(b[:])))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, words...)
|
||||
}
|
||||
|
||||
filteredArgs := []string{"restart", "cpus", "memory", "memory-swap", "memory-reservation", "gpus"}
|
||||
for _, filteredArg := range filteredArgs {
|
||||
// re := regexp.MustCompile("--" + filteredArg + "=[0-9A-Za-z!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]+ ")
|
||||
|
||||
var filteredDockerArgs []string
|
||||
for _, dockerArg := range dockerArgs {
|
||||
if !strings.HasPrefix(dockerArg, "--"+filteredArg+"=") {
|
||||
filteredDockerArgs = append(filteredDockerArgs, dockerArg)
|
||||
}
|
||||
}
|
||||
|
||||
dockerArgs = filteredDockerArgs
|
||||
}
|
||||
|
||||
dockerArgs = append(dockerArgs, "--label=dokku_phase_script="+phase)
|
||||
dockerArgs = append(dockerArgs, "-v", cacheHostDir+":/cache")
|
||||
if os.Getenv("DOKKU_TRACE") != "" {
|
||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||
}
|
||||
if isCnbImage {
|
||||
// TODO: handle non-linux lifecycles
|
||||
// Ideally we don't have to override this but `pack` injects the web process
|
||||
// as the default entrypoint, so we need to specify the launcher so the script
|
||||
// runs as expected
|
||||
dockerArgs = append(dockerArgs, "--entrypoint=/cnb/lifecycle/launcher")
|
||||
}
|
||||
|
||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||
if err != nil {
|
||||
common.LogFail(fmt.Sprintf("Failed to create %s execution container: %s", phase, err.Error()))
|
||||
}
|
||||
|
||||
if !waitForExecution(containerID) {
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogFail(fmt.Sprintf("Execution of %s task failed: %s", phase, command))
|
||||
}
|
||||
|
||||
common.LogInfo2Quiet(fmt.Sprintf("Start of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
common.LogVerboseQuietContainerLogs(containerID)
|
||||
common.LogInfo2Quiet(fmt.Sprintf("End of %s %s task (%s) output", appName, phase, containerID[0:9]))
|
||||
|
||||
if phase != "predeploy" {
|
||||
return nil
|
||||
}
|
||||
|
||||
commitArgs := []string{"container", "commit"}
|
||||
if !isHerokuishImage || isCnbImage {
|
||||
if dockerfileEntrypoint != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
||||
}
|
||||
|
||||
if dockerfileCommand != "" {
|
||||
commitArgs = append(commitArgs, "--change", dockerfileCommand)
|
||||
}
|
||||
}
|
||||
|
||||
commitArgs = append(commitArgs, []string{
|
||||
"--change",
|
||||
"LABEL org.label-schema.schema-version=1.0",
|
||||
"--change",
|
||||
"LABEL org.label-schema.vendor=dokku",
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.app-name=%s", appName),
|
||||
"--change",
|
||||
fmt.Sprintf("LABEL com.dokku.%s-phase=true", phase),
|
||||
}...)
|
||||
commitArgs = append(commitArgs, containerID, image)
|
||||
containerCommitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
commitArgs...,
|
||||
)
|
||||
containerCommitCmd.ShowOutput = false
|
||||
containerCommitCmd.Command.Stderr = os.Stderr
|
||||
if !containerCommitCmd.Execute() {
|
||||
common.LogFail(fmt.Sprintf("Commiting of '%s' to image failed: %s", phase, command))
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("scheduler-register-retired", []string{appName, containerID}...)
|
||||
}
|
||||
|
||||
func getEntrypointFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Entrypoint}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var entrypoint []string
|
||||
if err = json.Unmarshal([]byte(output), &entrypoint); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(entrypoint) == 3 && entrypoint[0] == "/bin/sh" && entrypoint[1] == "-c" {
|
||||
return fmt.Sprintf("ENTRYPOINT %s", entrypoint[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(entrypoint)
|
||||
return fmt.Sprintf("ENTRYPOINT %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func getCommandFromImage(image string) (string, error) {
|
||||
output, err := common.DockerInspect(image, "{{json .Config.Cmd}}")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output == "null" {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var command []string
|
||||
if err = json.Unmarshal([]byte(output), &command); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(command) == 3 && command[0] == "/bin/sh" && command[1] == "-c" {
|
||||
return fmt.Sprintf("CMD %s", command[2]), nil
|
||||
}
|
||||
|
||||
serializedEntrypoint, err := json.Marshal(command)
|
||||
return fmt.Sprintf("CMD %s", string(serializedEntrypoint)), err
|
||||
}
|
||||
|
||||
func waitForExecution(containerID string) bool {
|
||||
containerStartCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"start",
|
||||
containerID,
|
||||
)
|
||||
containerStartCmd.ShowOutput = false
|
||||
containerStartCmd.Command.Stderr = os.Stderr
|
||||
if !containerStartCmd.Execute() {
|
||||
return false
|
||||
}
|
||||
|
||||
containerWaitCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
"container",
|
||||
"wait",
|
||||
containerID,
|
||||
)
|
||||
|
||||
containerWaitCmd.ShowOutput = false
|
||||
containerWaitCmd.Command.Stderr = os.Stderr
|
||||
b, err := containerWaitCmd.Output()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
containerExitCode := strings.TrimSpace(string(b[:]))
|
||||
return containerExitCode == "0"
|
||||
}
|
||||
|
||||
func createdContainerID(appName string, dockerArgs []string, image string, command []string, phase string) (string, error) {
|
||||
runLabelArgs := fmt.Sprintf("--label=com.dokku.app-name=%s", appName)
|
||||
|
||||
arguments := strings.Split(common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS"), " ")
|
||||
arguments = append(arguments, runLabelArgs)
|
||||
arguments = append(arguments, dockerArgs...)
|
||||
|
||||
arguments = append([]string{"container", "create"}, arguments...)
|
||||
arguments = append(arguments, image)
|
||||
arguments = append(arguments, command...)
|
||||
|
||||
b, err := common.PlugnTriggerOutput("config-export", []string{appName, "false", "true", "json"}...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
var env map[string]string
|
||||
if err := json.Unmarshal(b, &env); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
containerCreateCmd := common.NewShellCmdWithArgs(
|
||||
common.DockerBin(),
|
||||
arguments...,
|
||||
)
|
||||
var stderr bytes.Buffer
|
||||
containerCreateCmd.Env = env
|
||||
containerCreateCmd.ShowOutput = false
|
||||
containerCreateCmd.Command.Stderr = &stderr
|
||||
|
||||
b, err = containerCreateCmd.Output()
|
||||
if err != nil {
|
||||
return "", errors.New(stderr.String())
|
||||
}
|
||||
|
||||
containerID := strings.TrimSpace(string(b))
|
||||
err = common.PlugnTrigger("post-container-create", []string{"app", appName, containerID, phase}...)
|
||||
return containerID, err
|
||||
}
|
||||
|
||||
func refreshAppJSON(appName string, image string) error {
|
||||
baseDirectory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json")
|
||||
if !common.DirectoryExists(baseDirectory) {
|
||||
return errors.New("Run 'dokku plugin:install' to ensure the correct directories exist")
|
||||
}
|
||||
|
||||
directory := GetAppjsonDirectory(appName)
|
||||
if !common.DirectoryExists(directory) {
|
||||
if err := os.MkdirAll(directory, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
appjsonPath := GetAppjsonPath(appName)
|
||||
if common.FileExists(appjsonPath) {
|
||||
if err := os.Remove(appjsonPath); err != nil {
|
||||
return errors.New("Unable to remove previous app.json file")
|
||||
}
|
||||
}
|
||||
|
||||
common.CopyFromImage(appName, image, "app.json", appjsonPath)
|
||||
return nil
|
||||
}
|
||||
@@ -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,6 @@ 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=
|
||||
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 app-json plugin"
|
||||
version = "0.22.3"
|
||||
version = "0.23.7"
|
||||
[plugin.config]
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/app-json"
|
||||
appjson "github.com/dokku/dokku/plugins/app-json"
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
@@ -18,6 +18,11 @@ func main() {
|
||||
|
||||
var err error
|
||||
switch trigger {
|
||||
case "install":
|
||||
err = appjson.TriggerInstall()
|
||||
case "post-delete":
|
||||
appName := flag.Arg(0)
|
||||
err = appjson.TriggerPostDelete(appName)
|
||||
case "post-deploy":
|
||||
appName := flag.Arg(0)
|
||||
imageTag := flag.Arg(3)
|
||||
|
||||
@@ -1,8 +1,47 @@
|
||||
package appjson
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// TriggerInstall initializes app restart policies
|
||||
func TriggerInstall() error {
|
||||
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json")
|
||||
if err := os.MkdirAll(directory, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := common.SetPermissions(directory, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerPostDelete destroys the app-json data for a given app container
|
||||
func TriggerPostDelete(appName string) error {
|
||||
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json", appName)
|
||||
dataErr := os.RemoveAll(directory)
|
||||
propertyErr := common.PropertyDestroy("app-json", appName)
|
||||
|
||||
if dataErr != nil {
|
||||
return dataErr
|
||||
}
|
||||
|
||||
return propertyErr
|
||||
}
|
||||
|
||||
// TriggerPostDeploy is a trigger to execute the postdeploy deployment task
|
||||
func TriggerPostDeploy(appName string, imageTag string) error {
|
||||
if err := executeScript(appName, imageTag, "postdeploy"); err != nil {
|
||||
image, err := common.GetDeployingAppImageName(appName, imageTag, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := executeScript(appName, image, imageTag, "postdeploy"); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -10,11 +49,20 @@ func TriggerPostDeploy(appName string, imageTag string) error {
|
||||
|
||||
// TriggerPreDeploy is a trigger to execute predeploy and release deployment tasks
|
||||
func TriggerPreDeploy(appName string, imageTag string) error {
|
||||
if err := executeScript(appName, imageTag, "predeploy"); err != nil {
|
||||
image, err := common.GetDeployingAppImageName(appName, imageTag, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := executeScript(appName, imageTag, "release"); err != nil {
|
||||
if err := refreshAppJSON(appName, image); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := executeScript(appName, image, imageTag, "predeploy"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := executeScript(appName, image, imageTag, "release"); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// ReportSingleApp is an internal function that displays the app report for one or more apps
|
||||
func ReportSingleApp(appName, infoFlag string) error {
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
deploySource := ""
|
||||
if b, err := common.PlugnTriggerSetup("deploy-source", []string{appName}...).SetInput("").Output(); err != nil {
|
||||
deploySource = strings.TrimSpace(string(b[:]))
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
@@ -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.23.7"
|
||||
[plugin.config]
|
||||
|
||||
52
plugins/apps/report.go
Normal file
52
plugins/apps/report.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package apps
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
// ReportSingleApp is an internal function that displays the app report for one or more apps
|
||||
func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
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, format, 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"
|
||||
}
|
||||
|
||||
return locked
|
||||
}
|
||||
@@ -65,11 +65,12 @@ 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 {
|
||||
format := args.String("format", "stdout", "format: [ stdout | json ]")
|
||||
osArgs, infoFlag, flagErr := common.ParseReportArgs("apps", os.Args[2:])
|
||||
if flagErr == nil {
|
||||
args.Parse(osArgs)
|
||||
appName := args.Arg(0)
|
||||
err = apps.CommandReport(appName, infoFlag)
|
||||
err = apps.CommandReport(appName, *format, infoFlag)
|
||||
}
|
||||
case "unlock":
|
||||
args := flag.NewFlagSet("apps:unlock", flag.ExitOnError)
|
||||
|
||||
@@ -35,7 +35,7 @@ func main() {
|
||||
err = apps.TriggerPostDelete(appName)
|
||||
case "report":
|
||||
appName := flag.Arg(0)
|
||||
err = apps.ReportSingleApp(appName, "")
|
||||
err = apps.ReportSingleApp(appName, "", "")
|
||||
default:
|
||||
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -187,29 +175,25 @@ func CommandRename(oldAppName string, newAppName string, skipDeploy bool) error
|
||||
}
|
||||
|
||||
// CommandReport displays an app report for one or more apps
|
||||
func CommandReport(appName string, infoFlag string) error {
|
||||
func CommandReport(appName string, format string, infoFlag string) error {
|
||||
if len(appName) == 0 {
|
||||
apps, err := common.DokkuApps()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, appName := range apps {
|
||||
if err := ReportSingleApp(appName, infoFlag); err != nil {
|
||||
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
return ReportSingleApp(appName, infoFlag)
|
||||
return ReportSingleApp(appName, format, infoFlag)
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user