Skip to content

Commit

Permalink
First Initial POC Stable Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Plopix committed Apr 10, 2017
0 parents commit 74979d7
Show file tree
Hide file tree
Showing 64 changed files with 10,271 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .cs/.php_cs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
$finder = PhpCsFixer\Finder::create()->in('src');//->in('tests');

return PhpCsFixer\Config::create()
->setRules(
[
'@Symfony' => true,
'binary_operator_spaces' => [
'align_equals' => true,
'align_double_arrow' => true,
],
'array_syntax' => ['syntax' => 'short'],
'pre_increment' => false,
'ordered_imports' => true,
'phpdoc_order' => true,
'linebreak_after_opening_tag' => true,
'phpdoc_no_package' => false,
'phpdoc_inline_tag' => false,
'cast_spaces' => false,
]
)
->setFinder($finder);
17 changes: 17 additions & 0 deletions .cs/cs_ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<ruleset name="eZLaunchpadCustomCodeStyle">
<description>eZ Launchpad coding standard.</description>
<arg name="tab-width" value="4"/>

<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.OneClassPerFile"/>
<rule ref="Generic.Files.OneInterfacePerFile"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
</ruleset>
113 changes: 113 additions & 0 deletions .cs/md_ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0"?>
<ruleset name="eZ Launchpad Mess Detector Ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>eZ Launchpad Configuration</description>

<rule ref="rulesets/naming.xml/LongVariable">
<priority>1</priority>
<properties>
<property name="maximum" value="50"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<priority>1</priority>
<properties>
<property name="exceptions" value="em,id,fs,qb,i,mm,dd,yy,e,aa,io,dm,j,k,n"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
<priority>1</priority>
<properties>
<property name="exceptions" value="up,ps"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<priority>1</priority>
<properties>
<property name="reportLevel" value="20"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/NPathComplexity">
<priority>1</priority>
<properties>
<property name="minimum" value="301"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyMethods">
<priority>1</priority>
<properties>
<property name="maxmethods" value="20"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyFields">
<priority>1</priority>
<properties>
<property name="maxfields" value="100"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<priority>1</priority>
<properties>
<property name="maximum" value="75"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<priority>1</priority>
<properties>
<property name="minimum" value="150"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
<priority>1</priority>
<properties>
<property name="minimum" value="20"/>
</properties>
</rule>
<rule ref="rulesets/design.xml/NumberOfChildren">
<priority>1</priority>
<properties>
<property name="minimum" value="20"/>
</properties>
</rule>
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<priority>1</priority>
<properties>
<property name="minimum" value="20"/>
</properties>
</rule>
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess"/>
<exclude name="ElseExpression"/>
<exclude name="BooleanArgumentFlag"/>
</rule>
<rule ref="rulesets/design.xml">
<exclude name="NumberOfChildren"/>
<exclude name="CouplingBetweenObjects"/>
</rule>
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
<exclude name="ShortMethodName"/>
<exclude name="LongVariable"/>
<exclude name="BooleanGetMethodName"/>
</rule>
<rule ref="rulesets/codesize.xml">
<exclude name="NPathComplexity"/>
<exclude name="CyclomaticComplexity"/>
<exclude name="TooManyMethods"/>
<exclude name="TooManyFields"/>
<exclude name="ExcessiveClassComplexity"/>
<exclude name="ExcessivePublicCount"/>
<exclude name="ExcessiveClassLength"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="ExcessiveParameterList"/>
</rule>

<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter"/>
<exclude name="UnusedLocalVariable"/>
<exclude name="UnusedPrivateField"/>
</rule>
</ruleset>
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/composer.phar
/box.phar
/vendor/
.php~
.idea
.DS_Store
*~
*.bak
._*
~*
.php_cs.cache

tests/coverage

# Auto-update
/docs/ez-old.phar

# Tests
/provisioning
/ezplatform
/.ezlaunchpad.yml

# Travis stuff
/.travis/ezlaunchpad-private.pem
/.travis/secrets.tar


# others
/provisioning2ouf
/provisioning2
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
sudo: false

language: php

cache:
directories:
- $HOME/.composer/cache
- vendor

matrix:
fast_finish: true
include:
- php: 5.5
- php: 5.6
env:
- EXECUTE_DEPLOYMENT=true
- php: 7
- php: 7.1
allow_failures:
- php: 5.5

before_install:
- composer self-update

install:
- travis_retry composer install --no-interaction
- composer info -i

script:
- php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php src/
#- php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php tests/Tests/
#- php vendor/behat/behat/bin/behat

after_success:
- if [[ $EXECUTE_DEPLOYMENT == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then composer install --no-dev ; fi
- if [[ $EXECUTE_DEPLOYMENT == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then ./scripts/travis_deploy.bash ; fi

notifications:
email: false
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (C) eZ Systems AS. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# === eZ Launchpad Helper ===

# Styles
YELLOW=$(shell echo "\033[00;33m")
RED=$(shell echo "\033[00;31m")
RESTORE=$(shell echo "\033[0m")

# Variables
PHP_BIN := php
COMPOSER_BIN := composer.phar
DOCKER_BIN := docker
SRCS := src
CURRENT_DIR := $(shell pwd)
SCRIPS_DIR := $(CURRENT_DIR)/scripts

.PHONY: list
list:
@echo ""
@echo "eZ Launchpad available targets:"
@echo ""
@echo " $(YELLOW)phar$(RESTORE) > build the box"
@echo ""
@echo " $(YELLOW)codeclean$(RESTORE) > run the codechecker"
@echo " $(YELLOW)tests$(RESTORE) > run the tests"
@echo " $(YELLOW)coverage$(RESTORE) > generate the code coverage"
@echo ""
@echo " $(YELLOW)install$(RESTORE) > install vendors"
@echo " $(YELLOW)clean$(RESTORE) > removes the vendors, and caches"


.PHONY: codeclean
codeclean:
bash $(SCRIPS_DIR)/codechecker.bash

.PHONY: tests
tests:
bash $(SCRIPS_DIR)/runtests.bash

.PHONY: install
install:
curl -s http://getcomposer.org/installer | $(PHP_BIN)
$(PHP_BIN) $(COMPOSER_BIN) install

.PHONY: phar
phar:
bash $(SCRIPS_DIR)/buildbox.bash

.PHONY: coverage
coverage:
$(DOCKER_BIN) run -t --rm -w /app -v $(CURRENT_DIR):/app phpunit/phpunit:6.0.6 -c tests/ --coverage-html /app/tests/coverage

.PHONY: clean
clean:
rm -rf tests/coverage
rm -f .php_cs.cache
rm -f .ezlaunchpad.yml
rm -rf vendor
rm -rf ezplatform
rm -rf provisioning2ouf
rm -f ezinstall.bash


69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# eZ Launchpad

eZ Launchpad is a CLI tool to start an eZ Platform project in 5 min on top of a full Docker stack.

Basically, when you have it, the CLI command will:

- ask you some questions to parameter your project
- build the Docker stack
- install composer in the stack
- install eZ Platform in the stack
- Start all the services required

For now there are:

- Nginx
- Maria DB
- PHP-FPM 7.1.x
- Memcache
- Memcache Admin
- Adminer
- Mailcatcher

## Install

### With 'curl'

`$ curl -LSs https://ezystems.github.io/ezlaunchpad/install_curl.bash | bash`

### With 'wget'

`$ wget -O - "https://ezystems.github.io/ezlaunchpad/install_wget.bash" | bash`

### Install in your PATH

For conveniency, you should install ez.phar somewhere in your PATH.

`mv ~/ez SOMEWHERE_IN_YOUR_PATH`

## Usage

`~/ez`


## Contribution

This project comes with Coding Standards and Tests.
To help you contribute a Makefile is available to simplify the actions.

```bash
$ make
eZ Launchpad available targets:
phar > build the box
codeclean > run the codechecker
tests > run the tests
coverage > generate the code coverage
install > install vendors
clean > removes the vendors, and caches
```

> Note: the real *signed* .phar is generated on Travis and made available for all on Github after each merge on master.
## License

This project is under the MIT license. See the complete license in the file:

[LICENSE](LICENSE)



5 changes: 5 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Need a github
- Need a travis
- Need a github for Docker enginerm
- put mac os on Travis etc.

Loading

0 comments on commit 74979d7

Please sign in to comment.