Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/mariadb #50

Merged
merged 5 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
work_dir=$(echo $0 | awk 'BEGIN{FS="/";ORS="/"}{ for(i=1;i<NF;i++) print $i }')
work_dir=$(cd `dirname $BASH_SOURCE` && pwd)
usage="
Usage: $0
CircleCI needs a primary image with docker-in-docker backend.
To build it use deployment/build.sh script to push to image registry and tag it:
deployment/images/build.sh secondary betothreeprod/cci-mariadb arm64v8-latest
Then you can run composition process: sudo docker-compose up --build"
source ./deploy.sh "$1"
git commit -a -m "$1 arch to push"
sed -e /custom_checkout:/s/"\"\""/"\"\/tmp\/_circleci_local_build_repo\""/g ${work_dir}config.yml | circleci config process - > ${work_dir}config-compat.yml
circleci local execute -c ${work_dir}config-compat.yml || echo -e $usage
[ ! $(which circleci) > /dev/null ] && curl -fLSs https://circle.ci/cli | bash
source ./deploy.sh "$1" --docker
sed -e /custom_checkout:/s/"\"\""/"\"\/tmp\/_circleci_local_build_repo\""/g ${work_dir}/config.yml | circleci config process - > ${work_dir}/config-compat.yml
circleci local execute -c ${work_dir}/config-compat.yml || echo -e $usage
28 changes: 11 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ jobs:
- image: betothreeprod/dind-php7
- image: betothreeprod/mariadb-intel-nuc
environment:
PUID: 1000
PGID: 1000
PUID: 0
PGID: 0
TZ: Europe/Paris
MYSQL_DATABASE: foo_db
MYSQL_ROOT_PASSWORD: foo_pass
MYSQL_USER: dummy_foo
MYSQL_PASSWORD: foo_pass_test
MYSQL_ROOT_PASSWORD: mariadb
MYSQL_HOST: localhost
MYSQL_DATABASE: aria_db
MYSQL_USER: maria
MYSQL_PASSWORD: maria-abc
shell: /bin/bash -leo pipefail
environment:
- BASH_ENV: /etc/profile
- DKR_ARCH: x86_64
- MYSQL_DATABASE: foo_db
- MYSQL_ROOT_PASSWORD: foo_pass
- MYSQL_USER: dummy_foo
- MYSQL_PASSWORD: foo_pass_test
- MYSQL_HOST: 127.0.0.1
- MYSQL_TCP_PORT: 3306
working_directory: /var/www/html/
steps:
- checkout
Expand All @@ -39,13 +38,13 @@ jobs:
apk update \
&& apk add \
php7-session \
mariadb-connector-c \
&& apk del build-base \
&& rm -rf /var/cache/apk/*
- run:
name: Set architecture and Setup Environment Variables
command: |
source ./deploy.sh $DKR_ARCH --nobuild
echo $(cat $DKR_ARCH.env common.env .circleci/$DKR_ARCH.env | awk 'BEGIN{ FS="$"; RS="$" }{ print "export " $1}') >> /etc/profile
- run:
name: Waiting for Mysql to be ready
command: |
Expand All @@ -62,7 +61,7 @@ jobs:
set -x
mkdir -p ./app/build/logs
mkdir -p ~/phpunit
./test-cake.sh --circle -o
source ./test-cake.sh --circle
cat $PHP_CMS_DIR/e13/etc/constantes.properties | grep PASSWORD_ADMIN | head -c 18
when: always
- save_cache:
Expand All @@ -83,10 +82,6 @@ jobs:
environment:
- BASH_ENV: /etc/profile
- DKR_ARCH: x86_64
- MYSQL_DATABASE: foo_db
- MYSQL_ROOT_PASSWORD: foo_pass
- MYSQL_USER: dummy_foo
- MYSQL_PASSWORD: foo_pass_test
steps:
- checkout
- run:
Expand All @@ -101,7 +96,6 @@ jobs:
name: Set architecture and Setup Environment Variables
command: |
source ./deploy.sh $DKR_ARCH --nobuild
echo $(cat $DKR_ARCH.env | awk 'BEGIN{ FS="$"; RS="$" }{ print "export " $1}') >> /etc/profile
- run:
command: |
set -u
Expand Down
13 changes: 0 additions & 13 deletions .circleci/x86_64.env

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ myphpcms*.zip
/tags
*.mo
**/composer*.phar

mysqldb/config/

# IDE and editor specific files #
#################################
Expand Down
60 changes: 23 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,41 @@ os:
- osx
- windows

dist: xenial
dist: trusty

env:
matrix:
- _PHP=latest _PKG=hhvm
- _PHP=7.1 _PKG=php
- _PHP=7.2 _PKG=php
- _PHP=7.3 _PKG=php
- _PHP=latest _PKG=hhvm PHPENV_ROOT=~/.phpenv # developed by facebook, trusty only
- _PHP=7.2 _PKG=php PHPENV_ROOT=~/.phpenv
- _PHP=7.3 _PKG=php PHPENV_ROOT=~/.phpenv

global:
- PHP_CMS_DIR=app/webroot/php_cms
- _SSL=openssl
- DB=Mysql
- PHPUNIT=4
- PHPCS=3
- COLLECT_COVERAGE=false
- PHPENV_ROOT=/usr/local/bin/phpenv
- DKR_ARCH=x86_64
- WEBHOOK_URL=https://discordapp.com/api/webhooks/479745392880386058/YOO7Nnn1IFWUtXX0n0qAZYeMDeV-SLa0lSzjGpNnKGTzG-xA0T3dplVGzSM4ObKLeMWg
- secure: C39DQ1zYpSAOy33Sb8NP89o6k4HUnjHnQ+bQkgbo3WH7WtiN76dGeO9jm1DjMn5np6oKbDi41/fxonaTUIjb9YMksG2YB+NBDYXHyV1H7/xAeC6uTxwUObrLXh8aOUwiiuLPllMdtOLX8JSPxl1Ixc6KyeFywPiMvwuOe4QZW6sVG4sqhZC/UUycYKRSMaOthtuTDPYKjBLaDPiEzkUmdBIo9IhAsidEFAHj4jEmw9gBtac0B2x7GbvvoDivdH3KdNSoPt2SkD0RLX51Qf7AYeAV4fw65cuCp/Aat/uk55x3lN5g18Ww9khY/cFSwPC0JXGQnnJvdcDP2diZNkqE41Yc/Mw3xwfrvp3/v8js3VIBzsGINKiSdXZ/yXqI9iRzvzlfmXRHvd4sFXRzUpi8ZB4PXaboMndbNRoh4PcoRNFtXhyebQCEgZv2x3oiKXw38WT5cga03uMH4E5z5afS3n7NP1tsuiNWd499dJzAkW8OPeLDPqY3a/b5qLeZIK1bo23mvCjPtbm+B2g2QocKcd1oQ+XANCyuT3M/+AIypdMabGOSon2fDKrUUN+SqIX4FcYaHi1sG3qUp23870u9YcT4hK2LCKBcBPkFpxqEZLwdHbJmjHPo6uRyAKOD7r/k1DtIRqkcJ+5BpU4emo6rM9rdh5mWjLtK7vdY8Y/tvP8=
- COLLECT_COVERAGE=false
- PHPENV_ROOT=/usr/local/bin/phpenv
- _SSL=openssl
- PHP_CMS_DIR=app/webroot/php_cms
- DB=Mysql
- PHPUNIT=4
- PHPCS=3
- COLLECT_COVERAGE=false
- DKR_ARCH=x86_64
- WEBHOOK_URL=https://discordapp.com/api/webhooks/479745392880386058/YOO7Nnn1IFWUtXX0n0qAZYeMDeV-SLa0lSzjGpNnKGTzG-xA0T3dplVGzSM4ObKLeMWg
- secure: C39DQ1zYpSAOy33Sb8NP89o6k4HUnjHnQ+bQkgbo3WH7WtiN76dGeO9jm1DjMn5np6oKbDi41/fxonaTUIjb9YMksG2YB+NBDYXHyV1H7/xAeC6uTxwUObrLXh8aOUwiiuLPllMdtOLX8JSPxl1Ixc6KyeFywPiMvwuOe4QZW6sVG4sqhZC/UUycYKRSMaOthtuTDPYKjBLaDPiEzkUmdBIo9IhAsidEFAHj4jEmw9gBtac0B2x7GbvvoDivdH3KdNSoPt2SkD0RLX51Qf7AYeAV4fw65cuCp/Aat/uk55x3lN5g18Ww9khY/cFSwPC0JXGQnnJvdcDP2diZNkqE41Yc/Mw3xwfrvp3/v8js3VIBzsGINKiSdXZ/yXqI9iRzvzlfmXRHvd4sFXRzUpi8ZB4PXaboMndbNRoh4PcoRNFtXhyebQCEgZv2x3oiKXw38WT5cga03uMH4E5z5afS3n7NP1tsuiNWd499dJzAkW8OPeLDPqY3a/b5qLeZIK1bo23mvCjPtbm+B2g2QocKcd1oQ+XANCyuT3M/+AIypdMabGOSon2fDKrUUN+SqIX4FcYaHi1sG3qUp23870u9YcT4hK2LCKBcBPkFpxqEZLwdHbJmjHPo6uRyAKOD7r/k1DtIRqkcJ+5BpU4emo6rM9rdh5mWjLtK7vdY8Y/tvP8=

matrix:
fast_finish: true
#fast_finish: true
exclude:
- os: windows
- os: linux
include:
- os: linux
language: php
php: 7.1
env: _PHP=7.1 _PKG=php PHPENV_ROOT=~/.phpenv
- os: linux
language: php
php: 'hhvm'
env: _PHP=latest _PKG=hhvm PHPENV_ROOT=~/.phpenv
- os: osx
- os: windows
env: _PHP=7.3 _PKG=php _SSL=openssl.light
env: _PHP=7.2 _PKG=php _SSL=openssl.light
- os: windows
env: _PHP=latest _PKG=hhvm _SSL=openssl.light
env: _PHP=7.3 _PKG=php _SSL=openssl.light
allow_failures:
- php: 'hhvm'
- env: _PHP=latest _PKG=hhvm
- env: _PHP=7.3 _PKG=php
- os: windows
- os: linux
- os: osx

addons:
Expand All @@ -68,11 +59,6 @@ addons:
build_command_prepend: ""
build_command: "./test-cake.sh --cov --travis -o .env common.env --docker"
branch_pattern: coverity_scan
apt:
packages:
- php7.0
- php7.0-xml
- hhvm
update: true

services:
Expand All @@ -91,9 +77,9 @@ before_install:
- source ./deploy.sh "${DKR_ARCH}" --nobuild
install:
- cd .travis/TravisCI-OSX-PHP
- if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_SSL}"; /usr/local/opt/openssl/bin/c_rehash; fi
- if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_PKG}" "${_PHP}" "--with-openssl"; fi
- if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then build/handle_${TRAVIS_OS_NAME}_pkg.sh "composer"; bash -c 'composer install --dev --no-interaction'; fi
- build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_SSL}" "latest"; [ $(which c_rehash) > /dev/null ] && c_rehash
- build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_PKG}" "${_PHP}" "--with-openssl"
- build/handle_${TRAVIS_OS_NAME}_pkg.sh "${_PKG}" "${_PHP}-xml"
- cd ../..
- if [[ "${TRAVIS_OS_NAME}" = "linux" ]]; then curl -s http://getcomposer.org/installer | php && php composer.phar install --dev --no-interaction; fi

Expand Down
18 changes: 8 additions & 10 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ARG PRIMARY_HUB
# Primary image is a Linux PHP with Apache 2 server pre-installed
FROM ${PRIMARY_HUB:-betothreeprod/raspberrypi3-php}:${IMG_TAG:-latest}

ENV INITSYSTEM on
ENV UDEV on
ENV INITSYSTEM off
ENV UDEV off
ARG DEBUG
ENV DEBUG ${DEBUG:-0}

Expand All @@ -23,8 +23,6 @@ ARG DATABASE_ENGINE
ENV DATABASE_ENGINE ${DATABASE_ENGINE:-MysqlCms}
ARG DATABASE_SERVICE_NAME
ENV DATABASE_SERVICE_NAME ${DATABASE_SERVICE_NAME:-MYSQL}
ARG MYSQL_ROOT_HOST
ENV MYSQL_ROOT_HOST ${MYSQL_ROOT_HOST:-%}
ARG MYSQL_HOST
ENV MYSQL_HOST ${MYSQL_HOST:-db}
ARG MYSQL_TCP_PORT
Expand All @@ -36,15 +34,15 @@ ENV PHP_CMS_DIR ${PHP_CMS_DIR:-'app/webroot/php_cms'}
ARG DATABASE_USER
ENV DATABASE_USER ${DATABASE_USER:-'root'}
ARG MYSQL_DATABASE
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'foo_db'}
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'aria_db'}
ARG MYSQL_ROOT_PASSWORD
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'foo_pass'}
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'mariadb'}
ARG TEST_DATABASE_NAME
ENV TEST_DATABASE_NAME ${TEST_DATABASE_NAME:-'test'}
ARG MYSQL_USER
ENV MYSQL_USER ${MYSQL_USER:-'dummy_foo'}
ENV MYSQL_USER ${MYSQL_USER:-'maria'}
ARG MYSQL_PASSWORD
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'foo_pass_test'}
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'maria-abc'}
ARG SERVER_NAME
ENV SERVER_NAME ${SERVER_NAME:-'localhost.local'}

Expand Down Expand Up @@ -151,8 +149,8 @@ RUN a2enmod rewrite \
# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
RUN git submodule sync && git submodule update --init
RUN ./configure.sh --openshift -c -h -p pass -s word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
CMD [ "apache2 -D FOREGROUND" ]
18 changes: 8 additions & 10 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ARG PRIMARY_HUB
# Primary image is a Linux PHP with Apache 2 server pre-installed
FROM ${PRIMARY_HUB:-betothreeprod/%%BALENA_MACHINE_NAME%%-php}:${IMG_TAG:-latest}

ENV INITSYSTEM on
ENV UDEV on
ENV INITSYSTEM off
ENV UDEV off
ARG DEBUG
ENV DEBUG ${DEBUG:-0}

Expand All @@ -23,8 +23,6 @@ ARG DATABASE_ENGINE
ENV DATABASE_ENGINE ${DATABASE_ENGINE:-MysqlCms}
ARG DATABASE_SERVICE_NAME
ENV DATABASE_SERVICE_NAME ${DATABASE_SERVICE_NAME:-MYSQL}
ARG MYSQL_ROOT_HOST
ENV MYSQL_ROOT_HOST ${MYSQL_ROOT_HOST:-%}
ARG MYSQL_HOST
ENV MYSQL_HOST ${MYSQL_HOST:-db}
ARG MYSQL_TCP_PORT
Expand All @@ -36,15 +34,15 @@ ENV PHP_CMS_DIR ${PHP_CMS_DIR:-'app/webroot/php_cms'}
ARG DATABASE_USER
ENV DATABASE_USER ${DATABASE_USER:-'root'}
ARG MYSQL_DATABASE
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'foo_db'}
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'aria_db'}
ARG MYSQL_ROOT_PASSWORD
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'foo_pass'}
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'mariadb'}
ARG TEST_DATABASE_NAME
ENV TEST_DATABASE_NAME ${TEST_DATABASE_NAME:-'test'}
ARG MYSQL_USER
ENV MYSQL_USER ${MYSQL_USER:-'dummy_foo'}
ENV MYSQL_USER ${MYSQL_USER:-'maria'}
ARG MYSQL_PASSWORD
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'foo_pass_test'}
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'maria-abc'}
ARG SERVER_NAME
ENV SERVER_NAME ${SERVER_NAME:-'localhost.local'}

Expand Down Expand Up @@ -151,8 +149,8 @@ RUN a2enmod rewrite \
# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
RUN git submodule sync && git submodule update --init
RUN ./configure.sh --openshift -c -h -p pass -s word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
CMD [ "apache2 -D FOREGROUND" ]
18 changes: 8 additions & 10 deletions Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ARG PRIMARY_HUB
# Primary image is a Linux PHP with Apache 2 server pre-installed
FROM ${PRIMARY_HUB:-betothreeprod/intel-nuc-php}:${IMG_TAG:-latest}

ENV INITSYSTEM on
ENV UDEV on
ENV INITSYSTEM off
ENV UDEV off
ARG DEBUG
ENV DEBUG ${DEBUG:-0}

Expand All @@ -23,8 +23,6 @@ ARG DATABASE_ENGINE
ENV DATABASE_ENGINE ${DATABASE_ENGINE:-MysqlCms}
ARG DATABASE_SERVICE_NAME
ENV DATABASE_SERVICE_NAME ${DATABASE_SERVICE_NAME:-MYSQL}
ARG MYSQL_ROOT_HOST
ENV MYSQL_ROOT_HOST ${MYSQL_ROOT_HOST:-%}
ARG MYSQL_HOST
ENV MYSQL_HOST ${MYSQL_HOST:-db}
ARG MYSQL_TCP_PORT
Expand All @@ -36,15 +34,15 @@ ENV PHP_CMS_DIR ${PHP_CMS_DIR:-'app/webroot/php_cms'}
ARG DATABASE_USER
ENV DATABASE_USER ${DATABASE_USER:-'root'}
ARG MYSQL_DATABASE
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'foo_db'}
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'aria_db'}
ARG MYSQL_ROOT_PASSWORD
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'foo_pass'}
ENV MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD:-'mariadb'}
ARG TEST_DATABASE_NAME
ENV TEST_DATABASE_NAME ${TEST_DATABASE_NAME:-'test'}
ARG MYSQL_USER
ENV MYSQL_USER ${MYSQL_USER:-'dummy_foo'}
ENV MYSQL_USER ${MYSQL_USER:-'maria'}
ARG MYSQL_PASSWORD
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'foo_pass_test'}
ENV MYSQL_PASSWORD ${MYSQL_PASSWORD:-'maria-abc'}
ARG SERVER_NAME
ENV SERVER_NAME ${SERVER_NAME:-'localhost.local'}

Expand Down Expand Up @@ -151,8 +149,8 @@ RUN a2enmod rewrite \
# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
RUN git submodule sync && git submodule update --init
RUN ./configure.sh --openshift -c -h -p pass -s word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
CMD [ "apache2 -D FOREGROUND" ]
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ However, if these files exist they will affect the behavior of the build process

 The myphpcms folder includes modules that need to be pulled in order to install locally.
After the first checkout browse to myphpcms folder and do
```git submodule update --init --recursive```
```git submodule sync && 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.

Expand Down Expand Up @@ -261,14 +261,18 @@ PHP mysql extensions must be installed.

Log in with root privileges should work:

mysql -u root --password=<password> cakephp_test
mysql -u root --password=<password>

If not, do a reset of your passwords:

mysqladmin -uroot password

If it isn't possible to login:
+ Check your environment variables (common.env and docker-compose.yml) settings). Use one or the other, and see which works for you:

MYSQL_ROOT_HOST=% (Unix/OSX platforms)
MYSQL_HOST=127.0.0.1 (Unix/OSX platforms)
or if docker mysql service containers:
MYSQL_ROOT_HOST=127.0.0.1
MYSQL_HOST=localhost
..

MYSQL_TCP_PORT=3306
Expand Down
Loading