Skip to content

Commit

Permalink
# This is a combination of 7 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

WIP docker-compose
https://onoblog.com/cakephp2-docker-scratch/

docker-compose --build

prepare env

# This is the commit message #2:

Update site.conf
# This is the commit message #3:

Create docker alias forr docker-compose commadline

# This is the commit message #4:

Docker phpenv version

# The commit message #5 will be skipped:

# version docker-compose

# The commit message #6 will be skipped:

# docker-compose update

# The commit message #7 will be skipped:

# Update install-docker-compose.sh
  • Loading branch information
b23prodtm committed Mar 2, 2019
1 parent 0ffbfcc commit 33ccf5f
Show file tree
Hide file tree
Showing 18 changed files with 404 additions and 80 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ matrix:
include:
- os: linux
language: php
php: '7.0'
env: DB=Mysql _PHP=7.0 _PKG=php PHPENV_ROOT=~/.phpenv
php: '7.1'
env: DB=Mysql _PHP=7.1 _PKG=php PHPENV_ROOT=~/.phpenv
- os: linux
language: php
php: 'hhvm'
Expand Down Expand Up @@ -87,9 +87,9 @@ before_install:
- source .travis/TravisCI-OSX-PHP/build/prepare_${TRAVIS_OS_NAME}_env.sh #; source exports
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "${_PHP}" == 7* ]]; then COLLECT_COVERAGE=true ; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "${COLLECT_COVERAGE}" != "true" ]]; then phpenv config-rm xdebug.ini || true ; fi
- if [ ! -z "${ADDITIONAL_PHP_INI}" ]; then .travis/TravisCI-OSX-PHP/build/custom_php_ini.sh; fi
- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- "./Scripts/configure_tmp.sh"
- if [ ! -z "${ADDITIONAL_PHP_INI}" ]; then cd .travis/TravisCI-OSX-PHP; source build/custom_php_ini.sh; cd ../..; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "${COLLECT_COVERAGE}" != "true" ]]; then echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-; fi
- source ./Scripts/configure_tmp.sh
install:
- if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then .travis/TravisCI-OSX-PHP/build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_PKG}" "${_PHP}" "--with-openssl"; fi
- curl -s http://getcomposer.org/installer | php
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ However, if these files exist they will affect the behavior of the build process
After the first checkout browse to myphpcms folder and do
```git submodule update --init --recursive```
You'll see modules populating the subfolder app/webroot/... If something goes wrong, erase the myphpcms folder and start over.
> After a sucessful ```git checkout```each time, run once ```git submodule update --init --recursive``` to ensure submodules are downloaded from git. Otherwise your build may fail.
* **composer.json**

Expand Down Expand Up @@ -119,7 +120,7 @@ The following additional variables must be set up as server secrets environment,
TEST_DATABASE_PASSWORD:<test-password>
# CakePHP generated
CAKEPHP_SECRET_TOKEN:<secret-token>
CAKEPHP_SECRET_SQLT:<secret-salt>
CAKEPHP_SECRET_SALT:<secret-salt>
CAKEPHP_SECURITY_CIPHER_SEED:<cipher-seed>
# Generated by ./configure.sh -h
GET_HASH_PASSWORD:<hashed-password>
Expand Down
2 changes: 1 addition & 1 deletion Scripts/bootargs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ red="\033[0;31m"
green="\033[0;32m"
orange="\033[0;33m"
cyan="\033[0;36m"
echo -e "Loading ${orange}Test environment${nc} : $0..."
#; To change Model/Datasource/Database
[[ ("${DB}" == "Mysql") || -z $DB ]] && export DB="Mysql" && export DATABASE_ENGINE="MysqlCms" && export DATABASE_SERVICE_NAME="MYSQL"
[ "${DB}" == "Pgsql" ] && export DATABASE_ENGINE="PostgresCms" && export DATABASE_SERVICE_NAME="PGSQL"
Expand Down Expand Up @@ -35,7 +36,6 @@ export TEST_DATABASE_USER="test"
export FTP_SERVICE_HOST="localhost"
export FTP_SERVICE_USER="test"
export FTP_SERVICE_PASSWORD="mypassword"
export PHP_CMS_DIR="./app/webroot/php_cms/"
#; More about default environment app/Config/core.php
#; Openshift Online secure keys (default_keys)
export CAKEPHP_SECURITY_SALT="Word"
Expand Down
26 changes: 11 additions & 15 deletions Scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ set -e
source ./Scripts/lib/shell_prompt.sh
source ./Scripts/lib/parsing.sh
openshift=$(parse_arg_exists "-[oO]*|--openshift" $*)
if [ -z ${PHP_CMS_DIR} ]; then export PHP_CMS_DIR=app/webroot/php_cms; fi
if [ $openshift > /dev/null ]; then
echo "Real environment bootargs..."
export CAKEPHP_DEBUG_LEVEL=1
else
echo "Provided local/test bootargs..."
export CAKEPHP_DEBUG_LEVEL=2
source ./Scripts/bootargs.sh $*
fi
#;
#;
#; this development phase, don't use the same values for production (no setting means no debugger)!
#;
#;
export CAKEPHP_DEBUG_LEVEL=2
#;
#; check if file etc/constantes_local.properties exist (~ ./configure.sh was run once)
#;
if [ ! -f ${PHP_CMS_DIR}/e13/etc/constantes.properties ]; then
Expand All @@ -33,14 +30,13 @@ fi
echo -e "${nc}Password ${green}$GET_HASH_PASSWORD${nc}"
#; Install PHPUnit, performs unit tests
#; The website must pass health checks in order to be deployed
phpunit="./app/Vendor/bin/phpunit"
if [ ! -f $phpunit ]; then
if [ ! -f bin/composer.phar ]; then
source ./Scripts/composer.sh
fi
php bin/composer.phar update --prefer-dist --with-dependencies phpunit/phpunit cakephp/cakephp-codesniffer
else
echo -e "PHPUnit ${green}[OK]${nc}"
if [ $openshift > /dev/null ]; then
phpunit="./app/Vendor/bin/phpunit"
if [ ! -f $phpunit ]; then
source ./Scripts/composer.sh -o phpunit/phpunit cakephp/cakephp-codesniffer
else
echo -e "PHPUnit ${green}[OK]${nc}"
fi
echo `$phpunit --version`
fi
echo `$phpunit --version`
source ./Scripts/config_app_database.sh
3 changes: 2 additions & 1 deletion Scripts/composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#;
#;
#; colorful shell
source ./Scripts/lib/parsing.sh
nc='\033[0m'
red="\033[0;31m"
green="\033[0;32m"
Expand All @@ -22,4 +23,4 @@ else
fi
bin/composer.phar --version
#; update plugins and dependencies
bin/composer.phar update --with-dependencies --apcu-autoloader $*
if [[ $(parse_arg_exists "-[oO]|--openshift" $*) ]]; then bin/composer.phar update --with-dependencies --apcu-autoloader $*; fi
4 changes: 4 additions & 0 deletions Scripts/install-docker-compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
sudo apt-get remove docker-compose
sudo apt-get install python-pip
sudo pip install docker-compose
6 changes: 6 additions & 0 deletions Scripts/lib/locate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
_locate() {
[ $# -lt 1 ] && echo "Usage: $0 <filename>" && return $FALSE
find /usr -name $1 | grep -m 1 $1
}
# export -f _locate
1 change: 1 addition & 0 deletions build/.travis_linux_php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timezone=Europe/Paris
1 change: 1 addition & 0 deletions build/.travis_osx_php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timezone=Europe/Paris
1 change: 1 addition & 0 deletions build/.travis_windows_php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timezone=Europe/Paris
Loading

0 comments on commit 33ccf5f

Please sign in to comment.