Ejemplo n.º 1
0
 public function handle()
 {
     $this->container = $this->project->service('code');
     $this->displayCurrentContainerAndConfirmUpdate();
     $image = Image::make('code', 'wharf/code');
     $this->setImageIfNotSame($image)->displayCurrentContainer()->saveProject();
 }
Ejemplo n.º 2
0
 private function updateCliContainer($version)
 {
     $cliImage = Image::make('cli', 'wharf/cli')->versionTo($version);
     $cliService = $this->project->service('cli')->image($cliImage);
     $this->project->save($cliService);
     return $this;
 }
Ejemplo n.º 3
0
 function test_it_has_a_volumes_setting_by_default()
 {
     $image = Image::make('code', 'wharf/code');
     $codeContainer = WharfContainers::make('code')->image($image);
     $containerConfig = $codeContainer->toArray();
     $this->assertArrayHasKey('volumes', $containerConfig);
     $this->assertEquals(['.:/code'], $containerConfig['volumes']);
 }
Ejemplo n.º 4
0
 public function handle()
 {
     $this->setContainerForService('db');
     $this->displayCurrentContainerAndConfirmUpdate()->sourceEnvironment();
     if ($this->project->dbIsLocalhost()) {
         $this->confirmOrAbort('The database host is set to localhost. It will be set to your "db" to point to a docker container.', 'yes');
         $this->project->setEnvVariable('DB_HOST', 'db');
     }
     $database = $this->choose('Select the db system to use:', Image::show('db')->toArray(), $this->container->image()->name());
     $image = Image::make('db', $database);
     $version = $this->choose('Select the version to use:', $image->availableTags()->toArray(), $this->container->image()->tag());
     $image = $image->versionTo($version);
     $this->setImageIfNotSame($image)->checkContainerInvalidOptions()->displayCurrentContainer()->saveProject();
 }
Ejemplo n.º 5
0
 public function handle()
 {
     $availableServices = Image::all()->filter(function ($availableService) {
         return $this->argument('service') === 'all' || $availableService === $this->argument('service');
     });
     $availableServices->each(function ($images, $service) {
         $this->lineBreak();
         $this->comment(sprintf('Available for "%s"', $service));
         collect($images)->each(function ($tags, $image) {
             $this->write(sprintf('%s: ', str_replace('wharf/', '', $image)));
             collect($tags)->each(function ($tag) {
                 $this->write(sprintf(' - %s', $tag));
             });
         });
     });
 }
Ejemplo n.º 6
0
 private function setImage($image)
 {
     $image = Image::make($this->service(), $image);
     $this->config->put('image', $image);
     return $this->changed();
 }
Ejemplo n.º 7
0
 /** @test */
 function it_should_see_that_images_are_different()
 {
     $imageA = Image::make('php', 'php:7.0');
     $imageB = Image::make('php', 'php:5.6');
     $this->assertTrue($imageA->notSameAs($imageB));
 }
Ejemplo n.º 8
0
 function test_it_should_display_if_it_is_a_custom_container()
 {
     $image = Image::make('web', 'some_funky_name');
     $this->webContainer->image($image);
     $this->webContainer->displayTo($this->output);
     $infos = $this->output->fetch();
     $this->assertContains('some_funky_name', $infos);
     $this->assertRegExp('/Config\\s+CUSTOM/', $infos);
 }