Skip to content

Commit

Permalink
[WIP][FEATURE] webdevops/clitools: initial clisync.yml example
Browse files Browse the repository at this point in the history
Add default LOCAL.mysql.dockercompose setting
for docker-compose supported webdevops/clitools versions.

Set common GLOBAL.rsync.workdir value.

Add my common rsync exclude's which aren't part of
the official webdevops clisync.yml file in different
places of the file.

Assume that the local dev environment is a macOS
system und set file system specific utf8 stuff therefore
in GLOBAL.rsync.opts.

Add common environments with some useful defaults
and finalize commands for users using iTerm.app.

Set global sync excludes.

!!! Take care until the merging of exclude(/directory) does not work
as expected within webdevops/clitools. Some excludes
aren't working as expected.

ToDo's
- Finalize after webdevops/clitools#60 is fixed
- Document rsync workarounds
- Add more useful finalize commands after deploy/sync as comment to clisync.yml
- take care of the share configuration
- Add docu how to do a initial deployment (db, assets)

Related: #120
  • Loading branch information
Josef Glatz committed Jun 26, 2017
1 parent 9e3f66e commit d498b61
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
deploy:
environmentname:
command:
finalize:
- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms database:updateschema "*.add,*.change"' }
- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms cache:flush --force' }
- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms install:fixfolderstructure' }
- { type: 'remote', command: 'rm -rf ~/html/typo3/web/typo3conf/realurl_autoconf.php || true' }

- { type: 'remote', command: 'echo "php_flag log_errors on" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "php_value error_log /usr/home/user/php_errors.log" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "SetEnv IN2PUBLISH_CONTEXT Local" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "SetEnv TYPO3_CONTEXT Production/Staging/Backendserver" >> ~/public_html/web/.htaccess' }

- { type: 'remote', command: 'echo "# -restrict access-" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "AuthUserFile /usr/www/users/user/web/.htpasswd" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "AuthName Staging" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "AuthType Basic" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "require valid-user" >> ~/public_html/web/.htaccess' }
- { type: 'remote', command: 'echo "sampleusername:\$1\$.Ie4vDX0\$kla234JFse2fsdfo87j623gd" > ~/public_html/web/.htpasswd' }

- { type: 'remote', command: 'echo "Header set X-Robots-Tag \"noindex, nofollow, noarchive\"" >> ~/typo3/web/.htaccess' }
209 changes: 184 additions & 25 deletions clisync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

LOCAL:
mysql:
# docker-compose: mysql
docker-compose: mysql
# docker: mysql-container
# hostname: localhost
# port: 3306
Expand Down Expand Up @@ -60,13 +60,15 @@ GLOBAL:
## RSYNC
rsync:
# set target as sub directroy (will be appended to working directory)
workdir: ""
workdir: "app/"

# Additional options ("-rlptD --delete-after --progress --human-readable" is already set)
opts: ""
# Use "--iconv=UTF8-MAC,UTF8" if you're local development machine is a macOS system
opts: " --iconv=UTF8-MAC,UTF8"

# exclude list/patterns for files and directories
exclude:
# setting GLOBAL/sync/deploy/share specific excludes could actually lead into a misbehaviour within webdevops/clitools
# Temp files
- "*~"
- "._*"
Expand All @@ -90,6 +92,19 @@ GLOBAL:
- ".buildpath"
- ".project"

# Additional project specific files
- ".DS_Store"
- "bower_components"
- "*.log"
- "/web/typo3temp"
- "/web/fileadmin/_processed_"
- "ENABLE_INSTALL_TOOL"
- "FIRST_INSTALL"
- "realurl_autoconf.php"
- "AdditionalConfiguration_custom.php"
- "AdditionalConfiguration_Development_Docker.php"
- "/Build"

## commands
command:
# Start-Tasks: shell command which should be run before run
Expand All @@ -107,9 +122,9 @@ GLOBAL:
#- { type: 'remote', command: 'date' }

# EXAMPLE: create user "dev" with password "dev"
- "ct typo3:beuser"
#- "ct typo3:beuser"
# EXAMPLE: append toplevel-domain .vm to all domains
- "ct typo3:domain"
#- "ct typo3:domain"



Expand All @@ -129,27 +144,93 @@ sync:
rsync:
# directory list/patterns for synchronization
directory:
- "/fileadmin/"
- "/uploads/"
- "/typo3conf/l10n/"
- "/web/fileadmin/"
- "/web/uploads/"
- "/web/typo3conf/l10n/"

# directory exclude list/patterns
exclude:
- "/fileadmin/_processed_/**"
- "/fileadmin/_temp_/**"

command:
finalize:
#- "ct typo3:domain -D mysql --list typo3"
#- "ct typo3:domain --list typo3"
- "echo 'http://localprojectdomain.vm/ http://localprojectdomain.vm/typo3'"
- "echo 'http://localprojectdomain.docker/ http://localprojectdomain.docker/typo3'"


##################
# Context "Production/Live"
##################
production-live:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: serverhostnameProductionLive

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "serverhostnameProductionLive:/var/www/website/production/live/htdocs"

#conf:
# maxSize: 20M
# minSize: 10kb

mysql:
username: typo3
password: loremipsum
#hostname:

# List of databases for synchronization
# examples:
# local:foreign
# samename
database:
- typo3:website_production_live


##################
# Context "Production/Staging"
##################
production-staging:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: serverhostnameProductionStaging

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "serverhostnameProductionStaging:/var/www/website/production/staging/htdocs"

#conf:
# maxSize: 20M
# minSize: 10kb

mysql:
username: typo3
password: loremipsum
#hostname:

# List of databases for synchronization
# examples:
# local:foreign
# samename
database:
- typo3:website_production_staging


##################
# Context "production"
# Context "Production/Dev"
##################
production:
production-dev:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: live-server
hostname: serverhostnameProductionDev

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "live-server:/var/www/website/htdocs"
path: "serverhostnameProductionDev:/var/www/website/production/dev/htdocs"

#conf:
# maxSize: 20M
Expand All @@ -158,13 +239,14 @@ sync:
mysql:
username: typo3
password: loremipsum
#hostname:

# List of databases for synchronization
# examples:
# local:foreign
# samename
database:
- typo3:website_live
- typo3:website_production_dev



Expand All @@ -184,26 +266,103 @@ deploy:
rsync:
# directory list/patterns for synchronization
directory:
- "/typo3conf/ext/"
- "/"

# directory exclude list/patterns
exclude:
- "/fileadmin/"
- "/uploads/"
- "/typo3conf/l10n/"
# setting GLOBAL/sync/deploy/share specific excludes could actually lead into a misbehaviour within webdevops/clitools
- "/web/fileadmin/"
- "/web/uploads/"
- "/web/typo3conf/l10n/"

##################
# Context "production"
##################
production:
command:
startup:

finalize:



##################
# Context "Production/Live"
##################
production-live:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: live-server
hostname: serverhostnameProductionLive

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "live-server:/var/www/website/htdocs"
path: "serverhostnameProductionLive:/var/www/website/production/live/htdocs"

# directory exclude list/patterns (add all exclude's until https://github.com/webdevops/clitools/issues/60 is fixed/clarified)
exclude:

command:
startup:

finalize:
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Live php_cli ~/html/typo3/typo3cms database:updateschema "*.add,*.change"' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Live php_cli ~/html/typo3/typo3cms cache:flush --force' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Live php_cli ~/html/typo3/typo3cms install:fixfolderstructure' }
#- { type: 'remote', command: 'rm -rf ~/html/typo3/web/typo3conf/realurl_autoconf.php || true' }
- "echo 'Deployed to Production/Live domainProductionLive domainProductionLive/typo3'"


##################
# Context "Production/Staging"
##################
production-staging:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: serverhostnameProductionStaging

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "serverhostnameProductionStaging:/var/www/website/production/staging/htdocs"

# directory exclude list/patterns (add all exclude's until https://github.com/webdevops/clitools/issues/60 is fixed/clarified)
exclude:

command:
startup:

finalize:
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Staging php_cli ~/html/typo3/typo3cms database:updateschema "*.add,*.change"' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Staging php_cli ~/html/typo3/typo3cms cache:flush --force' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Staging php_cli ~/html/typo3/typo3cms install:fixfolderstructure' }
#- { type: 'remote', command: 'rm -rf ~/html/typo3/web/typo3conf/realurl_autoconf.php || true' }
- "echo 'Deployed to Production/Staging domainProductionStaging domainProductionStaging/typo3'"


##################
# Context "Production/Dev"
##################
production-dev:
# ssh server host or name (see .ssh/config, eg for mysql/mysqldump)
ssh:
hostname: serverhostnameProductionDev

# rsync for some directories
rsync:
# server and source directory (server host or name - see .ssh/config)
path: "serverhostnameProductionDev:/var/www/website/production/dev/htdocs"

# directory exclude list/patterns (add all exclude's until https://github.com/webdevops/clitools/issues/60 is fixed/clarified)
exclude:

command:
startup:

finalize:
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms database:updateschema "*.add,*.change"' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms cache:flush --force' }
#- { type: 'remote', command: 'TYPO3_CONTEXT=Production/Dev php_cli ~/html/typo3/typo3cms install:fixfolderstructure' }
#- { type: 'remote', command: 'rm -rf ~/html/typo3/web/typo3conf/realurl_autoconf.php || true' }
#- { type: 'remote', command: 'echo "Header set X-Robots-Tag \"noindex, nofollow, noarchive\"" >> ~/html/typo3/web/.htaccess' }
- "echo 'Deployed to Production/Dev domainProductionDev domainProductionDev/typo3'"




Expand Down

0 comments on commit d498b61

Please sign in to comment.