From 5a522863092c677c392c34d477d245e583144d46 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 17 Jul 2019 17:44:42 -0400 Subject: [PATCH 1/3] fix: ensure the dokku-retire timer is properly installed Closes #3615 --- plugins/scheduler-docker-local/install | 6 ++++++ tests/unit/30_scheduler-docker-local.bats | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/unit/30_scheduler-docker-local.bats diff --git a/plugins/scheduler-docker-local/install b/plugins/scheduler-docker-local/install index 174853aa8..41e05975d 100755 --- a/plugins/scheduler-docker-local/install +++ b/plugins/scheduler-docker-local/install @@ -38,9 +38,15 @@ Description=Run dokku-retire.service every 5 minutes [Timer] OnCalendar=*:0/5 +Persistent=true + +[Install] +WantedBy=timers.target EOF if command -v systemctl &>/dev/null; then systemctl --quiet reenable dokku-retire + systemctl --quiet enable dokku-retire.timer + systemctl --quiet start dokku-retire.timer fi else cat </etc/cron.d/dokku-retire diff --git a/tests/unit/30_scheduler-docker-local.bats b/tests/unit/30_scheduler-docker-local.bats new file mode 100644 index 000000000..1a2b39336 --- /dev/null +++ b/tests/unit/30_scheduler-docker-local.bats @@ -0,0 +1,18 @@ +#!/usr/bin/env bats + +load test_helper + +setup() { + global_setup +} + +teardown() { + global_teardown +} + +@test "(scheduler-docker-local) timer installed" { + run /bin/bash -c "systemctl list-timers | grep dokku-retire" + echo "output: $output" + echo "status: $status" + assert_success +} From 402c6db8269479d4804ca9103c12f61b799d119a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 17 Jul 2019 17:59:38 -0400 Subject: [PATCH 2/3] chore: move the event logging to it's own tag Without this, rsyslog will shunt any logging output from the dokku user to the event log, garbling output for future investigation. --- plugins/20_events/install | 9 ++++++++- plugins/common/functions | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/20_events/install b/plugins/20_events/install index 7146f27cd..d4b7131e3 100755 --- a/plugins/20_events/install +++ b/plugins/20_events/install @@ -38,7 +38,14 @@ fi if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then cat >"$DOKKU_RSYSLOG_FILTER" <"$DOKKU_RSYSLOG_FILTER" < Date: Wed, 17 Jul 2019 19:31:25 -0400 Subject: [PATCH 3/3] feat: build on systemd --- .circleci/config.yml | 14 ++++++++++---- tests/ci/setup.sh | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7748e480..41fe25837 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,25 @@ version: 2 jobs: build: - machine: true + machine: + image: ubuntu-1604:201903-01 parallelism: 4 steps: - checkout + - run: | + if [[ "$(lsb_release -rs)" == "14.04" ]]; then + # dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0 + sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0 + else + # dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to ens4 + sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev ens4 + fi - run: | make ci-dependencies - run: | ./tests/ci/setup.sh - run: | echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup - - run: | - # dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0 - sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0 - run: | case $CIRCLE_NODE_INDEX in 0) sudo -E make -e lint go-tests ci-go-coverage ;; diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index 77c61f0aa..190f2812e 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -27,7 +27,7 @@ install_dependencies() { sudo add-apt-repository -y ppa:nginx/stable sudo apt-get update - sudo apt-get -qq -y install nginx + sudo apt-get -qq -y install cgroupfs-mount nginx sudo cp "${ROOT_DIR}/tests/dhparam.pem" /etc/nginx/dhparam.pem sudo dpkg -i "${ROOT_DIR}/build/$HEROKUISH_PACKAGE_NAME"