Skip to content

Commit 449a4c0

Browse files
authored
MCLOUD-7476: Add possibility to use released images and cached images (#30)
1 parent 671b0c2 commit 449a4c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+416
-161
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ before_install:
8989
install: if [[ $TEST_SUITE != "build-images" ]]; then composer update; fi;
9090

9191
before_script:
92-
- if [ $TRAVIS_SECURE_ENV_VARS == "true" ] && [ $TEST_SUITE == "build-images" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi;
92+
- if [ $TRAVIS_SECURE_ENV_VARS == "true" ] && ([ $TEST_SUITE == "build-images" ] || [ $TEST_SUITE == "functional" ]); then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi;
9393
- if [ $TEST_SUITE == "functional" ]; then sudo sysctl -w vm.max_map_count=262144; fi;
94-
- if [ $TEST_SUITE == "functional" ]; then cp codeception.dist.yml codeception.yml && sed -i "s/use_generated_images:\ false/use_generated_images:\ true/" codeception.yml; fi;
94+
- if [ $TEST_SUITE == "functional" ]; then cp codeception.dist.yml codeception.yml && sed -i "s/use_custom_images:\ false/use_custom_images:\ true/" codeception.yml; fi;
9595

9696
script:
9797
- if [ $TRAVIS_SECURE_ENV_VARS == "true" ] && [ $TEST_SUITE == "functional" ]; then ./tests/travis/functional.sh; fi;

codeception.dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ modules:
2525
composer_magento_username: "%REPO_USERNAME%"
2626
composer_magento_password: "%REPO_PASSWORD%"
2727
composer_github_token: "%GITHUB_TOKEN%"
28-
use_generated_images: false
29-
generated_images_namespace: "cloudft"
28+
use_custom_images: false
29+
custom_images_namespace: "cloudft"
30+
version_custom_images: "%TRAVIS_BUILD_NUMBER%"
3031
use_cached_workdir: true
31-
version_generated_images: "%TRAVIS_BUILD_NUMBER%"
3232
printOutput: false
3333
Magento\CloudDocker\Test\Functional\Codeception\Docker:
3434
system_magento_dir: "%Magento.docker.settings.system.magento_dir%"

src/Command/BuildCompose.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ protected function configure(): void
200200
InputOption::VALUE_OPTIONAL,
201201
'The maximum number of connections that each worker process can handle simultaneously',
202202
Source\BaseSource::DEFAULT_NGINX_WORKER_CONNECTIONS
203+
)->addOption(
204+
Source\CliSource::OPTION_CUSTOM_REGISTRY,
205+
null,
206+
InputOption::VALUE_OPTIONAL,
207+
'The custom registry. It can be your mirror with all needed images. For example: 123.example.com'
203208
);
204209

205210
$this->addOption(

src/Compose/ProductionBuilder/Service/Blackfire.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function getConfig(Config $config): array
6464
],
6565
'ports' => ["8707"]
6666
],
67-
$config->getServiceImage($this->getServiceName())
67+
$config->getServiceImage($this->getServiceName()),
68+
$config->getCustomRegistry()
6869
);
6970
}
7071

src/Compose/ProductionBuilder/Service/Build.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getConfig(Config $config): array
7373
$config->getServiceVersion(ServiceInterface::SERVICE_PHP),
7474
['volumes' => $this->volume->getBuild($config)],
7575
$config->getServiceImage(ServiceInterface::SERVICE_PHP),
76+
$config->getCustomRegistry(),
7677
$config->getServiceImagePattern(ServiceInterface::SERVICE_PHP_CLI)
7778
);
7879
}

src/Compose/ProductionBuilder/Service/Cron.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getConfig(Config $config): array
7373
$config->getServiceVersion(ServiceInterface::SERVICE_PHP),
7474
['command' => 'run-cron'],
7575
$config->getServiceImage(ServiceInterface::SERVICE_PHP),
76+
$config->getCustomRegistry(),
7677
$config->getServiceImagePattern(ServiceInterface::SERVICE_PHP_CLI)
7778
);
7879
$preparedCronConfig = [];

src/Compose/ProductionBuilder/Service/Database/Db.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public function getConfig(Config $config): array
8282
ServiceInterface::SERVICE_DB,
8383
$config->getServiceVersion(ServiceInterface::SERVICE_DB),
8484
$dbConfig,
85-
$config->getServiceImage(ServiceInterface::SERVICE_DB)
85+
$config->getServiceImage(ServiceInterface::SERVICE_DB),
86+
$config->getCustomRegistry()
8687
);
8788
}
8889

src/Compose/ProductionBuilder/Service/Database/DbQuote.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function getConfig(Config $config): array
7979
ServiceInterface::SERVICE_DB_QUOTE,
8080
$config->getServiceVersion(ServiceInterface::SERVICE_DB),
8181
$dbConfig,
82-
$config->getServiceImage(ServiceInterface::SERVICE_DB)
82+
$config->getServiceImage(ServiceInterface::SERVICE_DB),
83+
$config->getCustomRegistry()
8384
);
8485
}
8586

src/Compose/ProductionBuilder/Service/Database/DbSales.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function getConfig(Config $config): array
7979
ServiceInterface::SERVICE_DB_SALES,
8080
$config->getServiceVersion(ServiceInterface::SERVICE_DB),
8181
$dbConfig,
82-
$config->getServiceImage(ServiceInterface::SERVICE_DB)
82+
$config->getServiceImage(ServiceInterface::SERVICE_DB),
83+
$config->getCustomRegistry()
8384
);
8485
}
8586

src/Compose/ProductionBuilder/Service/Deploy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getConfig(Config $config): array
7373
$config->getServiceVersion(ServiceInterface::SERVICE_PHP),
7474
['volumes' => $this->volume->getRo($config)],
7575
$config->getServiceImage(ServiceInterface::SERVICE_PHP),
76+
$config->getCustomRegistry(),
7677
$config->getServiceImagePattern(ServiceInterface::SERVICE_PHP_CLI)
7778
);
7879
}

0 commit comments

Comments
 (0)