-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from ec-europa/develop
Release beta7: hotfix and improvements
- Loading branch information
Showing
23 changed files
with
769 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,108 @@ | ||
## Upgrade from 2.0.x to 3.0.x | ||
## Upgrade subsite-starterkit to toolkit | ||
|
||
Subsite Starterkit 3.0.0 introduces itself as a Composer package. In order | ||
to provide that a new building procedure has been put in place. These | ||
upgrade instructions assume that your subsite is a "git fork" of the old | ||
repository at https://github.com/ec-europa/subsite-starterkit. | ||
<a href="http://www.youtube.com/watch?feature=player_embedded&v=cwGZilB3BjQ | ||
" target="_blank"><img src="http://img.youtube.com/vi/cwGZilB3BjQ/0.jpg" | ||
alt="Upgrade screencast" width="50%" align="left" /></a> | ||
|
||
### 1.1 Phing upgrade | ||
This screencast explains how to upgrade a subsite-starterkit based project to | ||
the composer package based toolkit. To complete the upgrade you need to execute | ||
the 5 steps listed below in the upgrade steps. After the upgrade you might have | ||
to fix some files that may have been altered by the upgrade script. It is best | ||
to use a dedicated branch for the upgrade so your master branch stays unaffected | ||
until the pull request has been merged into the master of reference. | ||
|
||
If your project has no custom Phing targets and has not altered any composer | ||
files that were provided by the subsite-starterkit you should not encounter any | ||
problems during this upgrade process. | ||
|
||
### Upgrade guide | ||
|
||
#### Up-to-date branch | ||
|
||
Check out new dedicated branch and make sure it is up to date with master of the | ||
reference repository. | ||
|
||
>```bash | ||
> git checkout -b starterkit/upgrade | ||
> git remote add reference https://github.com/ec-europa/<project-id>-reference.git | ||
> git fetch reference | ||
> git merge reference/master | ||
>``` | ||
#### Upgrade steps | ||
These are the 5 steps needed to complete the upgrade. | ||
>```bash | ||
> curl https://raw.githubusercontent.com/ec-europa/toolkit/master/includes/templates/subsite/composer.json > composer.json | ||
> curl https://raw.githubusercontent.com/ec-europa/toolkit/master/includes/templates/subsite/build.xml > build.xml | ||
> rm -rf ./vendor ./bin ./composer.lock | ||
> composer install | ||
> ./toolkit/phing toolkit-upgrade-starterkit | ||
> ./toolkit/phing toolkit-starterkit-upgrade | ||
>``` | ||
The biggest structural change is in the lib folder. Because of the new symlink system the structure in the build folder will match the structure in the lib folder. To align all projects we request to make the following lib structure: | ||
* libraries | ||
* modules | ||
* custom | ||
* features | ||
* profiles (platform only) | ||
* src | ||
* themes | ||
Other tasks that need to happen: | ||
- merge the projects gitignore with the new toolkit gitignore file. This | ||
will probably happen through a build target. | ||
- remove the build-custom target from the build.project.xml. Toolkit | ||
should provide a new template if the original one wasn't altered. | ||
- | ||
### 1.2 Manual process | ||
Manually delete all files that are only specific to the starterkit. | ||
Below is a list of files *to keep*. So anything not mentioned below should | ||
be deleted. | ||
<b>Starterkit 3.0.0 templates</b>: (fetch) | ||
> | ||
#### Gitignore | ||
After the upgrade is complete you should check what files have changed and that | ||
your gitignore file does not allow to commit new files placed by the toolkit. If | ||
you want to make sure you have a correct gitignore file you can download it from | ||
the toolkit subsite templates folder. | ||
>```bash | ||
>- composer.json | ||
>- build.xml | ||
>- Jenkinsfile | ||
> git status | ||
> curl https://raw.githubusercontent.com/ec-europa/toolkit/master/includes/templates/subsite/.gitignore > .gitignore | ||
> git status | ||
>``` | ||
<b>Subsite specific files</b>: (to keep) | ||
> | ||
>```bash | ||
>- .git/ | ||
>- .gitattributes | ||
>- .gitignore | ||
>- build.project.props | ||
>- lib/features/* | ||
>- lib/modules/* | ||
>- lib/themes/* | ||
>- resources/site.make | ||
>- resources/composer.json | ||
>- resources/composer.lock | ||
>- tests/* | ||
> ``` | ||
<b>Subsite specific files</b>: (to keep and rename) | ||
> | ||
#### Files renamed | ||
Good to know is that there have been some files renamed. Here is a list of the | ||
most important ones. | ||
|subsite-starterkit|toolkit|Description| | ||
|:---|:---|:---| | ||
|./resources/phpcs-custom.xml|./phpcs-ruleset.xml|The phpcs exclusion rules defined by the project.| | ||
|./resources/build.custom.xml|./build.project.xml|Custom Phing build targets defined by the project.| | ||
|./build.properties|./build.project.props|Properties defined by the project.| | ||
|./build.properties.dist|./build.default.props|List of all available properties.| | ||
|./build.properties.local|./build.develop.props|Local properties for credentials and developer settings.| | ||
#### Build properties | ||
During the upgrade your build.properties file will be renamed to | ||
build.project.props. In toolkit this file is required for CI purposes and you | ||
need a minimum of properties defined there: | ||
[required.props](../includes/phing/props/required.props) | ||
The toolkit is not backwards compatible with | ||
subsite-starterkit so you might have to rename some properties. View a list | ||
of old property names mapped to new property names here: | ||
[deprecated.props](../includes/phing/build/help/deprecated.props). | ||
#### Phpcs | ||
After you completed the upgrade you also need to make sure your codebase is in | ||
compliance with the new version of coder. To run PHPCS you can use a Phing | ||
target: | ||
>```bash | ||
>- resources/build.custom.xml => ../build.project.xml | ||
>- resources/phpcs-custom.xml => ../phpcs-ruleset.xml | ||
> ./toolkit/phing test-run-phpcs | ||
> ./toolkit/phpcbf | ||
> ./toolkit/phing test-run-phpcs | ||
>``` | ||
### 1.3 Upgrade through upstream merge | ||
If you are absolutely certain that you have no starterkit modifications in any other | ||
files then we can let you try an upgrade path. But we do not guarantee a working | ||
starterkit after you merge the branch. So if you decide to merge the upgrade branch, | ||
please use an intermediary to forward a pull request so you can review it fully. | ||
#### Behat | ||
> ``` | ||
> $ git checkout -b intermediary | ||
> $ git remote add starterkit https://github.com/ec-europa/subsite-starterkit.git | ||
> $ git fetch starterkit | ||
> $ git merge starterkit/upgrade | ||
> ``` | ||
Your ./tests folder is overridden by the `./toolkit/phing toolkit-starterkit-upgrade` | ||
target. The new ./tests folder contains a couple of generic tests that we will | ||
be using on CI tools. If you do not wish to use the generic tests and you have | ||
provided your own you can checkout your own tests again. | ||
And last but not least we should remove the remote that has been replaced by the new | ||
Subsite Starterkit package in your composer.json. Then you are ready to update the | ||
new Subsite Starterkit for the first time. | ||
>```bash | ||
> rm -rf ./tests | ||
> git checkout master ./tests | ||
>``` | ||
> ``` | ||
> $ git remote rm starterkit | ||
> $ composer update | ||
> ``` | ||
After you have made sure all is working correctly you can commit and push your | ||
upgrade. When it's ready for review create a pull request to the reference | ||
repository and a MULTISITE ticket so it can be QA'ed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.