From f5587709e7a058ab1356c6140a098dc7152b3815 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Sun, 3 Jan 2016 12:57:43 +0000 Subject: [PATCH 01/20] Fixed typo --- documentation/INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/INSTALL.md b/documentation/INSTALL.md index d613294..af065e6 100644 --- a/documentation/INSTALL.md +++ b/documentation/INSTALL.md @@ -17,7 +17,7 @@ with a mailcatcher (Postfix with Dovecot, catches all outgoing mails). _Warning:_ Boot2docker ist not recommended because of slow/buggy file sharing between host and guest and there is no convienient way to access the box with Samba or SSH. -This Docker boilerplate tries to avoid common anti-pattners like a Samba/SSH container because Boot2docker +This Docker boilerplate tries to avoid common anti-patterns like a Samba/SSH container because Boot2docker isn't able to handle such tasks. For more convenience use [CliTools.phar](https://github.com/webdevops/clitools) (will also run on native Linux, not only inside a Vagrant box) From d9b8ece505bd8e373ca3026ff1585f731234b2a8 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 7 Mar 2016 23:23:02 +0100 Subject: [PATCH 02/20] Version bump --- CHANGELOG.md | 5 ++++- README.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db2bd1..6204bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ PHP Docker Boilerplate Changelog ================================== -5.0.0 - UPCOMING +5.1.0 - UPCOMING ---------------- + +5.0.0 - 2016-03-07 +------------------ - Refactored with new `webdevops/base` images - Faster creation/startup times - Ansible provisioning diff --git a/README.md b/README.md index 73bed7a..b8a54d4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dockerized PHP web project boilerplate -[![latest v4.0.0](https://img.shields.io/badge/latest-v4.0.0-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/4.0.0) +[![latest v5.0.0](https://img.shields.io/badge/latest-v5.0.0-green.svg?style=flat)](https://github.com/webdevops/php-docker-boilerplate/releases/tag/5.0.0) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/mblaschke/php-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/php-docker-boilerplate "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/mblaschke/php-docker-boilerplate.svg)](http://isitmaintained.com/project/mblaschke/php-docker-boilerplate "Percentage of issues still open") From 52635d6e1dcda70be5d794a37e95255c9866801c Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Fri, 18 Mar 2016 18:37:00 +0100 Subject: [PATCH 03/20] Fix solr/storage support --- docker-compose.cloud.yml | 2 +- docker-compose.development.yml | 2 +- docker-compose.production.yml | 2 +- docker/solr/Dockerfile | 10 +++++----- docker/storage/Dockerfile | 7 ++++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml index dd05fb1..ea71f45 100644 --- a/docker-compose.cloud.yml +++ b/docker-compose.cloud.yml @@ -133,4 +133,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 8fc0258..6c01368 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -147,4 +147,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker-compose.production.yml b/docker-compose.production.yml index abd229f..89398a7 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -139,4 +139,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile index 516dd5c..5c399e3 100644 --- a/docker/solr/Dockerfile +++ b/docker/solr/Dockerfile @@ -20,13 +20,13 @@ COPY ./conf/ /opt/solr-conf/ RUN curl -sf -o /tmp/solr-typo3-plugin.jar -L http://www.typo3-solr.com/fileadmin/files/solr/solr-typo3-plugin-1.3.0.jar # Init directories -RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ -RUN mkdir -p /opt/solr/example/solr/typo3cores/data -RUN mkdir -p /opt/solr/example/solr/typo3lib +RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ \ + && mkdir -p /opt/solr/example/solr/typo3cores/data \ + && mkdir -p /opt/solr/example/solr/typo3lib # Add plugins -RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ -RUN ln -s /opt/solr/contrib /opt/solr/example/solr/contrib +RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ \ + && ln -s /opt/solr/contrib /opt/solr/example/solr/contrib # Fix rights RUN chown solr:solr -R /opt/solr/example/solr/ diff --git a/docker/storage/Dockerfile b/docker/storage/Dockerfile index fafb2b2..b8ef05a 100644 --- a/docker/storage/Dockerfile +++ b/docker/storage/Dockerfile @@ -2,4 +2,9 @@ # Storage Docker container #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/storage +FROM busybox + +RUN mkdir /storage \ + && chmod 1777 /storage + +VOLUME "/storage" From d40742a8fbd499538794f316bfc95e2f532b9025 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Fri, 18 Mar 2016 18:46:09 +0100 Subject: [PATCH 04/20] Refactoring backup/restore and Makefile --- Makefile | 16 ++++++---------- bin/.config.sh | 19 +++++++++++++++++++ bin/backup.sh | 23 +++++++++++++++-------- bin/restore.sh | 28 +++++++++++++++++++--------- 4 files changed, 59 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 1847647..738bf40 100644 --- a/Makefile +++ b/Makefile @@ -38,24 +38,20 @@ rebuild: ############################# mysql-backup: - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh mysql + bash ./bin/backup.sh mysql mysql-restore: - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh mysql + bash ./bin/restore.sh mysql ############################# # Solr ############################# solr-backup: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh solr - docker-compose start solr + bash ./bin/backup.sh solr solr-restore: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh solr - docker-compose start solr + bash ./bin/restore.sh solr ############################# # General @@ -68,10 +64,10 @@ build: bash bin/build.sh bash: - docker-compose run --rm app bash + docker exec -ti "`docker-compose ps -q app`" 'bash' root: - docker-compose run --rm app root + docker exec -ti "`docker-compose ps -q app`" 'root' ############################# # Argument fix workaround diff --git a/bin/.config.sh b/bin/.config.sh index 4b4cbcf..778961d 100755 --- a/bin/.config.sh +++ b/bin/.config.sh @@ -52,3 +52,22 @@ execInDir() { sh -c "cd \"$1\" && $2" } + +dockerContainerId() { + echo "$(docker-compose ps -q "$1" 2> /dev/null || echo "")" +} + +dockerExec() { + docker exec -i "$(docker-compose ps -q app)" $@ +} + +dockerCopyFrom() { + PATH_DOCKER="$1" + PATH_HOST="$2" + docker cp "$(docker-compose ps -q app):${PATH_DOCKER}" "${PATH_HOST}" +} +dockerCopyTo() { + PATH_HOST="$1" + PATH_DOCKER="$2" + docker cp "${PATH_HOST}" "$(docker-compose ps -q app):${PATH_DOCKER}" +} diff --git a/bin/backup.sh b/bin/backup.sh index 9d5c3c0..3afb2b8 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -25,7 +25,7 @@ case "$1" in fi logMsg "Starting MySQL backup..." - mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + dockerExec mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" logMsg "Finished" ;; @@ -33,13 +33,20 @@ case "$1" in ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Removing old backup file..." - rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + if [[ -n "$(dockerContainerId solr)" ]]; then + logMsg "Starting Solr backup..." + docker-compose stop solr + + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Removing old backup file..." + rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + fi + dockerExec tar -cP --to-stdout /storage/solr/ | bzip2 > "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + + docker-compose start solr + logMsg "Finished" + else + echo "[WARNING] Skipping solr backup, no such container" fi - - logMsg "Starting Solr backup..." - tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /storage/solr/ - logMsg "Finished" ;; esac diff --git a/bin/restore.sh b/bin/restore.sh index 71de559..f9a9764 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -21,7 +21,7 @@ case "$1" in "mysql") if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then logMsg "Starting MySQL restore..." - bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | mysql + bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql logMsg "Finished" else errorMsg "MySQL backup file not found" @@ -33,15 +33,25 @@ case "$1" in ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Starting Solr restore..." - rm -rf /storage/solr/* && mkdir -p /storage/solr/ - chmod 777 /storage/solr/ - tar jxPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C / - logMsg "Finished" + if [[ -n "$(dockerContainerId solr)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Starting Solr restore..." + docker-compose stop solr + + dockerExec rm -rf /storage/solr/ + dockerExec mkdir -p /storage/solr/ + dockerExec chmod 777 /storage/solr/ + dockerCopyTo "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" "/tmp/solr-restore.tbz2" + dockerExec tar -jxPf "/tmp/solr-restore.tbz2" -C / + + docker-compose start solr + logMsg "Finished" + else + errorMsg "Solr backup file not found" + exit 1 + fi else - errorMsg "Solr backup file not found" - exit 1 + echo "[WARNING] Skipping solr restore, no such container" fi ;; esac From 29b29ccf9ebd2e4dac96bab5d0c4017029d28e03 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Fri, 18 Mar 2016 18:37:00 +0100 Subject: [PATCH 05/20] Fix solr/storage support --- docker-compose.cloud.yml | 2 +- docker-compose.development.yml | 2 +- docker-compose.production.yml | 2 +- docker/solr/Dockerfile | 10 +++++----- docker/storage/Dockerfile | 7 ++++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml index dd05fb1..ea71f45 100644 --- a/docker-compose.cloud.yml +++ b/docker-compose.cloud.yml @@ -133,4 +133,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 8fc0258..6c01368 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -147,4 +147,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker-compose.production.yml b/docker-compose.production.yml index abd229f..89398a7 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -139,4 +139,4 @@ mysql: storage: build: docker/storage/ volumes: - - /data + - /storage diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile index 516dd5c..5c399e3 100644 --- a/docker/solr/Dockerfile +++ b/docker/solr/Dockerfile @@ -20,13 +20,13 @@ COPY ./conf/ /opt/solr-conf/ RUN curl -sf -o /tmp/solr-typo3-plugin.jar -L http://www.typo3-solr.com/fileadmin/files/solr/solr-typo3-plugin-1.3.0.jar # Init directories -RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ -RUN mkdir -p /opt/solr/example/solr/typo3cores/data -RUN mkdir -p /opt/solr/example/solr/typo3lib +RUN cp -a /opt/solr-conf/* /opt/solr/example/solr/ \ + && mkdir -p /opt/solr/example/solr/typo3cores/data \ + && mkdir -p /opt/solr/example/solr/typo3lib # Add plugins -RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ -RUN ln -s /opt/solr/contrib /opt/solr/example/solr/contrib +RUN mv /tmp/solr-typo3-plugin.jar /opt/solr/example/solr/typo3lib/ \ + && ln -s /opt/solr/contrib /opt/solr/example/solr/contrib # Fix rights RUN chown solr:solr -R /opt/solr/example/solr/ diff --git a/docker/storage/Dockerfile b/docker/storage/Dockerfile index fafb2b2..b8ef05a 100644 --- a/docker/storage/Dockerfile +++ b/docker/storage/Dockerfile @@ -2,4 +2,9 @@ # Storage Docker container #++++++++++++++++++++++++++++++++++++++ -FROM webdevops/storage +FROM busybox + +RUN mkdir /storage \ + && chmod 1777 /storage + +VOLUME "/storage" From e60577beb270371a2d632dcd593de39839dd03ae Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Fri, 18 Mar 2016 18:46:09 +0100 Subject: [PATCH 06/20] Refactoring backup/restore and Makefile --- Makefile | 16 ++++++---------- bin/.config.sh | 19 +++++++++++++++++++ bin/backup.sh | 23 +++++++++++++++-------- bin/restore.sh | 28 +++++++++++++++++++--------- 4 files changed, 59 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 9bf4177..e3aa69f 100644 --- a/Makefile +++ b/Makefile @@ -38,24 +38,20 @@ rebuild: ############################# mysql-backup: - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh mysql + bash ./bin/backup.sh mysql mysql-restore: - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh mysql + bash ./bin/restore.sh mysql ############################# # Solr ############################# solr-backup: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/backup.sh solr - docker-compose start solr + bash ./bin/backup.sh solr solr-restore: - docker-compose stop solr - docker-compose run --rm --no-deps app root bash /docker/bin/restore.sh solr - docker-compose start solr + bash ./bin/restore.sh solr ############################# # General @@ -71,10 +67,10 @@ clean: test -d app/typo3temp && { rm -rf app/typo3temp/*; } bash: - docker-compose run --rm app bash + docker exec -ti "`docker-compose ps -q app`" 'bash' root: - docker-compose run --rm app root + docker exec -ti "`docker-compose ps -q app`" 'root' ############################# # TYPO3 diff --git a/bin/.config.sh b/bin/.config.sh index 4b4cbcf..778961d 100755 --- a/bin/.config.sh +++ b/bin/.config.sh @@ -52,3 +52,22 @@ execInDir() { sh -c "cd \"$1\" && $2" } + +dockerContainerId() { + echo "$(docker-compose ps -q "$1" 2> /dev/null || echo "")" +} + +dockerExec() { + docker exec -i "$(docker-compose ps -q app)" $@ +} + +dockerCopyFrom() { + PATH_DOCKER="$1" + PATH_HOST="$2" + docker cp "$(docker-compose ps -q app):${PATH_DOCKER}" "${PATH_HOST}" +} +dockerCopyTo() { + PATH_HOST="$1" + PATH_DOCKER="$2" + docker cp "${PATH_HOST}" "$(docker-compose ps -q app):${PATH_DOCKER}" +} diff --git a/bin/backup.sh b/bin/backup.sh index 9d5c3c0..3afb2b8 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -25,7 +25,7 @@ case "$1" in fi logMsg "Starting MySQL backup..." - mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + dockerExec mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" logMsg "Finished" ;; @@ -33,13 +33,20 @@ case "$1" in ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Removing old backup file..." - rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + if [[ -n "$(dockerContainerId solr)" ]]; then + logMsg "Starting Solr backup..." + docker-compose stop solr + + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Removing old backup file..." + rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + fi + dockerExec tar -cP --to-stdout /storage/solr/ | bzip2 > "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" + + docker-compose start solr + logMsg "Finished" + else + echo "[WARNING] Skipping solr backup, no such container" fi - - logMsg "Starting Solr backup..." - tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /storage/solr/ - logMsg "Finished" ;; esac diff --git a/bin/restore.sh b/bin/restore.sh index 71de559..f9a9764 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -21,7 +21,7 @@ case "$1" in "mysql") if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then logMsg "Starting MySQL restore..." - bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | mysql + bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql logMsg "Finished" else errorMsg "MySQL backup file not found" @@ -33,15 +33,25 @@ case "$1" in ## Solr ################################### "solr") - if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then - logMsg "Starting Solr restore..." - rm -rf /storage/solr/* && mkdir -p /storage/solr/ - chmod 777 /storage/solr/ - tar jxPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C / - logMsg "Finished" + if [[ -n "$(dockerContainerId solr)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then + logMsg "Starting Solr restore..." + docker-compose stop solr + + dockerExec rm -rf /storage/solr/ + dockerExec mkdir -p /storage/solr/ + dockerExec chmod 777 /storage/solr/ + dockerCopyTo "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" "/tmp/solr-restore.tbz2" + dockerExec tar -jxPf "/tmp/solr-restore.tbz2" -C / + + docker-compose start solr + logMsg "Finished" + else + errorMsg "Solr backup file not found" + exit 1 + fi else - errorMsg "Solr backup file not found" - exit 1 + echo "[WARNING] Skipping solr restore, no such container" fi ;; esac From 08c74193c0110788a44041a71d67d1a324754164 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Sat, 19 Mar 2016 16:02:35 +0100 Subject: [PATCH 07/20] Added default index.php --- app/web/index.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/web/index.php diff --git a/app/web/index.php b/app/web/index.php new file mode 100644 index 0000000..c4837a3 --- /dev/null +++ b/app/web/index.php @@ -0,0 +1 @@ + Date: Sat, 19 Mar 2016 19:06:26 +0100 Subject: [PATCH 08/20] Fixed make create --- bin/create-project.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/create-project.sh b/bin/create-project.sh index 7362cf3..2eb788f 100755 --- a/bin/create-project.sh +++ b/bin/create-project.sh @@ -12,10 +12,9 @@ if [ "$#" -lt 1 ]; then exit 1 fi -mkdir -p -- "$CODE_DIR/" -chmod 777 "$CODE_DIR/" -rm -f -- "$CODE_DIR/.gitkeep" +rm -rf -- "$CODE_DIR" +mkdir -p "$CODE_DIR" case "$1" in ################################### From eb9f216831f0488fe91d8b9ea6bde0aa9399bb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Ho=CC=88chtl?= Date: Fri, 11 Mar 2016 22:45:09 +0100 Subject: [PATCH 09/20] Switch to docker exec in Makefile # Conflicts: # Makefile --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e3aa69f..928e961 100644 --- a/Makefile +++ b/Makefile @@ -66,18 +66,20 @@ build: clean: test -d app/typo3temp && { rm -rf app/typo3temp/*; } -bash: - docker exec -ti "`docker-compose ps -q app`" 'bash' +bash: shell + +shell: + docker exec -it -u application $$(docker-compose ps -q app) /bin/bash root: - docker exec -ti "`docker-compose ps -q app`" 'root' + docker exec -it -u root $$(docker-compose ps -q app) /bin/bash ############################# # TYPO3 ############################# scheduler: - docker-compose run --rm app typo3/cli_dispatch.phpsh scheduler $(ARGS) + docker exec -it $$(docker-compose ps -q app) typo3/cli_dispatch.phpsh scheduler $(ARGS) ############################# # Argument fix workaround From 80c4f57041db9d39ba96efbf2e185b8517111e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Ho=CC=88chtl?= Date: Fri, 11 Mar 2016 22:45:09 +0100 Subject: [PATCH 10/20] Switch to docker exec in Makefile # Conflicts: # Makefile # Conflicts: # Makefile --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 738bf40..c52d118 100644 --- a/Makefile +++ b/Makefile @@ -63,11 +63,13 @@ restore: mysql-restore solr-restore build: bash bin/build.sh -bash: - docker exec -ti "`docker-compose ps -q app`" 'bash' +bash: shell + +shell: + docker exec -it -u application $$(docker-compose ps -q app) /bin/bash root: - docker exec -ti "`docker-compose ps -q app`" 'root' + docker exec -it -u root $$(docker-compose ps -q app) /bin/bash ############################# # Argument fix workaround From 4132c8033eaaace3eedd14a49e6ec0cfbcb0bb3f Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 21 Mar 2016 23:30:17 +0100 Subject: [PATCH 11/20] Add mysql backup only if mysql is available --- bin/backup.sh | 20 ++++++++++++-------- bin/restore.sh | 18 +++++++++++------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 3afb2b8..30fc9f6 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -19,14 +19,18 @@ case "$1" in ## MySQL ################################### "mysql") - if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then - logMsg "Removing old backup file..." - rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" - fi + if [[ -n "$(dockerContainerId mysql)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then + logMsg "Removing old backup file..." + rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + fi - logMsg "Starting MySQL backup..." - dockerExec mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" - logMsg "Finished" + logMsg "Starting MySQL backup..." + dockerExec mysqldump --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" + logMsg "Finished" + else + echo " * Skipping mysql backup, no such container" + fi ;; ################################### @@ -46,7 +50,7 @@ case "$1" in docker-compose start solr logMsg "Finished" else - echo "[WARNING] Skipping solr backup, no such container" + echo " * Skipping solr backup, no such container" fi ;; esac diff --git a/bin/restore.sh b/bin/restore.sh index f9a9764..de0bc6b 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -19,13 +19,17 @@ case "$1" in ## MySQL ################################### "mysql") - if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then - logMsg "Starting MySQL restore..." - bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql - logMsg "Finished" + if [[ -n "$(dockerContainerId mysql)" ]]; then + if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then + logMsg "Starting MySQL restore..." + bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql + logMsg "Finished" + else + errorMsg "MySQL backup file not found" + exit 1 + fi else - errorMsg "MySQL backup file not found" - exit 1 + echo " * Skipping mysql restore, no such container" fi ;; @@ -51,7 +55,7 @@ case "$1" in exit 1 fi else - echo "[WARNING] Skipping solr restore, no such container" + echo " * Skipping solr restore, no such container" fi ;; esac From 28cd9e23ba57c919dde58c551616df0bc6d3c73c Mon Sep 17 00:00:00 2001 From: Florian Tatzel Date: Mon, 28 Mar 2016 09:49:43 -0700 Subject: [PATCH 12/20] Adds Read the Docs Documentation files and adds rst config to editorconfig. --- .editorconfig | 4 + documentation/docs/Makefile | 216 +++++++++++++ documentation/docs/conf.py | 300 ++++++++++++++++++ .../content/components/ansibleRoles/roles.rst | 5 + .../docs/content/components/dockerCompose.rst | 5 + .../docs/content/components/dockerfiles.rst | 5 + .../docs/content/components/index.rst | 14 + .../docs/content/components/scripts.rst | 12 + .../docs/content/contribute/code.rst | 5 + .../docs/content/contribute/documentation.rst | 5 + .../docs/content/contribute/index.rst | 12 + .../docs/content/gettingStarted/index.rst | 21 ++ documentation/docs/content/introduction.rst | 11 + .../docs/content/usage/dockerCompose.rst | 5 + .../docs/content/usage/dockerImages.rst | 5 + documentation/docs/content/usage/index.rst | 12 + .../docs/content/usage/vagrantDockerVM.rst | 5 + documentation/docs/index.rst | 30 ++ documentation/docs/make.bat | 263 +++++++++++++++ 19 files changed, 935 insertions(+) create mode 100644 documentation/docs/Makefile create mode 100644 documentation/docs/conf.py create mode 100644 documentation/docs/content/components/ansibleRoles/roles.rst create mode 100644 documentation/docs/content/components/dockerCompose.rst create mode 100644 documentation/docs/content/components/dockerfiles.rst create mode 100644 documentation/docs/content/components/index.rst create mode 100644 documentation/docs/content/components/scripts.rst create mode 100644 documentation/docs/content/contribute/code.rst create mode 100644 documentation/docs/content/contribute/documentation.rst create mode 100644 documentation/docs/content/contribute/index.rst create mode 100644 documentation/docs/content/gettingStarted/index.rst create mode 100644 documentation/docs/content/introduction.rst create mode 100644 documentation/docs/content/usage/dockerCompose.rst create mode 100644 documentation/docs/content/usage/dockerImages.rst create mode 100644 documentation/docs/content/usage/index.rst create mode 100644 documentation/docs/content/usage/vagrantDockerVM.rst create mode 100644 documentation/docs/index.rst create mode 100644 documentation/docs/make.bat diff --git a/.editorconfig b/.editorconfig index ff6fa56..4a62c51 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,3 +19,7 @@ indent_size = 2 [*.conf] indent_size = 2 + +[*.rst] +indent_style = space +indent_size = 3 diff --git a/documentation/docs/Makefile b/documentation/docs/Makefile new file mode 100644 index 0000000..dcf3199 --- /dev/null +++ b/documentation/docs/Makefile @@ -0,0 +1,216 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/WebDevOpsDocumentation.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/WebDevOpsDocumentation.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/WebDevOpsDocumentation" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/WebDevOpsDocumentation" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/documentation/docs/conf.py b/documentation/docs/conf.py new file mode 100644 index 0000000..dacc2c4 --- /dev/null +++ b/documentation/docs/conf.py @@ -0,0 +1,300 @@ +# -*- coding: utf-8 -*- +# +# PHP Docker Boilerplate Documentation build configuration file, created by +# sphinx-quickstart on Sat Mar 19 12:21:05 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +from recommonmark.parser import CommonMarkParser + +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +html_sidebars = { + '**': ['globaltoc.html'], +} +# otherwise, readthedocs.org uses their theme by default, so no need to specify it + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = ['.rst', '.md'] +# source_suffix = '.rst' + +source_parsers = { + '.md': CommonMarkParser, +} + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'PHP Docker Boilerplate Documentation' +copyright = u'2016, Team WebDevOps' +author = u'Team WebDevOps' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +#version = u'0.0.2' +# The full version, including alpha/beta/rc tags. +#release = u'0.0.2' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +#html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'PhpDockerBoilerplateDocumentationdoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'PhpDockerBoilerplateDocumentation.tex', u'PHP Docker Boilerplate Documentation', + u'Florian Tatzel', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'phpdockerboilerplatedocumentation', u'PHP Docker Boilerplate Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'PhpDockerBoilerplateDocumentation', u'PHP Docker Boilerplate Documentation', + author, 'PhpDockerBoilerplateDocumentation', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/documentation/docs/content/components/ansibleRoles/roles.rst b/documentation/docs/content/components/ansibleRoles/roles.rst new file mode 100644 index 0000000..658853b --- /dev/null +++ b/documentation/docs/content/components/ansibleRoles/roles.rst @@ -0,0 +1,5 @@ +=========================== +Ansible Roles Configuration +=========================== + +This section is not done yet! diff --git a/documentation/docs/content/components/dockerCompose.rst b/documentation/docs/content/components/dockerCompose.rst new file mode 100644 index 0000000..f5ee7a8 --- /dev/null +++ b/documentation/docs/content/components/dockerCompose.rst @@ -0,0 +1,5 @@ +==================== +Docker Compose Setup +==================== + +This section is not done yet! diff --git a/documentation/docs/content/components/dockerfiles.rst b/documentation/docs/content/components/dockerfiles.rst new file mode 100644 index 0000000..f6da05b --- /dev/null +++ b/documentation/docs/content/components/dockerfiles.rst @@ -0,0 +1,5 @@ +=========== +Dockerfiles +=========== + +This section is not done yet! diff --git a/documentation/docs/content/components/index.rst b/documentation/docs/content/components/index.rst new file mode 100644 index 0000000..b18d888 --- /dev/null +++ b/documentation/docs/content/components/index.rst @@ -0,0 +1,14 @@ +================= +Project Structure +================= + +This section is not done yet! + + +.. toctree:: + :maxdepth: 1 + + dockerfiles + dockerCompose + scripts + ansibleRoles/roles diff --git a/documentation/docs/content/components/scripts.rst b/documentation/docs/content/components/scripts.rst new file mode 100644 index 0000000..ba856ae --- /dev/null +++ b/documentation/docs/content/components/scripts.rst @@ -0,0 +1,12 @@ +======================== +Scripts and Provisioning +======================== + +This section is not done yet! + +------------- +Ansible Roles +------------- + +This section is not done yet! + diff --git a/documentation/docs/content/contribute/code.rst b/documentation/docs/content/contribute/code.rst new file mode 100644 index 0000000..b558f21 --- /dev/null +++ b/documentation/docs/content/contribute/code.rst @@ -0,0 +1,5 @@ +================= +Contributing Code +================= + +How to contribute Code diff --git a/documentation/docs/content/contribute/documentation.rst b/documentation/docs/content/contribute/documentation.rst new file mode 100644 index 0000000..84a7b91 --- /dev/null +++ b/documentation/docs/content/contribute/documentation.rst @@ -0,0 +1,5 @@ +======================== +Contribute Documentation +======================== + +How to contribute Documentation diff --git a/documentation/docs/content/contribute/index.rst b/documentation/docs/content/contribute/index.rst new file mode 100644 index 0000000..dea2e5f --- /dev/null +++ b/documentation/docs/content/contribute/index.rst @@ -0,0 +1,12 @@ +================= +How to Contribute +================= + +This section is not done yet! + + +.. toctree:: + :maxdepth: 1 + + code + documentation diff --git a/documentation/docs/content/gettingStarted/index.rst b/documentation/docs/content/gettingStarted/index.rst new file mode 100644 index 0000000..47322f6 --- /dev/null +++ b/documentation/docs/content/gettingStarted/index.rst @@ -0,0 +1,21 @@ +=============== +Getting Started +=============== + +------------ +Requirements +------------ + +This section is not done yet! + +------------ +Installation +------------ + +This section is not done yet! + +----- +Usage +----- + +This section is not done yet! diff --git a/documentation/docs/content/introduction.rst b/documentation/docs/content/introduction.rst new file mode 100644 index 0000000..a4a54bc --- /dev/null +++ b/documentation/docs/content/introduction.rst @@ -0,0 +1,11 @@ +============ +Introduction +============ + +Introduction Content + +--------------------------------------- +What is the PHP Docker Boilerplate for? +--------------------------------------- + +This section is not done yet! diff --git a/documentation/docs/content/usage/dockerCompose.rst b/documentation/docs/content/usage/dockerCompose.rst new file mode 100644 index 0000000..788101b --- /dev/null +++ b/documentation/docs/content/usage/dockerCompose.rst @@ -0,0 +1,5 @@ +============================ +Docker Compose Configuration +============================ + +This section is not done yet! diff --git a/documentation/docs/content/usage/dockerImages.rst b/documentation/docs/content/usage/dockerImages.rst new file mode 100644 index 0000000..45c15a6 --- /dev/null +++ b/documentation/docs/content/usage/dockerImages.rst @@ -0,0 +1,5 @@ +====================== +Altering Docker Images +====================== + +This section is not done yet! diff --git a/documentation/docs/content/usage/index.rst b/documentation/docs/content/usage/index.rst new file mode 100644 index 0000000..d059bbb --- /dev/null +++ b/documentation/docs/content/usage/index.rst @@ -0,0 +1,12 @@ +===== +Usage +===== + +This section is not done yet! + +.. toctree:: + :maxdepth: 1 + + dockerCompose + dockerImages + vagrantDockerVM diff --git a/documentation/docs/content/usage/vagrantDockerVM.rst b/documentation/docs/content/usage/vagrantDockerVM.rst new file mode 100644 index 0000000..a7f7284 --- /dev/null +++ b/documentation/docs/content/usage/vagrantDockerVM.rst @@ -0,0 +1,5 @@ +============================== +Synergy with Vagrant Docker VM +============================== + +This section is not done yet! diff --git a/documentation/docs/index.rst b/documentation/docs/index.rst new file mode 100644 index 0000000..23a4371 --- /dev/null +++ b/documentation/docs/index.rst @@ -0,0 +1,30 @@ +.. WebDevOps Documentation documentation master file, created by + sphinx-quickstart on Sat Mar 19 12:21:05 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +:orphan: true + +======== +Overview +======== + +| Welcome to the documentation pages for the WebDevOps PHP Docker Boilerplate. +| +| Here you will find informations about the usage of the PHP Docker Boilerplate, as well as informations about the components we used to compose it. +| This documentation is work in progess and we appeciate every help we can get, so feel free to contribute. +| +| + +.. toctree:: + + Back to Project Overview + content/introduction + +.. toctree:: + :caption: Documentation + + content/gettingStarted/index + content/usage/index + content/components/index + content/contribute/index diff --git a/documentation/docs/make.bat b/documentation/docs/make.bat new file mode 100644 index 0000000..86bd9f2 --- /dev/null +++ b/documentation/docs/make.bat @@ -0,0 +1,263 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 1>NUL 2>NUL +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\WebDevOpsDocumentation.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\WebDevOpsDocumentation.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end From 23bdf1fdb161e81b1e62b55cc3554c2003efd038 Mon Sep 17 00:00:00 2001 From: Marc Henklein Date: Mon, 28 Mar 2016 21:00:18 +0200 Subject: [PATCH 13/20] enable phpXdebug by default for dev environment the php development.ini has xdebug enabled by default, so xdebug should also be installed. alternative: update the docs, that you have to enable phpXdebug first. --- etc/application.development.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/application.development.yml b/etc/application.development.yml index fe2c56b..6457b5a 100644 --- a/etc/application.development.yml +++ b/etc/application.development.yml @@ -5,7 +5,7 @@ PROVISION: install: phpBlackfire: false - phpXdebug: false + phpXdebug: true apacheModPagespeed: false service: From 74ff48617028c22b41fe45cfc74e602fd0247ed6 Mon Sep 17 00:00:00 2001 From: Marc Henklein Date: Mon, 28 Mar 2016 21:00:18 +0200 Subject: [PATCH 14/20] enable phpXdebug by default for dev environment the php development.ini has xdebug enabled by default, so xdebug should also be installed. alternative: update the docs, that you have to enable phpXdebug first. --- etc/application.development.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/application.development.yml b/etc/application.development.yml index fe2c56b..6457b5a 100644 --- a/etc/application.development.yml +++ b/etc/application.development.yml @@ -5,7 +5,7 @@ PROVISION: install: phpBlackfire: false - phpXdebug: false + phpXdebug: true apacheModPagespeed: false service: From d1746000551099bad9e6ea2a4c4fe3079b0a5a8a Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Wed, 6 Apr 2016 21:12:39 +0200 Subject: [PATCH 15/20] Add exit on error in solr entrypoint Fixed #30 --- docker/solr/entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/solr/entrypoint.sh b/docker/solr/entrypoint.sh index 2fbaa14..4f3ec51 100755 --- a/docker/solr/entrypoint.sh +++ b/docker/solr/entrypoint.sh @@ -1,5 +1,9 @@ #!/bin/bash +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value ################### # Move storage to storage container @@ -27,4 +31,4 @@ if [ "$1" = 'solr' ]; then exec java -jar start.jar fi -exec "$@" \ No newline at end of file +exec "$@" From a50ee194e0d23520f018bb8f1e30a51882d932a1 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Wed, 6 Apr 2016 21:14:48 +0200 Subject: [PATCH 16/20] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6204bc1..03ef08d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ PHP Docker Boilerplate Changelog 5.1.0 - UPCOMING ---------------- +- Enabled xdebug by default +- Added exit if solr entrypoint is failing inside 5.0.0 - 2016-03-07 ------------------ From 0926461b77d5a9bd04ef0d1a85c55447302bb6cc Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Wed, 6 Apr 2016 21:18:34 +0200 Subject: [PATCH 17/20] Add flush privileges for mysql on restore Fixed #10 --- bin/restore.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/restore.sh b/bin/restore.sh index de0bc6b..66a08da 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -23,6 +23,7 @@ case "$1" in if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then logMsg "Starting MySQL restore..." bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExec mysql + echo "FLUSH PRIVILEGES;" | dockerExec mysql logMsg "Finished" else errorMsg "MySQL backup file not found" From a00657f1396c52ea53f38949185378871ee30070 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 9 May 2016 21:33:23 +0200 Subject: [PATCH 18/20] Revert "enable phpXdebug by default for dev environment" This reverts commit 74ff48617028c22b41fe45cfc74e602fd0247ed6. Will not work with next Dockerimage files --- etc/application.development.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/application.development.yml b/etc/application.development.yml index 6457b5a..fe2c56b 100644 --- a/etc/application.development.yml +++ b/etc/application.development.yml @@ -5,7 +5,7 @@ PROVISION: install: phpBlackfire: false - phpXdebug: true + phpXdebug: false apacheModPagespeed: false service: From 3d58d16a82f6c5965fcb38f156ec46707507d158 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 9 May 2016 21:39:36 +0200 Subject: [PATCH 19/20] Update Changelog --- CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1072ca..f81f7ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,14 @@ PHP Docker Boilerplate Changelog ================================== 5.1.0 - UPCOMING ----------------- -- Enabled xdebug by default -- Added exit if solr entrypoint is failing inside +----------------- + +5.0.2 - 2016-05-09 +------------------ +- Added exit if solr entrypoint is failing inside +- Fix solr storage +- Add `make shell` and `make root` (Makefile targets) +- Refactored backup and restore (solr and mysql, see Makefile) 5.0.1 - 2016-03-08 ------------------ From e171c47ca65ca7c6b9a94db044c4f9e6c8b23e83 Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 9 May 2016 21:43:26 +0200 Subject: [PATCH 20/20] Version bump --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d5dac6..660d33a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dockerized TYPO3 project boilerplate -[![latest v5.0.1](https://img.shields.io/badge/latest-v5.0.1-green.svg?style=flat)](https://github.com/webdevops/TYPO3-docker-boilerplate/releases/tag/5.0.1) +[![latest v5.0.2](https://img.shields.io/badge/latest-v5.0.2-green.svg?style=flat)](https://github.com/webdevops/TYPO3-docker-boilerplate/releases/tag/5.0.2) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/webdevops/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/webdevops/typo3-docker-boilerplate "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/webdevops/typo3-docker-boilerplate.svg)](http://isitmaintained.com/project/webdevops/typo3-docker-boilerplate "Percentage of issues still open")