-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'maschmann-cleanup-and-introduction-of-item-iterator'
- Loading branch information
Showing
4 changed files
with
60 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
## v0.1 | ||
|
||
* structural refactoring (creating files, directories, ...) | ||
* added cleanup-script to remove old releases |
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,36 +1,58 @@ | ||
--- | ||
# tasks file for symfony2 | ||
- name: Create the release {{symfony2_project_release}} directory. | ||
file: state=directory path={{symfony2_project_root}}/releases/{{symfony2_project_release}} | ||
- name: Create the shared directory. | ||
file: state=directory path={{symfony2_project_root}}/shared | ||
- name: Create the shared/app/config directory. | ||
file: state=directory path={{symfony2_project_root}}/shared/app/config | ||
- name: Create the shared/web/uploads directory. | ||
file: state=directory path={{symfony2_project_root}}/shared/web/uploads | ||
- name: Create the shared/app/logs directory. | ||
file: state=directory path={{symfony2_project_root}}/shared/app/logs | ||
- name: Create/prepare directories for release and shared data. | ||
file: state=directory path={{item.path}} | ||
with_items: | ||
- { path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}" } | ||
- { path: "{{symfony2_project_root}}/shared" } | ||
- { path: "{{symfony2_project_root}}/shared/app/config" } | ||
- { path: "{{symfony2_project_root}}/shared/app/uploads" } | ||
- { path: "{{symfony2_project_root}}/shared/app/logs" } | ||
|
||
- name: Pull sources from the repository. | ||
git: repo={{symfony2_project_repo}} dest={{symfony2_project_root}}/releases/{{symfony2_project_release}} version={{symfony2_project_branch}} | ||
- name: Check if shared/app/config/parameters.ini exists | ||
git: repo={{symfony2_project_repo}} dest={{symfony2_project_root}}/releases/{{symfony2_project_release}} version={{symfony2_project_branch}} accept_hostkey=yes | ||
|
||
- name: Clean out versioning. | ||
file: state=absent path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/.git | ||
when: symfony2_project_clean_versioning == true | ||
|
||
- name: Create symlinks to shared directories. | ||
file: state=link src={{item.src}} path={{item.path}} | ||
with_items: | ||
- { src: "{{symfony2_project_root}}/shared/web/uploads", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/uploads" } | ||
- { src: "{{symfony2_project_root}}/shared/app/logs", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/logs" } | ||
|
||
- name: Check if shared/app/config/parameters.ini exists. | ||
stat: path={{symfony2_project_root}}/shared/app/config/parameters.ini | ||
register: parameters_ini | ||
- name: Create symlink for app/config/parameters.ini from shared directory | ||
|
||
- name: Create symlink for app/config/parameters.ini from shared directory. | ||
shell: ln -s {{symfony2_project_root}}/shared/app/config/parameters.ini {{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/config/parameters.ini creates={{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/config/parameters.ini | ||
when: parameters_ini.stat.exists | ||
- name: Create app/logs symlink | ||
file: state=link src={{symfony2_project_root}}/shared/app/logs path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/logs | ||
- name: Create web/uploads symlink | ||
file: state=link src={{symfony2_project_root}}/shared/web/uploads path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/web/uploads | ||
- name: Install composer | ||
get_url: url=https://getcomposer.org/composer.phar dest={{symfony2_project_root}}/composer.phar mode=0755 validate_certs=no | ||
- name: Run composer install | ||
shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && export SYMFONY_ENV={{symfony2_project_env}}; {{symfony2_project_php_path}} {{symfony2_project_root}}/composer.phar install {{symfony2_project_composer_opts}} | ||
- name: Dump assets | ||
|
||
- name: Check if composer exists. | ||
stat: path={{symfony2_project_composer_path}} | ||
register: composer_file | ||
|
||
- name: Install composer. | ||
get_url: url=https://getcomposer.org/composer.phar dest={{symfony2_project_composer_path}} mode=0755 validate_certs=no | ||
when: composer_file.stat.exists == false | ||
|
||
- name: Update composer if already exists. | ||
shell: "{{symfony2_project_composer_path}} selfupdate" | ||
when: composer_file.stat.exists == true | ||
|
||
- name: Run composer install. | ||
shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && {{symfony2_project_php_path}} {{symfony2_project_root}}/composer.phar install {{symfony2_project_composer_opts}} | ||
|
||
- name: Dump assets. | ||
shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && {{symfony2_project_php_path}} app/console assetic:dump --env={{symfony2_project_env}} {{symfony2_project_console_opts}} | ||
- name: Run migrations | ||
|
||
- name: Run migrations. | ||
shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && if $(grep doctrine-migrations-bundle composer.json); then {{symfony2_project_php_path}} app/console doctrine:migrations:migrate -n; fi | ||
- name: Create symlink | ||
|
||
- name: Create symlink. | ||
file: state=link src={{symfony2_project_root}}/releases/{{symfony2_project_release}} path={{symfony2_project_root}}/current | ||
|
||
- name: Cleanup releases. | ||
shell: cd {{symfony2_project_root}}/releases && ls -t1 | tail -n +$(({{symfony2_project_keep_releases}}+1)) | xargs -n1 rm -rf |