Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

[FEATURE] Move testing environment to docker #50

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sudo: false
sudo: required
language: ruby
services:
- docker
cache: bundler
rvm:
- 2.2
Expand All @@ -8,7 +10,14 @@ rvm:
- 2.5

before_install:
# Set file permission for local ssh private key
- chmod 600 config/docker/ssh/vagrant
- docker-compose up -d
- # Force root user permissions for authorized keys. Prevent error at ssh connection.
- docker-compose exec webapp chown root:root /root/.ssh/authorized_keys
- ssh root@localhost -p 5001 -i config/docker/ssh/vagrant -o StrictHostKeyChecking=no 'exit'
- gem install bundler --no-document

script:
- bundle exec rubocop
- bundle exec cucumber
3 changes: 0 additions & 3 deletions Berksfile

This file was deleted.

47 changes: 0 additions & 47 deletions Berksfile.lock

This file was deleted.

22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM rastasheep/ubuntu-sshd:16.04
# Install locales
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8

# Create test user and group
RUN adduser 'test-user' --no-create-home --gecos "" --disabled-login
RUN groupadd 'test-group'
RUN usermod -aG 'test-group' 'test-user'

RUN apt-get update && apt-get install -y \
apache2-utils \
mysql-client \
# Need for gem "dkdeploy-test_environment". Use commands like "sudo rm ..."
sudo \
# Need for gem "dkdeploy-test_environment".
less \
rsync

RUN mkdir -p /var/www

6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ The complete list of the dkdeploy constants you find in `/lib/capistrano/dkdeplo

rvm (v1.29.x) with installed Ruby 2.2.

Add the virtual box alias to your `hosts` file

192.168.156.180 dkdeploy-core.test

### Running tests

1. Starting the local box (`vagrant up --provision`)
1. Starting the local docker (`docker-compose up -d`)
2. Checking coding styles (`rubocop`)
3. Running BDD cucumber tests (`cucumber`)

Expand Down
54 changes: 0 additions & 54 deletions Vagrantfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[mysqld]
# configure mysql to produce log with slow queries
# log-output = /var/log/mysql-default/
# log-output = /var/log/mysql/
slow_query_log = 1
# log file - needs to match :mysql_slow_log in deploy.rb of fixture
slow_query_log_file = /var/log/mysql-default/slow-queries.log
slow_query_log_file = /var/log/mysql/slow-queries.log
1 change: 1 addition & 0 deletions config/docker/ssh/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
27 changes: 27 additions & 0 deletions config/docker/ssh/vagrant
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
kc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93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz
6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC
P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF
llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ
kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
+vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
-----END RSA PRIVATE KEY-----
10 changes: 0 additions & 10 deletions config/vm/cookbooks/dkdeploy-core/metadata.rb

This file was deleted.

66 changes: 0 additions & 66 deletions config/vm/cookbooks/dkdeploy-core/recipes/default.rb

This file was deleted.

26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'
services:
webapp:
build: '.'
ports:
- '5001:22'
depends_on:
- db
links:
- db:database
volumes:
- mysql-log:/var/log/mysql
- ./config/docker/ssh/authorized_keys:/root/.ssh/authorized_keys
db:
image: mysql:5.7
restart: always
ports:
- '5002:3306'
environment:
MYSQL_ROOT_PASSWORD: ilikerandompasswords
MYSQL_DATABASE: dkdeploy_core
volumes:
- ./config/docker/mysql/conf:/etc/mysql/conf.d
- mysql-log:/var/log/mysql
volumes:
mysql-log:
Loading