-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
254 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
work_dir=$(echo $0 | awk -F'/' 'BEGIN {ORS="/"} {for ( i=0; ++i<NF;) print $i}') | ||
sed -e /custom_checkout:/s/"\"\""/"\"\/tmp\/_circleci_local_build_repo\""/ $work_dir/config.yml | circleci config process - > $work_dir/config-compat.yml | ||
circleci local execute -c $work_dir/config-compat.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: betothreeprod/cci-composer:0.1.6 | ||
- image: betothreeprod/cci-mariadb:10.1.41 | ||
environment: | ||
PUID: 1000 | ||
PGID: 1000 | ||
TZ: Europe/Paris | ||
MYSQL_DATABASE: foo_db | ||
MYSQL_ROOT_PASSWORD: foo_pass | ||
MYSQL_USER: dummy_foo | ||
MYSQL_PASSWORD: foo_pass_test | ||
environment: | ||
- DKR_ARCH: x86_64 | ||
- BALENA_MACHINE_NAME: intel-nuc | ||
- PHP_TAG: 7.2-apache | ||
- PHP_OWNER: amd64 | ||
- DB_TAG: amd64-latest | ||
- DB: Mysql | ||
- DATABASE_ENGINE: MysqlCms | ||
- DATABASE_SERVICE_NAME: MYSQL | ||
- MYSQL_SERVICE_HOST: 127.0.0.1 | ||
- MYSQL_SERVICE_PORT: 3306 | ||
- TEST_MYSQL_SERVICE_HOST: 127.0.0.1 | ||
- TEST_MYSQL_SERVICE_PORT: 3306 | ||
- DATABASE_USER: root | ||
- DATABASE_NAME: foo_db | ||
- DATABASE_PASSWORD: foo_pass | ||
- TEST_DATABASE_NAME: foo_db_test | ||
- TEST_DATABASE_USER: dummy_foo | ||
- TEST_DATABASE_PASSWORD: foo_pass_test | ||
- SERVER_NAME: local | ||
- PHP_CMS_DIR: app/webroot/php_cms | ||
- GET_HASH_PASSWORD: saQlojmPPqVyU | ||
working_directory: /var/www/html/ | ||
steps: | ||
- run: | ||
command: mkdir -p $CIRCLE_WORKING_DIRECTORY && cd /tmp/_circleci_local_build_repo | ||
&& git ls-files | tar -T - -c | tar -x -C $CIRCLE_WORKING_DIRECTORY && cp | ||
-a /tmp/_circleci_local_build_repo/.git $CIRCLE_WORKING_DIRECTORY | ||
- run: | ||
command: git submodule sync | ||
- run: | ||
command: git submodule update --init --recursive | ||
- run: | ||
name: Waiting for Mysql to be ready | ||
command: | | ||
set -x | ||
for i in `seq 1 10`; | ||
do | ||
nc -z $TEST_MYSQL_SERVICE_HOST $TEST_MYSQL_SERVICE_PORT && echo Success && exit 0 | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo Failed waiting for Mysql | ||
&& exit 1 | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "composer.lock" }} | ||
- v1-dependencies- | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
command: composer install -n --prefer-dist | ||
- save_cache: | ||
key: v1-dependencies-{{ checksum "composer.lock" }} | ||
paths: | ||
- ./app/Vendor/ | ||
- run: | ||
command: | | ||
set -x | ||
mkdir -p ./app/build/logs | ||
mkdir -p ~/phpunit | ||
./test-cake.sh --circle --openshift | ||
when: always | ||
- run: | ||
command: | | ||
set -x | ||
TAG=0.1.$CIRCLE_BUILD_NUM | ||
./Scripts/docker-compose-alias.sh --openshift -v up -d --build | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
docker push $DOCKER_USER/myphpcms:$TAG | ||
- store_test_results: | ||
path: ~/phpunit | ||
- store_artifacts: | ||
path: ~/phpunit | ||
workflows: | ||
build-and-compose: | ||
jobs: | ||
- build | ||
version: 2 | ||
|
||
# Original config.yml file: | ||
# # PHP CircleCI 2.0 configuration file | ||
# # | ||
# # Check https://circleci.com/docs/2.0/language-php/ for more details | ||
# # | ||
# version: 2.1 | ||
# jobs: | ||
# build: | ||
# docker: | ||
# # using custom image, see .circleci/images/primary/Dockerfile | ||
# - image: betothreeprod/cci-composer:0.1.6 | ||
# - image: betothreeprod/cci-mariadb:10.1.41 | ||
# #- image: linuxserver/mariadb:amd64-latest | ||
# environment: | ||
# PUID: 1000 | ||
# PGID: 1000 | ||
# TZ: Europe/Paris | ||
# MYSQL_DATABASE: foo_db | ||
# MYSQL_ROOT_PASSWORD: foo_pass | ||
# MYSQL_USER: dummy_foo | ||
# MYSQL_PASSWORD: foo_pass_test | ||
# environment: | ||
# DKR_ARCH: x86_64 | ||
# BALENA_MACHINE_NAME: intel-nuc | ||
# PHP_TAG: 7.2-apache | ||
# PHP_OWNER: amd64 | ||
# DB_TAG: amd64-latest | ||
# DB: Mysql | ||
# DATABASE_ENGINE: MysqlCms | ||
# DATABASE_SERVICE_NAME: MYSQL | ||
# MYSQL_SERVICE_HOST: 127.0.0.1 | ||
# MYSQL_SERVICE_PORT: 3306 | ||
# TEST_MYSQL_SERVICE_HOST: 127.0.0.1 | ||
# TEST_MYSQL_SERVICE_PORT: 3306 | ||
# DATABASE_USER: root | ||
# DATABASE_NAME: foo_db | ||
# DATABASE_PASSWORD: foo_pass | ||
# TEST_DATABASE_NAME: foo_db_test | ||
# TEST_DATABASE_USER: dummy_foo | ||
# TEST_DATABASE_PASSWORD: foo_pass_test | ||
# SERVER_NAME: local | ||
# PHP_CMS_DIR: app/webroot/php_cms | ||
# GET_HASH_PASSWORD: saQlojmPPqVyU | ||
# working_directory: /var/www/html/ | ||
# parameters: | ||
# custom_checkout: | ||
# description: use custom local checkout fix in CLI | ||
# type: string | ||
# default: \"\" | ||
# steps: | ||
# - when: | ||
# condition: << parameters.custom_checkout >> | ||
# steps: | ||
# - run: mkdir -p $CIRCLE_WORKING_DIRECTORY && cd << parameters.custom_checkout >> && git ls-files | tar -T - -c | tar -x -C $CIRCLE_WORKING_DIRECTORY && cp -a << parameters.custom_checkout >>/.git $CIRCLE_WORKING_DIRECTORY | ||
# - unless: | ||
# condition: <<parameters.custom_checkout>> | ||
# steps: | ||
# - checkout | ||
# - run: git submodule sync | ||
# - run: git submodule update --init --recursive | ||
# - run: | ||
# name: Waiting for Mysql to be ready | ||
# command: | | ||
# set -x | ||
# for i in `seq 1 10`; | ||
# do | ||
# nc -z $TEST_MYSQL_SERVICE_HOST $TEST_MYSQL_SERVICE_PORT && echo Success && exit 0 | ||
# echo -n . | ||
# sleep 1 | ||
# done | ||
# echo Failed waiting for Mysql | ||
# && exit 1 | ||
# # Download and cache dependencies | ||
# - restore_cache: | ||
# keys: | ||
# # \"composer.lock\" can be used if it is committed to the repo | ||
# - v1-dependencies-{{ checksum \"composer.lock\" }} | ||
# # fallback to using the latest cache if no exact match is found | ||
# - v1-dependencies- | ||
# | ||
# - setup_remote_docker: # (2) | ||
# docker_layer_caching: true # (3) | ||
# - run: composer install -n --prefer-dist | ||
# - save_cache: | ||
# key: v1-dependencies-{{ checksum \"composer.lock\" }} | ||
# paths: | ||
# - ./app/Vendor/ | ||
# # PHPUnit tests | ||
# - run: | ||
# command: | | ||
# set -x | ||
# mkdir -p ./app/build/logs | ||
# mkdir -p ~/phpunit | ||
# ./test-cake.sh --circle --openshift | ||
# when: always | ||
# # use a primary image that already has Docker (recommended) | ||
# # build and push Docker image | ||
# # (4) | ||
# - run: | | ||
# set -x | ||
# TAG=0.1.$CIRCLE_BUILD_NUM | ||
# ./Scripts/docker-compose-alias.sh --openshift -v up -d --build | ||
# docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
# docker push $DOCKER_USER/myphpcms:$TAG | ||
# - store_test_results: | ||
# path: ~/phpunit | ||
# - store_artifacts: | ||
# path: ~/phpunit | ||
# workflows: | ||
# build-and-compose: | ||
# jobs: | ||
# - build: | ||
# custom_checkout: \"/tmp/_circleci_local_build_repo\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters