Skip to content

Commit

Permalink
Merge pull request #11 from Ph3nol/fixes
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
Ph3nol authored Sep 17, 2017
2 parents 5d6ebdb + c4a2c40 commit abc05a1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 66 deletions.
Binary file modified dist/docker-arch.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/complex-php-project/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vendor/
vendor/
2 changes: 1 addition & 1 deletion examples/nodejs-web-project/.docker-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ services:
options:
version: "8"
container:
entry_point: npm start
entry_point: npm start
1 change: 0 additions & 1 deletion src/Application/DockerContainer/NodejsDockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function init(): void
parent::init();

$service = $this->getService();
$project = $service->getProject();

$this->setFrom(sprintf('node:%s-alpine', $service->getOptions()['version']));

Expand Down
3 changes: 0 additions & 3 deletions src/Application/DockerContainer/RedisDockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public function init(): void

$this->setFrom(sprintf('redis:%s-alpine', $this->getService()->getOptions()['version']));

$service = $this->getService();
$project = $service->getProject();

// Ports.
$this->addEnvPort('REDIS', ['from' => '8079', 'to' => '6379']);
}
Expand Down
68 changes: 17 additions & 51 deletions src/Application/Resources/views/UI/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,19 @@
<hr>
<div class="row">
<h2 class="text-info">
<i class="fa fa-info-circle" aria-hidden="true"></i>
&nbsp;
Project informations
<i class="fa fa-info-circle" aria-hidden="true"></i> &nbsp; Project informations
</h2>
<div class="col-md-6">
<h3>Global</h3>
<ul class="list-group">
<li class="list-group-item">
<i class="fa fa-flag" aria-hidden="true"></i>
&nbsp;
Locale
<i class="fa fa-flag" aria-hidden="true"></i> &nbsp; Locale
<span class="pull-right">
<strong>{{ project.locale }}</strong>
</span>
</li>
<li class="list-group-item">
<i class="fa fa-user" aria-hidden="true"></i>
&nbsp;
User
<i class="fa fa-user" aria-hidden="true"></i> &nbsp; User
<span class="pull-right">
{% if project.user %}
<strong>{{ project.user }}</strong>
Expand All @@ -50,32 +44,24 @@
</span>
</li>
<li class="list-group-item">
<i class="fa fa-cogs" aria-hidden="true"></i>
&nbsp;
Services
<i class="fa fa-cogs" aria-hidden="true"></i> &nbsp; Services
<span class="pull-right">
<strong><span class="badge badge-success">{{ project.services|length }}</span></strong>
</span>
</li>
<li class="list-group-item">
<i class="fa fa-terminal" aria-hidden="true"></i>
&nbsp;
Path (generated from)
<i class="fa fa-terminal" aria-hidden="true"></i> &nbsp; Path (generated from)
<br>
<strong class="text-muted">{{ project.path }}</strong>
</li>
<li class="list-group-item">
<i class="fa fa-home" aria-hidden="true"></i>
&nbsp;
{{ constant('\\Ph3\\DockerArch\\Application\\Architect::PROJECT_NAME') }}
directory
&nbsp; {{ constant('\\Ph3\\DockerArch\\Application\\Architect::PROJECT_NAME') }} directory
<br>
<strong class="text-muted">{{ projectDir }}</strong>
</li>
<li class="list-group-item">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
&nbsp;
Logs path
<i class="fa fa-file-text-o" aria-hidden="true"></i> &nbsp; Logs path
<br>
<strong class="text-muted">{{ project.logsPath }}</strong>
</li>
Expand All @@ -92,9 +78,7 @@
</div>
<hr>
<h2 class="text-info">
<i class="fa fa-cogs" aria-hidden="true"></i>
&nbsp;
Services properties
<i class="fa fa-cogs" aria-hidden="true"></i> &nbsp; Services properties
</h2>
<div>
<ul class="nav nav-tabs services-tabs" role="tablist">
Expand Down Expand Up @@ -127,25 +111,19 @@
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item">
<i class="fa fa-tag" aria-hidden="true"></i>
&nbsp;
ID
<i class="fa fa-tag" aria-hidden="true"></i> &nbsp; ID
<span class="pull-right">
<strong>{{ service.identifier }}</strong>
</span>
</li>
<li class="list-group-item">
<i class="fa fa-cube" aria-hidden="true"></i>
&nbsp;
Inherited image
<i class="fa fa-cube" aria-hidden="true"></i> &nbsp; Inherited image
<span class="pull-right">
<strong>{{ service.dockerContainer.from }}</strong>
</span>
</li>
<li class="list-group-item">
<i class="fa fa-at" aria-hidden="true"></i>
&nbsp;
Host
<i class="fa fa-at" aria-hidden="true"></i> &nbsp; Host
{% if service.host %}
<span class="pull-right text-success">
<strong>{{ service.host }}</strong>
Expand All @@ -157,9 +135,7 @@
{% endif %}
</li>
<li class="list-group-item">
<i class="fa fa-refresh" aria-hidden="true"></i>
&nbsp;
Docker-Sync
<i class="fa fa-refresh" aria-hidden="true"></i> &nbsp; Docker-Sync
<span class="pull-right">
{% if service.isDockerSynched %}
<i class="fa fa-check-circle text-success"></i>
Expand All @@ -169,9 +145,7 @@
</span>
</li>
<li class="list-group-item">
<i class="fa fa-terminal" aria-hidden="true"></i>
&nbsp;
Path
<i class="fa fa-terminal" aria-hidden="true"></i> &nbsp; Path
<span class="pull-right">
<strong>{{ service.path }}</strong>
</span>
Expand All @@ -180,9 +154,7 @@
</div>
<div class="col-md-6">
<h4>
<i class="fa fa-hdd-o" aria-hidden="true"></i>
&nbsp;
Volumes
<i class="fa fa-hdd-o" aria-hidden="true"></i> &nbsp; Volumes
</h4>
{% set volumes = project.getVolumesForService(service) %}
{% if volumes|length %}
Expand All @@ -196,9 +168,7 @@
{% endif %}
<hr>
<h4>
<i class="fa fa-link" aria-hidden="true"></i>
&nbsp;
Links
<i class="fa fa-link" aria-hidden="true"></i> &nbsp; Links
</h4>
{% set links = project.getLinksForService(service) %}
{% if links|length %}
Expand All @@ -212,9 +182,7 @@
{% endif %}
<hr>
<h4>
<i class="fa fa-globe" aria-hidden="true"></i>
&nbsp;
Exposed ports
<i class="fa fa-globe" aria-hidden="true"></i> &nbsp; Exposed ports
</h4>
{% set ports = service.dockerContainer.ports %}
{% if ports|length %}
Expand All @@ -231,9 +199,7 @@
{% endif %}
<hr>
<h4>
<i class="fa fa-list" aria-hidden="true"></i>
&nbsp;
Environment globals
<i class="fa fa-list" aria-hidden="true"></i> &nbsp; Environment globals
</h4>
{% set envs = service.dockerContainer.envs %}
{% if envs|length %}
Expand Down
15 changes: 6 additions & 9 deletions src/Domain/DockerContainer/Model/DockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function init(): void

$this->addPackage('vim');

if (true == $this->getService()->isWebService()) {
if (true === $this->getService()->isWebService()) {
$this
->addEnv('TERM', 'xterm-256color')
->addEnv('GIT_DISCOVERY_ACROSS_FILESYSTEM', 'true')
Expand All @@ -80,7 +80,11 @@ public function init(): void
}

$this->initLocale();
$this->initUser();
/**
* Set as `root` for instant.
* Will be generated from self::initUser() lately.
*/
$this->setUser('root');
}

/**
Expand Down Expand Up @@ -269,13 +273,6 @@ private function initLocale(): void
*/
private function initUser(): void
{
/**
* @todo Manage it, from each container requirements.
*/
$this->setUser('root');

return ;

// User actions.
$user = $this->getService()->getProject()->getUser();
if (null === $user) {
Expand Down
1 change: 1 addition & 0 deletions src/Domain/Service/Model/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Ph3\DockerArch\Domain\Service\Model;

use Cocur\Slugify\Slugify;
use Ph3\DockerArch\Domain\DockerContainer\Exception\NotFoundException as DockerContainerNotFoundException;
use Ph3\DockerArch\Domain\DockerContainer\Model\DockerContainerInterface;
use Ph3\DockerArch\Domain\Project\Model\ProjectInterface;
Expand Down

0 comments on commit abc05a1

Please sign in to comment.