Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Get image versions from utils #15

Merged
merged 3 commits into from
Aug 21, 2018
Merged
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
1 change: 0 additions & 1 deletion ci/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rm ee
cd ..
git clone https://github.com/EasyEngine/easyengine.git easyengine --depth=1
cd easyengine
echo 'travis_test' > VERSION

# Copy tests to EE repo
rm -r features
Expand Down
17 changes: 9 additions & 8 deletions src/Site_WP_Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ class Site_WP_Docker {
* @return String docker-compose.yml content string.
*/
public function generate_docker_compose_yml( array $filters = [] ) {
$base = [];
$img_versions = EE\Utils\get_image_versions();
$base = [];

$restart_default = [ 'name' => 'always' ];
$network_default = [ 'name' => 'site-network' ];

// db configuration.
$db['service_name'] = [ 'name' => 'db' ];
$db['image'] = [ 'name' => 'easyengine/mariadb:v' . EE_VERSION ];
$db['image'] = [ 'name' => 'easyengine/mariadb:' . $img_versions['easyengine/mariadb'] ];
$db['restart'] = $restart_default;
$db['labels'] = [
'label' => [
Expand All @@ -46,7 +47,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {
$db['networks'] = $network_default;
// PHP configuration.
$php['service_name'] = [ 'name' => 'php' ];
$php['image'] = [ 'name' => 'easyengine/php:v' . EE_VERSION ];
$php['image'] = [ 'name' => 'easyengine/php:' . $img_versions['easyengine/php'] ];
$php['depends_on'] = [ 'name' => 'db' ];
$php['restart'] = $restart_default;
$php['labels'] = [
Expand Down Expand Up @@ -77,7 +78,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {

// nginx configuration.
$nginx['service_name'] = [ 'name' => 'nginx' ];
$nginx['image'] = [ 'name' => 'easyengine/nginx:v' . EE_VERSION ];
$nginx['image'] = [ 'name' => 'easyengine/nginx:' . $img_versions['easyengine/nginx'] ];
$nginx['depends_on'] = [ 'name' => 'php' ];
$nginx['restart'] = $restart_default;

Expand Down Expand Up @@ -107,7 +108,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {

// PhpMyAdmin configuration.
$phpmyadmin['service_name'] = [ 'name' => 'phpmyadmin' ];
$phpmyadmin['image'] = [ 'name' => 'easyengine/phpmyadmin:v' . EE_VERSION ];
$phpmyadmin['image'] = [ 'name' => 'easyengine/phpmyadmin:' . $img_versions['easyengine/phpmyadmin'] ];
$phpmyadmin['restart'] = $restart_default;
$phpmyadmin['environment'] = [
'env' => [
Expand All @@ -125,7 +126,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {

// mailhog configuration.
$mailhog['service_name'] = [ 'name' => 'mailhog' ];
$mailhog['image'] = [ 'name' => 'easyengine/mailhog:v' . EE_VERSION ];
$mailhog['image'] = [ 'name' => 'easyengine/mailhog:' . $img_versions['easyengine/mailhog'] ];
$mailhog['restart'] = $restart_default;
$mailhog['command'] = [ 'name' => '["-invite-jim=false"]' ];
$mailhog['environment'] = [
Expand All @@ -144,7 +145,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {

// postfix configuration.
$postfix['service_name'] = [ 'name' => 'postfix' ];
$postfix['image'] = [ 'name' => 'easyengine/postfix:v' . EE_VERSION ];
$postfix['image'] = [ 'name' => 'easyengine/postfix:' . $img_versions['easyengine/postfix'] ];
$postfix['hostname'] = [ 'name' => '${VIRTUAL_HOST}' ];
$postfix['restart'] = $restart_default;
$postfix['labels'] = [
Expand All @@ -164,7 +165,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {

// redis configuration.
$redis['service_name'] = [ 'name' => 'redis' ];
$redis['image'] = [ 'name' => 'easyengine/redis:v' . EE_VERSION ];
$redis['image'] = [ 'name' => 'easyengine/redis:' . $img_versions['easyengine/redis'] ];
$redis['labels'] = [
'label' => [
'name' => 'io.easyengine.site=${VIRTUAL_HOST}',
Expand Down