2019-07-12 10:05:31 -07:00
DOKKU_SSH_PORT ?= 22
2023-08-05 16:32:58 -04:00
DOKKU_DOMAIN ?= dokku.me
2024-01-17 02:28:11 -05:00
GO_PLUGINS := $( shell sh -c 'find plugins -type f -name "go.mod" -exec dirname "{}" \; | sort -u | sed -e "s/$$/\/.../" | xargs' )
SYSTEM := $( shell sh -c 'uname -s 2>/dev/null' )
2015-10-31 15:27:13 -05:00
2018-12-30 08:02:17 -05:00
bats :
i f e q ( $( SYSTEM ) , D a r w i n )
2019-02-02 13:49:24 -05:00
i f n e q ( $( shell bats --version >/dev /null 2>&1 ; echo $ $ ?) , 0 )
2018-12-30 08:02:17 -05:00
brew install bats-core
e n d i f
e l s e
2021-01-17 16:18:24 -05:00
git clone https://github.com/bats-core/bats-core.git /tmp/bats
2018-12-30 08:02:17 -05:00
cd /tmp/bats && sudo ./install.sh /usr/local
rm -rf /tmp/bats
e n d i f
2014-12-13 18:56:31 -08:00
shellcheck :
2023-07-01 03:48:45 -04:00
i f n e q ( $( shell shellcheck --version >/dev /null 2>&1; echo $ $ ?) , 0 )
2015-10-31 15:27:13 -05:00
i f e q ( $( SYSTEM ) , D a r w i n )
brew install shellcheck
2014-12-13 18:56:31 -08:00
e l s e
2021-01-17 16:09:58 -05:00
sudo apt-get update -qq && sudo apt-get -qq -y --no-install-recommends install shellcheck
2014-12-13 18:56:31 -08:00
e n d i f
e n d i f
2019-01-07 01:04:17 -05:00
shfmt :
2023-07-01 03:48:45 -04:00
i f n e q ( $( shell shfmt --version >/dev /null 2>&1; echo $ $ ?) , 0 )
2026-05-25 12:51:23 +04:00
i f e q ( $( SYSTEM ) , D a r w i n )
2019-01-07 01:04:17 -05:00
brew install shfmt
e l s e
2022-10-12 21:53:11 -04:00
wget -qO /tmp/shfmt https://github.com/mvdan/sh/releases/download/v3.5.1/shfmt_v3.5.1_linux_${ TARGETARCH }
2019-01-07 01:04:17 -05:00
chmod +x /tmp/shfmt
sudo mv /tmp/shfmt /usr/local/bin/shfmt
e n d i f
e n d i f
2018-12-30 08:02:17 -05:00
xmlstarlet :
2019-02-02 13:49:24 -05:00
i f n e q ( $( shell xmlstarlet --version >/dev /null 2>&1 ; echo $ $ ?) , 0 )
2018-12-30 08:02:17 -05:00
i f e q ( $( SYSTEM ) , D a r w i n )
brew install xmlstarlet
e l s e
2021-01-17 16:09:58 -05:00
sudo apt-get update -qq && sudo apt-get -qq -y --no-install-recommends install xmlstarlet
2018-12-30 08:02:17 -05:00
e n d i f
e n d i f
2024-02-05 14:31:29 -05:00
ci-dependencies : bats shellcheck xmlstarlet docker -apt -repo
2023-08-26 13:03:19 -04:00
2024-02-05 14:31:29 -05:00
docker-apt-repo :
2023-08-26 13:03:19 -04:00
i f d e f I N S T A L L _ D O C K E R _ R E P O
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor --yes -o /usr/share/keyrings/docker.gpg
echo " deb [arch=amd64 signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $( shell . /etc/os-release && echo " $$ VERSION_CODENAME " ) stable " | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
2024-02-05 14:31:29 -05:00
sudo apt-get -qq -y --no-install-recommends install docker-buildx-plugin docker-compose-plugin
2023-08-26 13:03:19 -04:00
e n d i f
2014-12-13 18:56:31 -08:00
setup-deploy-tests :
2014-12-14 14:45:49 -08:00
i f d e f E N A B L E _ D O K K U _ T R A C E
2019-07-12 11:27:20 -07:00
echo "-----> Enable dokku trace"
2019-07-12 10:05:31 -07:00
dokku trace:on
2014-12-14 14:45:49 -08:00
e n d i f
2023-08-05 16:32:58 -04:00
@echo " Setting $( DOKKU_DOMAIN) in /etc/hosts "
sudo /bin/bash -c " [[ `ping -c1 $( DOKKU_DOMAIN) >/dev/null 2>&1; echo $$ ?` -eq 0 ]] || echo \"127.0.0.1 $( DOKKU_DOMAIN) *. $( DOKKU_DOMAIN) www.test.app. $( DOKKU_DOMAIN) \" >> /etc/hosts "
2014-12-13 18:56:31 -08:00
@echo "-----> Generating keypair..."
mkdir -p /root/.ssh
rm -f /root/.ssh/dokku_test_rsa*
echo -e "y\n" | ssh-keygen -f /root/.ssh/dokku_test_rsa -t rsa -N ''
2020-06-08 02:09:52 -04:00
chmod 700 /root/.ssh
2020-06-07 15:10:41 -04:00
chmod 600 /root/.ssh/dokku_test_rsa
chmod 644 /root/.ssh/dokku_test_rsa.pub
2014-12-13 18:56:31 -08:00
@echo "-----> Setting up ssh config..."
2019-02-02 13:49:24 -05:00
i f n e q ( $( shell ls /root /.ssh /config >/dev /null 2>&1 ; echo $ $ ?) , 0 )
2023-08-05 16:32:58 -04:00
echo " Host $( DOKKU_DOMAIN) \\r\\n Port $( DOKKU_SSH_PORT) \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa " >> /root/.ssh/config
2015-04-25 09:54:49 -07:00
echo "Host 127.0.0.1 \\r\\n Port 22333 \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
2023-08-05 16:32:58 -04:00
e l s e i f e q ( $( shell grep $ ( DOKKU_DOMAIN ) /root /.ssh /config ) , )
echo " Host $( DOKKU_DOMAIN) \\r\\n Port $( DOKKU_SSH_PORT) \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa " >> /root/.ssh/config
2015-04-25 09:54:49 -07:00
echo "Host 127.0.0.1 \\r\\n Port 22333 \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
2019-07-12 11:27:20 -07:00
e l s e
sed --in-place 's/Port 22 \r/Port $(DOKKU_SSH_PORT) \r/g' /root/.ssh/config
cat /root/.ssh/config
2015-04-25 09:54:49 -07:00
e n d i f
2019-07-12 10:05:31 -07:00
i f n e q ( $( wildcard /etc /ssh /sshd_config ) , )
sed --in-place " s/^#Port 22 $\/Port 22/g " /etc/ssh/sshd_config
i f e q ( $( shell grep 22333 /etc /ssh /sshd_config ) , )
sed --in-place "s:^Port 22:Port 22 \\nPort 22333:g" /etc/ssh/sshd_config
e n d i f
2024-09-22 20:04:32 -04:00
i f e q ( $( shell grep 22333 /usr /lib /systemd /system /ssh .socket ) , )
sed --in-place "s:^ListenStream=22:ListenStream=22 \\nListenStream=22333:g" /usr/lib/systemd/system/ssh.socket
e n d i f
2024-09-23 00:32:59 -04:00
systemctl daemon-reload || true
systemctl restart ssh.socket || service ssh restart
2019-07-12 10:05:31 -07:00
e n d i f
2014-12-13 18:56:31 -08:00
@echo "-----> Installing SSH public key..."
2020-06-02 13:30:12 -04:00
echo "" > /home/dokku/.ssh/authorized_keys
2019-07-12 10:05:31 -07:00
sudo sshcommand acl-remove dokku test
cat /root/.ssh/dokku_test_rsa.pub | sudo sshcommand acl-add dokku test
2020-06-08 02:09:52 -04:00
chmod 700 /home/dokku/.ssh
chmod 600 /home/dokku/.ssh/authorized_keys
2019-07-12 10:05:31 -07:00
2023-08-05 16:32:58 -04:00
i f e q ( $( shell grep $ ( DOKKU_DOMAIN ) /home /dokku /VHOST 2>/dev /null ) , )
@echo " -----> Setting default VHOST to $( DOKKU_DOMAIN) ... "
echo " $( DOKKU_DOMAIN) " > /home/dokku/VHOST
2019-07-12 10:05:31 -07:00
e n d i f
2019-07-12 11:27:20 -07:00
i f e q ( $( DOKKU_SSH_PORT ) , 2 2 )
$( MAKE) prime-ssh-known-hosts
e n d i f
setup-docker-deploy-tests : setup -deploy -tests
i f d e f E N A B L E _ D O K K U _ T R A C E
echo "-----> Enable dokku trace"
2021-01-09 16:49:18 -05:00
docker exec dokku bash -c "dokku trace:on"
2019-07-12 11:27:20 -07:00
e n d i f
2021-01-09 16:49:18 -05:00
docker exec dokku bash -c "sshcommand acl-remove dokku test"
docker exec dokku bash -c "echo `cat /root/.ssh/dokku_test_rsa.pub` | sshcommand acl-add dokku test"
2019-07-12 11:27:20 -07:00
$( MAKE) prime-ssh-known-hosts
prime-ssh-known-hosts :
@echo "-----> Intitial SSH connection to populate known_hosts..."
2023-08-05 16:32:58 -04:00
@echo " =====> SSH $( DOKKU_DOMAIN) "
2024-09-22 00:17:14 -04:00
ssh -o StrictHostKeyChecking = no dokku@$( DOKKU_DOMAIN) help
2020-06-02 12:42:54 -04:00
@echo "=====> SSH 127.0.0.1"
2024-09-22 00:17:14 -04:00
ssh -o StrictHostKeyChecking = no dokku@127.0.0.1 help
2014-12-14 15:31:08 -08:00
2019-01-06 23:01:38 -05:00
lint-setup :
@mkdir -p test-results/shellcheck tmp/shellcheck
2020-02-17 05:59:52 -05:00
@find . -not -path '*/\.*' -not -path './debian/*' -not -path './docs/*' -not -path './tests/*' -not -path './vendor/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | grep -B1 "bash" | grep "==>" | awk '{ print $$2 }' > tmp/shellcheck/test-files
2023-07-01 04:21:46 -04:00
@cat .shellcheckrc | sed -n -e '/^# SC/p' | cut -d' ' -f2 | paste -d, -s > tmp/shellcheck/exclude
2019-01-06 23:01:38 -05:00
2019-06-11 11:36:17 -07:00
lint-ci : lint -setup
2014-12-13 18:56:31 -08:00
# these are disabled due to their expansive existence in the codebase. we should clean it up though
2023-07-01 04:21:46 -04:00
@cat .shellcheckrc | sed -n -e '/^# SC/p'
2014-12-13 18:56:31 -08:00
@echo linting...
2023-07-01 04:21:46 -04:00
@cat tmp/shellcheck/test-files | xargs shellcheck | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $( shell cat tmp/shellcheck/exclude)
2014-12-13 18:56:31 -08:00
2024-01-17 02:28:11 -05:00
lint-golang :
golangci-lint run $( GO_PLUGINS)
2019-06-11 11:36:17 -07:00
lint-shfmt : shfmt
# verifying via shfmt
# shfmt -l -bn -ci -i 2 -d .
@shfmt -l -bn -ci -i 2 -d .
lint : lint -shfmt lint -ci
2017-10-02 14:19:14 -07:00
ci-go-coverage :
2026-07-10 15:05:27 -04:00
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = certs
2020-06-28 13:59:08 -04:00
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = common
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = config
2026-08-07 13:35:37 -04:00
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = docker-options
2020-06-28 13:59:08 -04:00
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = network
2026-04-18 05:43:44 -04:00
@$( MAKE) ci-go-coverage-plugin PLUGIN_NAME = buildpacks
2020-06-28 13:59:08 -04:00
ci-go-coverage-plugin :
2021-01-09 16:49:18 -05:00
mkdir -p test-results/coverage
docker run --rm \
2017-10-02 14:19:14 -07:00
-e DOKKU_ROOT = /home/dokku \
2026-04-25 06:01:34 -04:00
-e DOKKU_LIB_ROOT = /var/lib/dokku \
2017-10-02 14:19:14 -07:00
-e CODACY_TOKEN = $$ CODACY_TOKEN \
-e CIRCLE_SHA1 = $$ CIRCLE_SHA1 \
2020-06-28 01:42:09 -04:00
-e GO111MODULE = on \
2017-10-02 14:19:14 -07:00
-v $$ PWD:$( GO_REPO_ROOT) \
-w $( GO_REPO_ROOT) \
$( BUILD_IMAGE) \
2020-06-28 13:59:08 -04:00
bash -c " cd plugins/ $( PLUGIN_NAME) && \
2022-11-02 15:45:33 -04:00
echo 'installing gomega' && \
2022-11-02 11:57:22 -04:00
go get github.com/onsi/gomega && \
2022-11-02 15:45:33 -04:00
echo 'installing godacov' && \
go get github.com/schrej/godacov && \
echo 'installing goverage' && \
2022-11-07 00:47:06 -05:00
go get github.com/haya14busa/goverage && \
2022-11-02 11:57:22 -04:00
go install github.com/haya14busa/goverage && \
2022-11-02 15:45:33 -04:00
echo 'running goverage' && \
2021-01-09 16:49:18 -05:00
goverage -v -coverprofile= ./../../test-results/coverage/$( PLUGIN_NAME) .out && \
2022-11-02 15:45:33 -04:00
echo 'running godacov' && \
2021-01-09 16:49:18 -05:00
( godacov -r ./../../test-results/coverage/$( PLUGIN_NAME) .out -c $$ CIRCLE_SHA1 -t $$ CODACY_TOKEN || true ) " || exit $$ ?
2017-10-02 14:19:14 -07:00
2017-01-03 22:27:20 -08:00
go-tests :
2026-07-10 15:05:27 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = certs
2020-06-28 13:59:08 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = common
@$( MAKE) go-test-plugin PLUGIN_NAME = config
2026-08-12 13:11:34 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = cron
2026-08-07 13:35:37 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = docker-options
2026-08-09 14:01:43 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = logs
2020-06-28 13:59:08 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = network
2026-04-18 05:43:44 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = buildpacks
2026-08-08 15:16:12 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = scheduler-k3s
2026-08-10 01:23:10 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = storage
2026-08-12 03:22:04 -04:00
@$( MAKE) go-test-plugin PLUGIN_NAME = traefik-vhosts
2020-06-28 13:59:08 -04:00
go-test-plugin :
2026-04-18 05:43:44 -04:00
cd plugins/$( PLUGIN_NAME) && go get github.com/onsi/gomega && DOKKU_ROOT = /home/dokku DOKKU_LIB_ROOT = /var/lib/dokku go test -v -p 1 -race -mod= readonly || exit $$ ?
2024-12-03 21:45:41 -05:00
go-test-plugin-in-docker :
2017-01-03 22:27:20 -08:00
@echo running go unit tests...
2021-01-09 16:49:18 -05:00
docker run --rm \
2020-06-28 01:42:09 -04:00
-e GO111MODULE = on \
2017-01-03 22:27:20 -08:00
-v $$ PWD:$( GO_REPO_ROOT) \
-w $( GO_REPO_ROOT) \
$( BUILD_IMAGE) \
2024-12-03 21:45:41 -05:00
bash -c " make go-test-plugin PLUGIN_NAME= $( PLUGIN_NAME) " || exit $$ ?
2017-01-03 22:27:20 -08:00
unit-tests : go -tests
@echo running bats unit tests...
2015-04-24 13:52:14 -07:00
i f n d e f U N I T _ T E S T _ B A T C H
2014-12-13 18:56:31 -08:00
@$( QUIET) bats tests/unit
2015-04-24 13:52:14 -07:00
e l s e
@$( QUIET) ./tests/ci/unit_test_runner.sh $$ UNIT_TEST_BATCH
e n d i f
2014-12-13 18:56:31 -08:00
2017-04-03 12:34:41 -07:00
deploy-test-go-fail-predeploy :
@echo deploying go-fail-predeploy app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/go-fail-predeploy $( DOKKU_DOMAIN) '' true
2017-04-03 12:34:41 -07:00
deploy-test-go-fail-postdeploy :
@echo deploying go-fail-postdeploy app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/go-fail-postdeploy $( DOKKU_DOMAIN) '' true
2017-04-03 12:34:41 -07:00
2015-07-11 13:50:53 +02:00
deploy-test-checks-root :
@echo deploying checks-root app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/checks-root $( DOKKU_DOMAIN) '' true
2015-07-11 13:50:53 +02:00
2020-12-08 23:15:11 +09:00
deploy-test-main-branch :
@echo deploying checks-root app to main branch...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/checks-root $( DOKKU_DOMAIN) '' true main
2020-12-08 23:15:11 +09:00
2015-02-03 16:46:04 -08:00
deploy-test-clojure :
@echo deploying config app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/clojure $( DOKKU_DOMAIN)
2015-02-03 16:46:04 -08:00
2014-12-14 18:11:17 -08:00
deploy-test-config :
@echo deploying config app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/config $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
2015-02-07 10:47:04 -08:00
deploy-test-dockerfile :
@echo deploying dockerfile app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/dockerfile $( DOKKU_DOMAIN)
2015-02-07 10:47:04 -08:00
2015-04-03 12:13:39 -07:00
deploy-test-dockerfile-noexpose :
@echo deploying dockerfile-noexpose app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/dockerfile-noexpose $( DOKKU_DOMAIN)
2015-04-03 12:13:39 -07:00
2016-04-25 18:47:33 -07:00
deploy-test-dockerfile-procfile :
@echo deploying dockerfile-procfile app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/dockerfile-procfile $( DOKKU_DOMAIN)
2016-04-25 18:47:33 -07:00
2014-12-14 18:11:17 -08:00
deploy-test-gitsubmodules :
2014-12-20 15:27:25 -08:00
@echo deploying gitsubmodules app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/gitsubmodules $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
deploy-test-go :
2014-12-20 15:27:25 -08:00
@echo deploying go app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/go $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
deploy-test-java :
2015-01-11 16:30:13 -08:00
@echo deploying java app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/java $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
deploy-test-multi :
2014-12-20 15:27:25 -08:00
@echo deploying multi app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/multi $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
deploy-test-nodejs-express :
2015-01-11 16:30:13 -08:00
@echo deploying nodejs-express app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/nodejs-express $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
2015-01-09 21:22:05 -08:00
deploy-test-nodejs-express-noprocfile :
2015-01-11 16:30:13 -08:00
@echo deploying nodejs-express app with no Procfile...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/nodejs-express-noprocfile $( DOKKU_DOMAIN)
2015-01-09 21:22:05 -08:00
2015-07-30 14:29:36 -07:00
deploy-test-nodejs-worker :
@echo deploying nodejs-worker app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/nodejs-worker $( DOKKU_DOMAIN)
2015-07-30 14:29:36 -07:00
2014-12-14 18:11:17 -08:00
deploy-test-php :
2014-12-20 15:27:25 -08:00
@echo deploying php app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/php $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
deploy-test-python-flask :
2014-12-20 15:27:25 -08:00
@echo deploying python-flask app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/python-flask $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
2015-03-09 19:07:50 -07:00
deploy-test-ruby :
@echo deploying ruby app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/ruby $( DOKKU_DOMAIN)
2015-03-09 19:07:50 -07:00
2014-12-23 23:43:11 -08:00
deploy-test-scala :
@echo deploying scala app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/scala $( DOKKU_DOMAIN)
2014-12-23 23:43:11 -08:00
2014-12-14 18:11:17 -08:00
deploy-test-static :
2014-12-20 15:27:25 -08:00
@echo deploying static app...
2023-08-05 16:32:58 -04:00
cd tests && ./test_deploy ./apps/static $( DOKKU_DOMAIN)
2014-12-14 18:11:17 -08:00
2026-01-03 22:50:38 -05:00
test-ci-binaries :
docker exec dokku bash -c "whereis logrotate" || { echo "logrotate not found" ; exit 1; }
docker exec dokku bash -c "whereis rsyslog" || { echo "rsyslog not found" ; exit 1; }
2014-12-13 18:56:31 -08:00
deploy-tests :
@echo running deploy tests...
2015-07-11 13:50:53 +02:00
@$( QUIET) $( MAKE) deploy-test-checks-root
2020-12-08 23:15:11 +09:00
@$( QUIET) $( MAKE) deploy-test-main-branch
2017-04-03 12:34:41 -07:00
@$( QUIET) $( MAKE) deploy-test-go-fail-predeploy
@$( QUIET) $( MAKE) deploy-test-go-fail-postdeploy
2014-12-14 18:11:17 -08:00
@$( QUIET) $( MAKE) deploy-test-config
2015-02-03 16:46:04 -08:00
@$( QUIET) $( MAKE) deploy-test-clojure
2015-02-07 10:47:04 -08:00
@$( QUIET) $( MAKE) deploy-test-dockerfile
2015-04-03 12:13:39 -07:00
@$( QUIET) $( MAKE) deploy-test-dockerfile-noexpose
2016-04-25 18:47:33 -07:00
@$( QUIET) $( MAKE) deploy-test-dockerfile-procfile
2014-12-14 18:11:17 -08:00
@$( QUIET) $( MAKE) deploy-test-gitsubmodules
@$( QUIET) $( MAKE) deploy-test-go
@$( QUIET) $( MAKE) deploy-test-java
2015-01-06 11:20:22 -08:00
@$( QUIET) $( MAKE) deploy-test-multi
2014-12-14 18:11:17 -08:00
@$( QUIET) $( MAKE) deploy-test-nodejs-express
2015-01-09 21:22:05 -08:00
@$( QUIET) $( MAKE) deploy-test-nodejs-express-noprocfile
2015-07-30 14:29:36 -07:00
@$( QUIET) $( MAKE) deploy-test-nodejs-worker
2014-12-16 17:37:28 -08:00
@$( QUIET) $( MAKE) deploy-test-php
2014-12-14 18:11:17 -08:00
@$( QUIET) $( MAKE) deploy-test-python-flask
2014-12-23 23:43:11 -08:00
@$( QUIET) $( MAKE) deploy-test-scala
2014-12-20 16:37:41 -08:00
@$( QUIET) $( MAKE) deploy-test-static
2014-12-13 18:56:31 -08:00
2014-12-14 14:45:49 -08:00
test : setup -deploy -tests lint unit -tests deploy -tests
2017-08-29 10:14:33 -07:00
test-ci :
2019-01-05 19:56:23 -05:00
@mkdir -p test-results/bats
2019-01-21 21:57:03 -05:00
@cd tests/unit && echo " executing tests: $( shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by= timings --timings-type= classname | xargs) "
2021-01-17 16:18:24 -05:00
cd tests/unit && bats --report-formatter junit --timing -o ../../test-results/bats $( shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by= timings --timings-type= classname | xargs)
2019-07-12 11:27:20 -07:00
2020-12-20 01:57:00 -05:00
tests-ci-retry-failed :
2020-12-20 15:35:15 -05:00
wget -qO /tmp/bats-retry.tgz https://github.com/josegonzalez/go-bats-retry/releases/download/v0.2.1/bats-retry_0.2.1_linux_x86_64.tgz
2020-12-20 01:57:00 -05:00
tar xzf /tmp/bats-retry.tgz -C /usr/local/bin
2020-12-20 15:35:15 -05:00
bats-retry --execute test-results/bats
2020-12-20 01:57:00 -05:00
2026-01-03 22:50:38 -05:00
test-ci-docker : setup -docker -deploy -tests deploy -test -checks -root deploy -test -config deploy -test -multi deploy -test -go -fail -predeploy deploy -test -go -fail -postdeploy test -ci -binaries
2023-01-16 01:50:52 -05:00
generate-ssl-tars : generate -ssl -tar generate -ssl -sans -tar generate -ssl -wildcard -tar
generate-ssl-tar :
rm -rf /tmp/dokku-server_ssl
mkdir -p /tmp/dokku-server_ssl
2023-08-05 16:32:58 -04:00
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout /tmp/dokku-server_ssl/server.key -out /tmp/dokku-server_ssl/server.crt -subj " /CN= $( DOKKU_DOMAIN) " -days 3650
2023-01-16 01:50:52 -05:00
rm tests/unit/server_ssl.tar
cd /tmp/dokku-server_ssl && tar cvf $( PWD) /tests/unit/server_ssl.tar server.key server.crt
tar -tvf tests/unit/server_ssl.tar
generate-ssl-sans-tar :
rm -rf /tmp/dokku-server_ssl_sans
mkdir -p /tmp/dokku-server_ssl_sans
2023-08-05 16:32:58 -04:00
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout /tmp/dokku-server_ssl_sans/server.key -out /tmp/dokku-server_ssl_sans/server.crt -subj " /CN=test. $( DOKKU_DOMAIN) " -days 3650 -addext " subjectAltName = DNS:www.test. $( DOKKU_DOMAIN) , DNS:www.test.app. $( DOKKU_DOMAIN) "
2023-01-16 01:50:52 -05:00
rm tests/unit/server_ssl_sans.tar
cd /tmp/dokku-server_ssl_sans && tar cvf $( PWD) /tests/unit/server_ssl_sans.tar server.key server.crt
tar -tvf tests/unit/server_ssl_sans.tar
generate-ssl-wildcard-tar :
rm -rf /tmp/dokku-server_ssl_wildcard
mkdir -p /tmp/dokku-server_ssl_wildcard
2023-08-05 16:32:58 -04:00
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout /tmp/dokku-server_ssl_wildcard/server.key -out /tmp/dokku-server_ssl_wildcard/server.crt -subj " /CN=*. $( DOKKU_DOMAIN) " -days 3650
2023-01-16 01:50:52 -05:00
rm tests/unit/server_ssl_wildcard.tar
cd /tmp/dokku-server_ssl_wildcard && tar cvf $( PWD) /tests/unit/server_ssl_wildcard.tar server.key server.crt
tar -tvf tests/unit/server_ssl_wildcard.tar