这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
40b20e0
refactor: move herokuish app cache from the filesystem into a docker …
josegonzalez Nov 28, 2022
60b3434
feat: add support for specifying multiple networks on a given app
josegonzalez May 29, 2023
3c5a98c
chore: remove stickler-ci config
josegonzalez Jul 1, 2023
5dc2f20
fix: remove all containers and images by label on app destroy
josegonzalez Jul 1, 2023
4436bb2
chore: standardize on ls subcommand when interacting with the docker …
josegonzalez Jul 1, 2023
dac566e
refactor: move all shellcheck disable definitions to .shellcheckrc file
josegonzalez Jul 1, 2023
ef25a9b
refactor: standardize on shorthand for redirecting all output to /dev…
josegonzalez Jul 1, 2023
bbbe0e7
fix: do not start proxy implementations during server restore if they…
josegonzalez Jul 1, 2023
f7c46a4
fix: mount the traefik data directory instead of the acme.json file w…
josegonzalez Jul 1, 2023
a0b84d5
docs: clarify that a branch can be specified when updating a plugin
josegonzalez Jul 2, 2023
64f0f26
refactor: move all port management code to standalone ports plugin
josegonzalez Jul 2, 2023
eb6f85f
feat: skip scaled processes that are missing in the Procfile
josegonzalez May 29, 2023
afc3185
refactor: move crontab writing code to scheduler-docker-local plugin
josegonzalez Jul 2, 2023
820883e
feat: add json format output to cron:list command
josegonzalez Jul 2, 2023
1d0d050
feat: mount the vector data directory instead of the vector file
josegonzalez Jul 2, 2023
798a413
feat: re-add apps and config cli aliases
josegonzalez Jul 2, 2023
515994c
feat: add the ability to execute a cron task on the fly
josegonzalez Jul 2, 2023
9bd6e17
docs: update migration guide to point out other important changes
josegonzalez Jul 2, 2023
914475f
refactor: use ports-get plugn trigger for fetching port mappings
josegonzalez Jul 8, 2023
11d9ed6
tests: use ports:report to get the list of port mappings
josegonzalez Jul 8, 2023
b8680f7
fix: automatically clear the git source-image property when changing …
josegonzalez Jul 8, 2023
94f4d13
feat: export environment variables during dockerfile builds for use w…
josegonzalez Jul 1, 2023
fb9d778
refactor: move CHECKS file extraction to the beginning of the deploy
josegonzalez Jul 2, 2023
1431724
feat: use ports-clear plugn trigger to manage clearing the port map
josegonzalez Jul 8, 2023
87c4cb7
docs: sort the plugin triggers
josegonzalez Jul 9, 2023
bdf0b6c
Add application/wasm to nginx.conf.sigil gzip
dearlordylord Jul 7, 2023
121e473
refactor: move code that fetches raw tcp ports for dockerfile deploys…
josegonzalez Jul 9, 2023
192f7cf
refactor: move code for fetching an available port to the ports plugin
josegonzalez Jul 9, 2023
48d5820
refactor: deprecate proxy-configure-ports plugin trigger in favor of …
josegonzalez Jul 2, 2023
977b456
refactor: simplify ports-configure codebase
josegonzalez Jul 9, 2023
f842869
refactor: move the proxy port map from config to property
josegonzalez Jul 9, 2023
b44be8d
refactor: rename port-map property to port
josegonzalez Jul 16, 2023
4bc3de5
feat: write auto-detected port mappings during a deploy
josegonzalez Jul 16, 2023
3f127a7
feat: inject docker labels when nginx proxy implementation is in use
josegonzalez Jul 25, 2023
2b1e173
fix: do not write empty values for nginx container labels
josegonzalez Jul 30, 2023
04905bf
fix: run go mod update
josegonzalez Jul 31, 2023
5717e71
tests: use an alternative curl request to ensure requests go to the l…
josegonzalez Jul 31, 2023
1467aae
tests: fix issue where networks weren't being torn down during testing
josegonzalez Jul 31, 2023
d6468f4
tests: use assert_output_not_exists instead of asserting output is em…
josegonzalez Jul 31, 2023
c127946
fix: use correct quoting in format template when fetching exposed ima…
josegonzalez Jul 31, 2023
69e56fc
fix: remove debugging code from builder-dockerfile plugin
josegonzalez Jul 31, 2023
6225480
tests: add assertions to various bats tests
josegonzalez Jul 31, 2023
aee691a
fix: use correct namespace for haproxy service state tracking
josegonzalez Aug 1, 2023
72e8c8d
tests: correct assertion for dockerfile builds when a variable is eval'd
josegonzalez Aug 5, 2023
a84f9bc
tests: remove assertion for unconsumed build arguments
josegonzalez Aug 5, 2023
56e18be
feat: upgrade vector image from 0.23.x to 0.31.x
josegonzalez Aug 5, 2023
3218a49
feat: upgrade caddy image from 2.7 to 2.8
josegonzalez Aug 5, 2023
d06f337
feat: upgrade traefik image from v2.8 to v2.10
josegonzalez Aug 5, 2023
6168b0c
tests: correct assertion for dockerfile builds when a variable is eval'd
josegonzalez Aug 5, 2023
f8ccf52
refactor: only use detected port mapping if override is not specified
josegonzalez Jul 12, 2023
7f7a044
docs: clean up references in proxy plugins
josegonzalez Aug 5, 2023
5846301
tests: make it possible to specify an alternative base domain for tests
josegonzalez Aug 5, 2023
625ea14
feat: add openresty proxy implementation
josegonzalez Aug 1, 2023
6f0b32e
Merge pull request #6082 from dokku/openresty-docker-proxy
josegonzalez Aug 6, 2023
26e9cc9
feat: add support for non-web healthchecks via app.json
josegonzalez Aug 5, 2023
a0d9246
Merge pull request #6100 from dokku/2760-non-web-healthchecks
josegonzalez Aug 6, 2023
5b738f5
docs: deprecated ARM as a build target
josegonzalez Aug 7, 2023
f311421
Merge pull request #6102 from dokku/josegonzalez-patch-1
josegonzalez Aug 7, 2023
e09b0eb
feat: timeout docker image builds in CI
josegonzalez Aug 7, 2023
990ca04
Merge pull request #6103 from dokku/timeout-image-builds
josegonzalez Aug 7, 2023
8d25b93
fix: correctly handle rebase when generating release notes for minor/…
josegonzalez Jul 1, 2023
6cdd81c
Merge pull request #6110 from dokku/fix-release-changelog
josegonzalez Aug 9, 2023
24d9457
feat: make heroku-22/jammy the default stack for cnb/herokuish builds
josegonzalez Aug 9, 2023
22cfab9
Merge pull request #6109 from dokku/heroku-22
josegonzalez Aug 9, 2023
1ee0fc7
docs: remove extra newline
josegonzalez Aug 9, 2023
c7c1e4a
Merge pull request #6116 from dokku/josegonzalez-patch-1
josegonzalez Aug 9, 2023
038b768
fix: correct version
josegonzalez Aug 14, 2023
00d0212
fix: pull 100 results when fetching PRs per milestone
josegonzalez Aug 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/commands/ci-setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
set -eo pipefail
set -x

DOKKU_DOMAIN=${DOKKU_DOMAIN:="dokku.me"}

echo "=====> set hostname"
hostname
internal_ip="$(ifconfig eth0 | grep 'inet ' | awk '{print $2}')"
sudo hostname "dokku.me"
echo "dokku.me" | sudo tee /etc/hostname
sudo hostname "$DOKKU_DOMAIN"
echo "$DOKKU_DOMAIN" | sudo tee /etc/hostname
hostname
sudo cat /etc/hostname

echo "=====> resolve dokku.me"
echo "=====> resolve $DOKKU_DOMAIN"
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
if [[ "$DOKKU_DOMAIN" == "dokku.me" ]]; then
# 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
fi

echo "=====> install ci-dependencies"
make ci-dependencies
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: build docker image
timeout-minutes: 20
run: |
docker buildx build \
--platform ${{ matrix.architecture }} \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ jobs:
- name: Run shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
# 1.1.0 => 94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
env:
# keep in sync with tests/shellcheck-exclude
SHELLCHECK_OPTS: -e SC1001 -e SC1003 -e SC1090 -e SC1091 -e SC1117 -e SC2029 -e SC2030 -e SC2031 -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 -e SC2267 -e SC2295

shfmt:
name: shfmt
Expand Down
34 changes: 29 additions & 5 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
# SC1001 - This \/ will be a regular '/' in this context - https://github.com/koalaman/shellcheck/wiki/SC1001
# SC1003 - Want to escape a single quote? echo 'This is how it'\''s done' - https://github.com/koalaman/shellcheck/wiki/SC1003
# SC1090 - Can't follow non-constant source. Use a directive to specify location - https://github.com/koalaman/shellcheck/wiki/SC1090
# SC1091 - Not following: FILE: does not exist (No such file or directory) - https://github.com/koalaman/shellcheck/wiki/SC1091
# - used for sourcing function files throughout the codebase
# SC1117 - Backslash is literal in "\n". Prefer explicit escaping: "\\n" - https://github.com/koalaman/shellcheck/wiki/SC1117
# SC2029 - Note that, unescaped, this expands on the client side - https://github.com/koalaman/shellcheck/wiki/SC2029
# SC2030 - Modification of var is local (to subshell caused by pipeline). - https://github.com/koalaman/shellcheck/wiki/SC2030
# SC2031 - var was modified in a subshell. That change might be lost. - https://github.com/koalaman/shellcheck/wiki/SC2031
# SC2034 - VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034
# - used for declaring desc and deprecated function variables
# SC2046 - Quote this to prevent word splitting - https://github.com/koalaman/shellcheck/wiki/SC2046
# SC2064 - Use single quotes, otherwise this expands now rather than when signalled. - https://github.com/koalaman/shellcheck/wiki/SC2064
# - used for traps
# SC2068 - Double quote array expansions to avoid re-splitting elements - https://github.com/koalaman/shellcheck/wiki/SC2068
# SC2086 - Double quote to prevent globbing and word splitting - https://github.com/koalaman/shellcheck/wiki/SC2086
# SC2119 - Use 'function "$@"' if function's $1 should mean script's $1 - https://github.com/koalaman/shellcheck/wiki/SC2119
# SC2120 - Function references arguments, but none are ever passed - https://github.com/koalaman/shellcheck/wiki/SC2120
# SC2128 - Expanding an array without an index only gives the first element - https://github.com/koalaman/shellcheck/wiki/SC2128
# SC2148 - Tips depend on target shell and yours is unknown. Add a shebang - https://github.com/koalaman/shellcheck/wiki/SC2148
# SC2153 - Possible misspelling: DOKKU_ROOT may not be assigned, but DOKKU_PORT is - https://github.com/koalaman/shellcheck/wiki/SC2153
# SC2154 - Var is referenced but not assigned - https://github.com/koalaman/shellcheck/wiki/SC2154
# SC2155 - Declare and assign separately to avoid masking return values - https://github.com/koalaman/shellcheck/wiki/SC2155
# - used throughout the codebase
disable=SC1091,SC2034,SC2064,SC2155
# SC2162 - read without -r will mangle backslashes - https://github.com/koalaman/shellcheck/wiki/SC2162
# SC2174 - When used with -p, -m only applies to the deepest directory - https://github.com/koalaman/shellcheck/wiki/SC2174
# SC2179 - Use array+=("item") to append items to an array - https://github.com/koalaman/shellcheck/wiki/SC2179
# SC2191 - The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it - https://github.com/koalaman/shellcheck/wiki/SC2191
# SC2199 - Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @) - https://github.com/koalaman/shellcheck/wiki/SC2199
# SC2207 - Prefer mapfile or read -a to split command output (or quote to avoid splitting) - https://github.com/koalaman/shellcheck/wiki/SC2207
# SC2219 - Instead of 'let expr', prefer (( expr )) - https://github.com/koalaman/shellcheck/wiki/SC2219
# SC2220 - Invalid flags are not handled. Add a *) case - https://github.com/koalaman/shellcheck/wiki/SC2220
# SC2231 - Quote expansions in this for loop glob to prevent wordsplitting, e.g. "$dir"/*.txt - https://github.com/koalaman/shellcheck/wiki/SC2231
# SC2235 - Use { ..; } instead of (..) to avoid subshell overhead - https://github.com/koalaman/shellcheck/wiki/SC2235
# SC2267 - GNU xargs -i is deprecated in favor of -I{} - https://github.com/koalaman/shellcheck/wiki/SC2267
# SC2295 - Expansions inside ${..} need to be quoted separately, otherwise they match as patterns - https://github.com/koalaman/shellcheck/wiki/SC2295
disable=SC1001,SC1003,SC1090,SC1091,SC1117,SC2029,SC2030,SC2031,SC2034,SC2046,SC2064,SC2068,SC2086,SC2119,SC2120,SC2128,SC2148,SC2153,SC2154,SC2155,SC2162,SC2174,SC2179,SC2191,SC2199,SC2207,SC2219,SC2220,SC2231,SC2235,SC2267,SC2295
13 changes: 0 additions & 13 deletions .stickler.yml

This file was deleted.

11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DOKKU_VERSION ?= master
TARGETARCH ?= amd64

DOCKER_IMAGE_LABELER_VERSION ?= 0.5.0
DOCKER_CONTAINER_HEALTHCHECKER_VERSION ?= 0.6.4
HEROKUISH_VERSION ?= 0.6.0
LAMBDA_BUILDER_VERSION ?= 0.4.0
NETRC_VERSION ?= 0.6.0
Expand All @@ -11,14 +12,15 @@ PROCFILE_VERSION ?= 0.15.0
SIGIL_VERSION ?= 0.9.0
SSHCOMMAND_VERSION ?= 0.16.0
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_${TARGETARCH}.tgz
DOCKER_CONTAINER_HEALTHCHECKER_URL ?= https://github.com/dokku/docker-container-healthchecker/releases/download/v${DOCKER_CONTAINER_HEALTHCHECKER_VERSION}/docker-container-healthchecker_${DOCKER_CONTAINER_HEALTHCHECKER_VERSION}_linux_${TARGETARCH}.tgz
LAMBDA_BUILDER_URL ?= https://github.com/dokku/lambda-builder/releases/download/v${LAMBDA_BUILDER_VERSION}/lambda-builder_${LAMBDA_BUILDER_VERSION}_linux_${TARGETARCH}.tgz
NETRC_URL ?= https://github.com/dokku/netrc/releases/download/v${NETRC_VERSION}/netrc_${NETRC_VERSION}_linux_${TARGETARCH}.tgz
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v${PLUGN_VERSION}/plugn_${PLUGN_VERSION}_linux_${TARGETARCH}.tgz
PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v${PROCFILE_VERSION}/procfile-util_${PROCFILE_VERSION}_linux_${TARGETARCH}.tgz
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/gliderlabs-sigil_${SIGIL_VERSION}_linux_${TARGETARCH}.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-20
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest-22
DOKKU_LIB_ROOT ?= /var/lib/dokku
PLUGINS_PATH ?= ${DOKKU_LIB_ROOT}/plugins
CORE_PLUGINS_PATH ?= ${DOKKU_LIB_ROOT}/core-plugins
Expand Down Expand Up @@ -135,7 +137,7 @@ plugin-dependencies: plugn procfile-util
plugins: plugn procfile-util docker
sudo -E dokku plugin:install --core

dependencies: apt-update docker-image-labeler lambda-builder netrc sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq parallel
dependencies: apt-update docker-image-labeler docker-container-healthchecker lambda-builder netrc sshcommand plugn procfile-util docker help2man man-db sigil dos2unix jq parallel
$(MAKE) -e stack

apt-update:
Expand All @@ -161,6 +163,11 @@ docker-image-labeler:
tar xzf /tmp/docker-image-labeler_latest.tgz -C /usr/local/bin
mv /usr/local/bin/docker-image-labeler-${TARGETARCH} /usr/local/bin/docker-image-labeler

docker-container-healthchecker:
wget -qO /tmp/docker-container-healthchecker_latest.tgz ${DOCKER_CONTAINER_HEALTHCHECKER_URL}
tar xzf /tmp/docker-container-healthchecker_latest.tgz -C /usr/local/bin
mv /usr/local/bin/docker-container-healthchecker-${TARGETARCH} /usr/local/bin/docker-container-healthchecker

lambda-builder:
wget -qO /tmp/lambda-builder_latest.tgz ${LAMBDA_BUILDER_URL}
tar xzf /tmp/lambda-builder_latest.tgz -C /usr/local/bin
Expand Down
6 changes: 1 addition & 5 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ensure-environment() {
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
fi

hostname -f >/dev/null 2>&1 || {
hostname -f &>/dev/null || {
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"
}

Expand Down Expand Up @@ -220,19 +220,15 @@ install-dokku-from-deb-package() {
[[ -n $DOKKU_NGINX_ENABLE ]] && echo "dokku dokku/nginx_enable string $DOKKU_NGINX_ENABLE" | sudo debconf-set-selections

if [[ -n $DOKKU_CHECKOUT ]]; then
# shellcheck disable=SC2086
apt-get -qq -y $NO_INSTALL_RECOMMENDS install "dokku=$DOKKU_CHECKOUT"
else
# shellcheck disable=SC2086
apt-get -qq -y $NO_INSTALL_RECOMMENDS install dokku
fi
}

main() {
export DOKKU_DISTRO DOKKU_DISTRO_VERSION
# shellcheck disable=SC1091
DOKKU_DISTRO=$(. /etc/os-release && echo "$ID")
# shellcheck disable=SC1091
DOKKU_DISTRO_VERSION=$(. /etc/os-release && echo "$VERSION_ID")

export DEBIAN_FRONTEND=noninteractive
Expand Down
1 change: 0 additions & 1 deletion contrib/dokku-docker-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ set -eo pipefail
DOKKU_DOCKER_CONTAINER_NAME=${DOKKU_DOCKER_CONTAINER_NAME:=dokku}

# TODO: handle cases where we need a tty
# shellcheck disable=SC2086
docker exec $DOKKU_DOCKER_ENV -i "$DOKKU_DOCKER_CONTAINER_NAME" dokku "$@"
5 changes: 2 additions & 3 deletions contrib/dokku_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn-dokku-host() {
declare DOKKU_GIT_REMOTE="$1" DOKKU_HOST="$2"

if [[ -z "$DOKKU_HOST" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
if [[ -d .git ]] || git rev-parse --git-dir &>/dev/null; then
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
fi
fi
Expand Down Expand Up @@ -109,7 +109,7 @@ main() {
fi

if [[ -z "$APP" ]]; then
if [[ -d .git ]] || git rev-parse --git-dir >/dev/null 2>&1; then
if [[ -d .git ]] || git rev-parse --git-dir &>/dev/null; then
set +e
APP=$(git remote -v 2>/dev/null | grep -Ei "^${DOKKU_GIT_REMOTE}\s" | grep -Ei "dokku@$DOKKU_REMOTE_HOST" | head -n 1 | cut -f2 -d'@' | cut -f1 -d' ' | cut -f2 -d':' 2>/dev/null)
set -e
Expand Down Expand Up @@ -190,7 +190,6 @@ main() {
[[ -n "$APP_ARG" ]] && [[ "$APP_ARG" == "--global" ]] && unset APP
[[ -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_exit_code="$?"
echo " ! Failed to execute dokku command over ssh: exit code $?" 1>&2
Expand Down
3 changes: 2 additions & 1 deletion contrib/images/digitalocean/in_parts/012-dokku-packages
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ pkgs=(apache2-utils
debconf
)

dokku_pkgs=(docker-image-labeler
dokku_pkgs=(docker-docker-container-healthchecker
docker-image-labeler
gliderlabs-sigil
lambda-builder
netrc
Expand Down
8 changes: 0 additions & 8 deletions contrib/images/digitalocean/in_parts/100-image-check
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ cmdExists() {
function getDistro {
if [ -f /etc/os-release ]; then
# freedesktop.org and systemd
# shellcheck disable=SC1091
. /etc/os-release
OS=$NAME
VER=$VERSION_ID
Expand All @@ -41,7 +40,6 @@ function getDistro {
VER=$(lsb_release -sr)
elif [ -f /etc/lsb-release ]; then
# For some versions of Debian/Ubuntu without lsb_release command
# shellcheck disable=SC1091
. /etc/lsb-release
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
Expand Down Expand Up @@ -255,11 +253,9 @@ function checkUsers {
if [[ "${u[0]}" == "${user}" ]]; then
if [[ ${u[1]} == "!" ]] || [[ ${u[1]} == "!!" ]] || [[ ${u[1]} == "*" ]]; then
echo -en "\e[32m[PASS]\e[0m User ${user} has no password set.\n"
# shellcheck disable=SC2030
((PASS++))
else
echo -en "\e[41m[FAIL]\e[0m User ${user} has a password set on their account. Only system users are allowed on the image.\n"
# shellcheck disable=SC2030
((FAIL++))
STATUS=2
fi
Expand Down Expand Up @@ -292,7 +288,6 @@ function checkUsers {
STATUS=2
else
echo -en "\e[93m[WARN]\e[0m User \e[1m${user}\e[0m has empty private key file in \e[93m${key}\e[0m\n"
# shellcheck disable=SC2030
((WARN++))
if [[ $STATUS != 2 ]]; then
STATUS=1
Expand Down Expand Up @@ -352,11 +347,9 @@ function checkFirewall {
ufwa=$(ufw status | head -1 | sed -e "s/^Status:\ //")
if [[ $ufwa == "active" ]]; then
FW_VER="\e[32m[PASS]\e[0m Firewall service (${fw}) is active\n"
# shellcheck disable=SC2031
((PASS++))
else
FW_VER="\e[93m[WARN]\e[0m No firewall is configured. Ensure ${fw} is installed and configured\n"
# shellcheck disable=SC2031
((WARN++))
fi
elif [[ $OS == "CentOS Linux" ]] || [[ $OS == "CentOS Stream" ]] || [[ $OS == "Rocky Linux" ]] || [[ $OS == "AlmaLinux" ]]; then
Expand Down Expand Up @@ -451,7 +444,6 @@ function checkUpdates {
sleep 2
apt-get --just-print upgrade | grep -i security | awk '{print $2}' | awk '!seen[$0]++'
echo -en
# shellcheck disable=SC2031
((FAIL++))
STATUS=2
else
Expand Down
28 changes: 17 additions & 11 deletions contrib/release-dokku
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ readonly DOKKU_GIT_REV="$(git rev-parse HEAD)"
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT

log-info() {
# shellcheck disable=SC2034
declare desc="Log info formatter"
echo "$*"
}

log-error() {
# shellcheck disable=SC2034
declare desc="Log error formatter"
echo "! $*" 1>&2
}

log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit 1
Expand Down Expand Up @@ -186,8 +183,12 @@ fn-replace-version() {

fn-repo-merged-requests() {
declare desc="Retrieves all pull request ids since a given release of dokku"
declare TAG="$1"
git log "v${TAG}..HEAD" --oneline | grep "Merge pull request" | cut -d' ' -f 5 | cut -d '#' -f2
declare TAG="$1" IS_PATCH="$2"
if [[ "$IS_PATCH" == "true" ]]; then
git log "v${TAG}..HEAD" --oneline | grep "Merge pull request" | cut -d' ' -f 5 | cut -d '#' -f2
else
curl -u "$RELEASE_GITHUB_USERNAME:$RELEASE_GITHUB_API_TOKEN" --fail -sS "https://api.github.com/search/issues?q=repo:dokku/dokku+milestone:v${NEXT_VERSION}+is:pr&per_page=100" | jq '.items[].number'
fi
}

fn-repo-push-tags() {
Expand All @@ -204,7 +205,7 @@ fn-repo-push-tags() {

fn-repo-update() {
declare desc="Updates files within the repository for a given release"
declare IS_RELEASE="$1" CURRENT_VERSION="$2" NEXT_VERSION="$3"
declare IS_RELEASE="$1" CURRENT_VERSION="$2" NEXT_VERSION="$3" IS_PATCH="$4"

log-info "(release-dokku) Replacing ${CURRENT_VERSION} with ${NEXT_VERSION}"
for f in plugins/*/plugin.toml; do
Expand Down Expand Up @@ -241,21 +242,21 @@ fn-repo-update() {
fi

log-info "(release-dokku) Adding HISTORY.md, committing and tagging"
fn-repo-update-history-and-commit "$CURRENT_VERSION" "$NEXT_VERSION"
fn-repo-update-history-and-commit "$CURRENT_VERSION" "$NEXT_VERSION" "$IS_PATCH"
git tag "v${NEXT_VERSION}"
}

fn-repo-update-history-and-commit() {
declare desc="Updates the history file and commits the changes"
declare CURRENT_VERSION="$1" NEXT_VERSION="$2"
declare CURRENT_VERSION="$1" NEXT_VERSION="$2" IS_PATCH="$3"
local PULL_REQUEST_ID TITLE AUTHOR TYPE CHANGELOG_TEXT
local COMMIT_MESSAGE HISTORY HISTORY_CONTENTS HISTORY_BUG HISTORY_DEPENDENCY HISTORY_DEPRECATION HISTORY_DOCUMENTATION HISTORY_ENHANCEMENT HISTORY_BC_BREAK HISTORY_REFACTOR HISTORY_REMOVAL HISTORY_OTHER HISTORY_TESTS ISSUE_FILE

pushd "$ROOT_DIR" >/dev/null

mkdir -p /tmp/github-data

for PULL_REQUEST_ID in $(fn-repo-merged-requests "$CURRENT_VERSION"); do
for PULL_REQUEST_ID in $(fn-repo-merged-requests "$CURRENT_VERSION" "$IS_PATCH"); do
ISSUE_FILE="/tmp/github-data/${PULL_REQUEST_ID}.json"
if [[ ! -f "$ISSUE_FILE" ]]; then
while true; do
Expand Down Expand Up @@ -402,7 +403,7 @@ fn-build-docker-image() {

main() {
declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION IS_RELEASE
local CURRENT_VERSION NEXT_VERSION IS_PATCH IS_RELEASE
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish" "build")

if [[ "$RELEASE" == '--trace' ]]; then
Expand Down Expand Up @@ -433,9 +434,14 @@ main() {
NEXT_VERSION="$(fn-version-next "$CURRENT_VERSION" "$RELEASE")"
IS_RELEASE="$(fn-is-release "$RELEASE")"

IS_PATCH="false"
if [[ "$RELEASE" == "patch" ]]; then
IS_PATCH="true"
fi

echo "v${NEXT_VERSION}" >build/next-version

fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION" "$IS_PATCH"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_armhf.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_arm64.deb" || log-fail "Error extracting deb package"
Expand Down
3 changes: 0 additions & 3 deletions contrib/release-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ readonly TMP_WORK_DIR="$(mktemp -d "/tmp/dokku-plugin-release.XXXXXX")"
trap "rm -rf '$TMP_WORK_DIR' >/dev/null" RETURN INT TERM EXIT

log-info() {
# shellcheck disable=SC2034
declare desc="Log info formatter"
echo "$*"
}

log-error() {
# shellcheck disable=SC2034
declare desc="Log error formatter"
echo "! $*" 1>&2
}

log-fail() {
# shellcheck disable=SC2034
declare desc="Log fail formatter"
log-error "$*"
exit 1
Expand Down
1 change: 0 additions & 1 deletion debian/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -eo pipefail
[[ $TRACE ]] && set -x

if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
fi

Expand Down
Loading