install dokku from built deb package and use docker image for integrations tests
This commit is contained in:
committed by
Jose Diaz-Gonzalez
parent
1f882d09bf
commit
d8ada6a6e9
28
tests.mk
28
tests.mk
@@ -45,10 +45,9 @@ endif
|
||||
ci-dependencies: bats shellcheck shfmt xmlstarlet
|
||||
|
||||
setup-deploy-tests:
|
||||
mkdir -p /home/dokku
|
||||
ifdef ENABLE_DOKKU_TRACE
|
||||
echo "-----> Enabling tracing"
|
||||
echo "export DOKKU_TRACE=1" >> /home/dokku/dokkurc
|
||||
docker exec -ti dokku bash -c 'echo "export DOKKU_TRACE=1" >> /home/dokku/dokkurc'
|
||||
endif
|
||||
@echo "Setting dokku.me in /etc/hosts"
|
||||
sudo /bin/bash -c "[[ `ping -c1 dokku.me >/dev/null 2>&1; echo $$?` -eq 0 ]] || echo \"127.0.0.1 dokku.me *.dokku.me www.test.app.dokku.me\" >> /etc/hosts"
|
||||
@@ -61,33 +60,20 @@ endif
|
||||
|
||||
@echo "-----> Setting up ssh config..."
|
||||
ifneq ($(shell ls /root/.ssh/config >/dev/null 2>&1 ; echo $$?),0)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
echo "Host dokku.me \\r\\n Port 3022 \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
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
|
||||
else ifeq ($(shell grep dokku.me /root/.ssh/config),)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
echo "Host dokku.me \\r\\n Port 3022 \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
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
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /etc/ssh/sshd_config),)
|
||||
sed --in-place "s/^#Port 22$\/Port 22/g" /etc/ssh/sshd_config
|
||||
ifeq ($(shell grep 22333 /etc/ssh/sshd_config),)
|
||||
sed --in-place "s:^Port 22:Port 22 \\nPort 22333:g" /etc/ssh/sshd_config
|
||||
endif
|
||||
service ssh restart
|
||||
endif
|
||||
|
||||
@echo "-----> Installing SSH public key..."
|
||||
sudo sshcommand acl-remove dokku test
|
||||
cat /root/.ssh/dokku_test_rsa.pub | sudo sshcommand acl-add dokku test
|
||||
docker exec -ti dokku bash -c "sshcommand acl-remove dokku test"
|
||||
docker exec -ti dokku bash -c "echo `cat /root/.ssh/dokku_test_rsa.pub` | sshcommand acl-add dokku test"
|
||||
|
||||
@echo "-----> Intitial SSH connection to populate known_hosts..."
|
||||
ssh -o StrictHostKeyChecking=no dokku@dokku.me help >/dev/null
|
||||
ssh -o StrictHostKeyChecking=no dokku@127.0.0.1 help >/dev/null
|
||||
|
||||
ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),)
|
||||
@echo "-----> Setting default VHOST to dokku.me..."
|
||||
echo "dokku.me" > /home/dokku/VHOST
|
||||
endif
|
||||
sudo ssh -o StrictHostKeyChecking=no dokku@dokku.me help >/dev/null
|
||||
sudo ssh -o StrictHostKeyChecking=no dokku@127.0.0.1 help >/dev/null
|
||||
|
||||
lint-setup:
|
||||
@mkdir -p test-results/shellcheck tmp/shellcheck
|
||||
|
||||
Reference in New Issue
Block a user