From 1a31bd90b2fa3cb703447eb1904b8aa5fb891a9d Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 14 Dec 2021 12:31:48 -0800 Subject: [PATCH 01/71] Build with private packages --- .env | 20 ++++++++++++- .gitignore | 3 +- Dockerfile | 31 +++++++++++-------- Dockerfile.base | 14 +++------ build-files/Dockerfile.app | 10 +++++++ build-files/app-init.sh | 6 ++++ build-files/init.sh | 55 ---------------------------------- build-files/install-and-run.sh | 10 +++++++ build-files/services.conf | 1 + docker-compose.yml | 43 ++++++++++++++++++-------- 10 files changed, 101 insertions(+), 92 deletions(-) create mode 100644 build-files/Dockerfile.app create mode 100644 build-files/app-init.sh delete mode 100644 build-files/init.sh create mode 100644 build-files/install-and-run.sh diff --git a/.env b/.env index 0c8c7f5..a3bebb4 100644 --- a/.env +++ b/.env @@ -1,5 +1,23 @@ -PM_VERSION=4.1.21 +PM_VERSION=local +CODEBASE_PATH=/code/pm4 +PACKAGES_PATH=/code/pm4-packages +PM_CI=true PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 PM_DOCKER_SOCK=/var/run/docker.sock +PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker +PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying +LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost +SESSION_SECURE_COOKIE=false +CACHE_DRIVER=redis +SESSION_DOMAIN=null +GOOGLE_API_TOKEN=test +SLACK_OAUTH_ACCESS_TOKEN=test +DB_HOSTNAME=mysql +DB_PORT=3306 +DB_USERNAME=root +DB_PASSWORD=password +DB_DATABASE="processmaker" +REDIS_HOST=redis +HOST_CACHE_PATH=./cache \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6a01034..abc40b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -bind-mount/composer/cache -bind-mount/npm \ No newline at end of file +pmrepo \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 999dac4..7b63322 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,23 @@ -FROM processmaker/pm4-base:1.0.0 +FROM pm4-base:local AS build -ARG PM_VERSION +# RUN wget https://github.com/runyan-co/pm/archive/refs/heads/master.zip +# RUN unzip master.zip +# TMP HERE +COPY pmrepo/pm /tmp/pm-master +RUN rm -rf /tmp/pm-master/.env -WORKDIR /tmp -RUN wget https://github.com/ProcessMaker/processmaker/archive/refs/tags/v${PM_VERSION}.zip -RUN unzip v${PM_VERSION}.zip && rm -rf /code/pm4 && mv processmaker-${PM_VERSION} /code/pm4 +RUN composer global config repositories.pm4-tools path /tmp/pm-master +RUN composer global require runyan-co/pm +RUN ln -s /root/.config/composer/vendor/bin/pm /bin/pm -WORKDIR /code/pm4 -RUN composer install -COPY build-files/laravel-echo-server.json . -RUN npm install --unsafe-perm=true && npm run dev +RUN mkdir -p /code/pm4-packages +RUN mkdir -p /code/pm4 -COPY build-files/laravel-echo-server.json . -COPY build-files/init.sh . -CMD bash init.sh && supervisord --nodaemon +RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini + +ENV CACHE_PATH=/root/.cache + +WORKDIR /code +COPY ./build-files /code/build-files + +CMD bash build-files/install-and-run.sh diff --git a/Dockerfile.base b/Dockerfile.base index cfe43b7..c5323c1 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -5,14 +5,16 @@ ENV TZ="America/Los_Angeles" RUN apt update # In ubuntu 20.04, installing php without specifying a version installs 7.4 :) -RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 \ -nginx vim curl unzip wget supervisor cron mysql-client build-essential +RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 php-imap \ +nginx vim curl git unzip wget supervisor cron mysql-client build-essential rsync \ +libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb # # node # RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - RUN apt -y install nodejs +RUN npm config set cache /root/.cache/npm --global # # install composer @@ -46,12 +48,4 @@ RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf # COPY build-files/nginx.conf /etc/nginx/nginx.conf -# -# supervisord -# -COPY build-files/services.conf /etc/supervisor/conf.d/services.conf - - -RUN mkdir -p /code/pm4 -WORKDIR /code/pm4 EXPOSE 80 443 6001 \ No newline at end of file diff --git a/build-files/Dockerfile.app b/build-files/Dockerfile.app new file mode 100644 index 0000000..056da95 --- /dev/null +++ b/build-files/Dockerfile.app @@ -0,0 +1,10 @@ +FROM pm4-base:local AS build + +COPY ./pm4 /code/pm4 +COPY ./pm4-packages /code/pm4-packages +COPY ./build-files/services.conf /etc/supervisor/conf.d/services.conf +COPY ./build-files/laravel-echo-server.json /code/pm4/laravel-echo-server.json +COPY ./build-files/app-init.sh /code/app-init.sh + +WORKDIR /code +CMD bash app-init.sh && supervisord --nodaemon \ No newline at end of file diff --git a/build-files/app-init.sh b/build-files/app-init.sh new file mode 100644 index 0000000..0436865 --- /dev/null +++ b/build-files/app-init.sh @@ -0,0 +1,6 @@ +set -ex + +echo "alias db=\"mysql -h $DB_HOSTNAME -P $DB_PORT -p${DB_PASSWORD} ${DB_DATABASE}\"" >> ~/.bashrc +echo "alias art=\"php artisan\"" >> ~/.bashrc +echo "alias t=\"php artisan tinker\"" >> ~/.bashrc +echo "alias phpunit=\"vendor/bin/phpunit\"" >> ~/.bashrc \ No newline at end of file diff --git a/build-files/init.sh b/build-files/init.sh deleted file mode 100644 index 4c6b682..0000000 --- a/build-files/init.sh +++ /dev/null @@ -1,55 +0,0 @@ -set -ex - -# # Wait for mysql to bec available -# while ! mysqladmin ping -u pm -ppass -h mysql --silent; do -# echo "Waiting for mysql" -# sleep 1 -# done - -# # Check if database has been initialized -# NUM_TABLES=$(mysql -u pm -p'pass' -h mysql -N -B -e 'show tables;' processmaker | wc -l) - -# if [ $NUM_TABLES -eq 0 ]; then -# mysql -u pm -p'pass' -h mysql processmaker < mysqldump.sql -# fi - -if [ ! -f ".env" ]; then - - while ! mysqladmin ping -u pm -ppass -h mysql --silent; do - echo "Waiting for mysql" - sleep 1 - done - - if [ "${PM_APP_PORT}" = "80" ]; then - PORT_WITH_PREFIX="" - else - PORT_WITH_PREFIX=":${PM_APP_PORT}" - fi - - php artisan processmaker:install --no-interaction \ - --url=${PM_APP_URL}${PORT_WITH_PREFIX} \ - --broadcast-host=${PM_APP_URL}:${PM_BROADCASTER_PORT} \ - --username=admin \ - --password=admin123 \ - --email=admin@processmaker.com \ - --first-name=Admin \ - --last-name=User \ - --db-host=mysql \ - --db-port=3306 \ - --db-name=processmaker \ - --db-username=pm \ - --db-password=pass \ - --data-driver=mysql \ - --data-host=mysql \ - --data-port=3306 \ - --data-name=processmaker \ - --data-username=pm \ - --data-password=pass \ - --redis-host=redis - - - echo "PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker" >> .env - echo "PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying" >> .env - echo "LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost" >> .env - echo "SESSION_SECURE_COOKIE=false" >> .env -fi diff --git a/build-files/install-and-run.sh b/build-files/install-and-run.sh new file mode 100644 index 0000000..ce35db5 --- /dev/null +++ b/build-files/install-and-run.sh @@ -0,0 +1,10 @@ +export COMPOSER_AUTH="{\"github-oauth\": {\"github.com\": \"$GITHUB_TOKEN\"}}" + +while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT --silent; do + echo "Waiting for mysql" + sleep 1 +done + +/bin/pm install-packages-ci + +docker build -t pm4-app:$PM_VERSION -f build-files/Dockerfile.app . \ No newline at end of file diff --git a/build-files/services.conf b/build-files/services.conf index 5445350..370770f 100644 --- a/build-files/services.conf +++ b/build-files/services.conf @@ -15,6 +15,7 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +autorestart=true [program:laravel-echo-server] directory=/code/pm4 diff --git a/docker-compose.yml b/docker-compose.yml index 8127f6d..a6f0c31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,35 +1,54 @@ version: "3.8" services: - web: - image: processmaker/pm4-core:${PM_VERSION} + builder: + build: . + env_file: + - .env + volumes: + - ${PM_DOCKER_SOCK}:/var/run/docker.sock + # - storage:/code/pm4/storage + - ${HOST_CACHE_PATH}:/root/.cache + links: + - redis + - mysql + depends_on: + - mysql + - redis + app: + image: pm4-app:${PM_VERSION} ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 - environment: - - PM_APP_URL - - PM_APP_PORT - - PM_BROADCASTER_PORT - volumes: - - ${PM_DOCKER_SOCK}:/var/run/docker.sock - - storage:/code/pm4/storage + env_file: + - .env links: - redis - mysql depends_on: - mysql - redis + volumes: + - ${PM_DOCKER_SOCK}:/var/run/docker.sock + - ${HOST_CACHE_PATH}:/root/.cache + base: + image: pm4-base:local + build: + context: . + dockerfile: Dockerfile.base + redis: image: redis + volumes: + - redis:/data mysql: image: mysql:5.7 restart: always environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: processmaker - MYSQL_USER: pm - MYSQL_PASSWORD: pass volumes: - database:/var/lib/mysql volumes: database: - storage: \ No newline at end of file + # storage: + redis: \ No newline at end of file From 4f4e75bd28d62add374578e0272db4cf9a23be7f Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 14 Dec 2021 14:36:12 -0800 Subject: [PATCH 02/71] Pass github token --- .env | 2 +- .gitignore | 4 +++- Dockerfile | 16 +++++++--------- docker-compose.yml | 2 ++ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.env b/.env index a3bebb4..7c03e04 100644 --- a/.env +++ b/.env @@ -20,4 +20,4 @@ DB_USERNAME=root DB_PASSWORD=password DB_DATABASE="processmaker" REDIS_HOST=redis -HOST_CACHE_PATH=./cache \ No newline at end of file +HOST_CACHE_PATH="./cache" \ No newline at end of file diff --git a/.gitignore b/.gitignore index abc40b5..bf36004 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -pmrepo \ No newline at end of file +pmrepo +cache +pm4-tools diff --git a/Dockerfile b/Dockerfile index 7b63322..c879b01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,14 @@ FROM pm4-base:local AS build -# RUN wget https://github.com/runyan-co/pm/archive/refs/heads/master.zip -# RUN unzip master.zip -# TMP HERE -COPY pmrepo/pm /tmp/pm-master -RUN rm -rf /tmp/pm-master/.env - -RUN composer global config repositories.pm4-tools path /tmp/pm-master -RUN composer global require runyan-co/pm +COPY ./pm4-tools /tmp/pm4-tools +WORKDIR /tmp/pm4-tools +RUN composer install +RUN composer global config repositories.pm4-tools path /tmp/pm4-tools +RUN composer global require processmaker/pm4-tools RUN ln -s /root/.config/composer/vendor/bin/pm /bin/pm +WORKDIR /code + RUN mkdir -p /code/pm4-packages RUN mkdir -p /code/pm4 @@ -17,7 +16,6 @@ RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini ENV CACHE_PATH=/root/.cache -WORKDIR /code COPY ./build-files /code/build-files CMD bash build-files/install-and-run.sh diff --git a/docker-compose.yml b/docker-compose.yml index a6f0c31..628fe05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: build: . env_file: - .env + environment: + - GITHUB_TOKEN volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock # - storage:/code/pm4/storage From 908c467bb54f8ea205ded14244da25403db44ba6 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 14 Dec 2021 17:49:35 -0800 Subject: [PATCH 03/71] Set up runner --- Dockerfile | 4 ++-- Dockerfile.runner | 6 ++++++ build-files/install-and-run.sh | 2 +- build-files/runner-init.sh | 11 +++++++++++ docker-compose.yml | 16 +++++++++++++--- 5 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 Dockerfile.runner create mode 100644 build-files/runner-init.sh diff --git a/Dockerfile b/Dockerfile index c879b01..ce27367 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN ln -s /root/.config/composer/vendor/bin/pm /bin/pm WORKDIR /code -RUN mkdir -p /code/pm4-packages -RUN mkdir -p /code/pm4 +# RUN mkdir -p /code/pm4-packages +# RUN mkdir -p /code/pm4 RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini diff --git a/Dockerfile.runner b/Dockerfile.runner new file mode 100644 index 0000000..eb302ae --- /dev/null +++ b/Dockerfile.runner @@ -0,0 +1,6 @@ +FROM pm4-base:local AS build + +COPY ./build-files /code/build-files + +WORKDIR /code +CMD bash build-files/runner-init.sh \ No newline at end of file diff --git a/build-files/install-and-run.sh b/build-files/install-and-run.sh index ce35db5..87b4abf 100644 --- a/build-files/install-and-run.sh +++ b/build-files/install-and-run.sh @@ -7,4 +7,4 @@ done /bin/pm install-packages-ci -docker build -t pm4-app:$PM_VERSION -f build-files/Dockerfile.app . \ No newline at end of file +touch /code/pm4/done.txt \ No newline at end of file diff --git a/build-files/runner-init.sh b/build-files/runner-init.sh new file mode 100644 index 0000000..e9885bb --- /dev/null +++ b/build-files/runner-init.sh @@ -0,0 +1,11 @@ +set -x + +ls -la /code/pm4 + +while [ ! -f /code/pm4/done.txt ] +do + sleep 2 +done + +cd /code/pm4 +POPULATE_DATABASE=0 ./vendor/bin/phpunit \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 628fe05..cfb66ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,14 +10,19 @@ services: - ${PM_DOCKER_SOCK}:/var/run/docker.sock # - storage:/code/pm4/storage - ${HOST_CACHE_PATH}:/root/.cache + - pm4:/code/pm4 + - pm4-packages:/code/pm4-packages links: - redis - mysql depends_on: - mysql - redis - app: - image: pm4-app:${PM_VERSION} + runner: + image: pm4-runner:local + build: + context: . + dockerfile: Dockerfile.runner ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 @@ -29,9 +34,12 @@ services: depends_on: - mysql - redis + - builder volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - ${HOST_CACHE_PATH}:/root/.cache + - pm4:/code/pm4 + - pm4-packages:/code/pm4-packages base: image: pm4-base:local build: @@ -53,4 +61,6 @@ services: volumes: database: # storage: - redis: \ No newline at end of file + redis: + pm4: + pm4-packages: \ No newline at end of file From e7c77854b17610423f05252568990009f0adf52e Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 14 Dec 2021 18:25:11 -0800 Subject: [PATCH 04/71] Set cache dir --- .env | 2 +- build-files/runner-init.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 7c03e04..d2d7009 100644 --- a/.env +++ b/.env @@ -20,4 +20,4 @@ DB_USERNAME=root DB_PASSWORD=password DB_DATABASE="processmaker" REDIS_HOST=redis -HOST_CACHE_PATH="./cache" \ No newline at end of file +HOST_CACHE_PATH="/home/runner/cache" \ No newline at end of file diff --git a/build-files/runner-init.sh b/build-files/runner-init.sh index e9885bb..ec5d822 100644 --- a/build-files/runner-init.sh +++ b/build-files/runner-init.sh @@ -1,4 +1,4 @@ -set -x +set -e ls -la /code/pm4 From 5ffa86c4277f57c5ef8948d89b94fc9263233e7a Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 14 Dec 2021 19:00:43 -0800 Subject: [PATCH 05/71] Keep container running --- .env | 2 +- build-files/install-and-run.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env b/.env index d2d7009..90f7a62 100644 --- a/.env +++ b/.env @@ -20,4 +20,4 @@ DB_USERNAME=root DB_PASSWORD=password DB_DATABASE="processmaker" REDIS_HOST=redis -HOST_CACHE_PATH="/home/runner/cache" \ No newline at end of file +HOST_CACHE_PATH="/home/runner/cache" diff --git a/build-files/install-and-run.sh b/build-files/install-and-run.sh index 87b4abf..39c2ca4 100644 --- a/build-files/install-and-run.sh +++ b/build-files/install-and-run.sh @@ -7,4 +7,6 @@ done /bin/pm install-packages-ci -touch /code/pm4/done.txt \ No newline at end of file +touch /code/pm4/done.txt + +tail -f /dev/null \ No newline at end of file From 3b35a983d9528ecc409143b5d03f0a270ffc00ae Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 15 Dec 2021 09:59:52 -0800 Subject: [PATCH 06/71] Remove env from test, it was overriding phpunit.xml --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cfb66ca..4852f70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,6 @@ services: ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 - env_file: - - .env links: - redis - mysql From 28188632e94736b548f0e67d710a765ccee0f900 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 15 Dec 2021 12:38:50 -0800 Subject: [PATCH 07/71] Add github context --- build-files/runner-init.sh | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build-files/runner-init.sh b/build-files/runner-init.sh index ec5d822..46de866 100644 --- a/build-files/runner-init.sh +++ b/build-files/runner-init.sh @@ -8,4 +8,4 @@ do done cd /code/pm4 -POPULATE_DATABASE=0 ./vendor/bin/phpunit \ No newline at end of file +./vendor/bin/phpunit --testdox \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4852f70..58b339e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: - .env environment: - GITHUB_TOKEN + - GITHUB_CONTEXT volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock # - storage:/code/pm4/storage From ff2cf961e41097fec32ca99cc1f1983e0800862b Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 16 Dec 2021 12:41:13 -0800 Subject: [PATCH 08/71] Add phpunit arg and rename init file --- Dockerfile | 2 +- build-files/Dockerfile.app | 10 ---------- build-files/app-init.sh | 6 ------ build-files/{install-and-run.sh => builder-init.sh} | 0 build-files/runner-init.sh | 5 ++--- docker-compose.yml | 2 ++ 6 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 build-files/Dockerfile.app delete mode 100644 build-files/app-init.sh rename build-files/{install-and-run.sh => builder-init.sh} (100%) diff --git a/Dockerfile b/Dockerfile index ce27367..38071fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ ENV CACHE_PATH=/root/.cache COPY ./build-files /code/build-files -CMD bash build-files/install-and-run.sh +CMD bash build-files/builder-init.sh diff --git a/build-files/Dockerfile.app b/build-files/Dockerfile.app deleted file mode 100644 index 056da95..0000000 --- a/build-files/Dockerfile.app +++ /dev/null @@ -1,10 +0,0 @@ -FROM pm4-base:local AS build - -COPY ./pm4 /code/pm4 -COPY ./pm4-packages /code/pm4-packages -COPY ./build-files/services.conf /etc/supervisor/conf.d/services.conf -COPY ./build-files/laravel-echo-server.json /code/pm4/laravel-echo-server.json -COPY ./build-files/app-init.sh /code/app-init.sh - -WORKDIR /code -CMD bash app-init.sh && supervisord --nodaemon \ No newline at end of file diff --git a/build-files/app-init.sh b/build-files/app-init.sh deleted file mode 100644 index 0436865..0000000 --- a/build-files/app-init.sh +++ /dev/null @@ -1,6 +0,0 @@ -set -ex - -echo "alias db=\"mysql -h $DB_HOSTNAME -P $DB_PORT -p${DB_PASSWORD} ${DB_DATABASE}\"" >> ~/.bashrc -echo "alias art=\"php artisan\"" >> ~/.bashrc -echo "alias t=\"php artisan tinker\"" >> ~/.bashrc -echo "alias phpunit=\"vendor/bin/phpunit\"" >> ~/.bashrc \ No newline at end of file diff --git a/build-files/install-and-run.sh b/build-files/builder-init.sh similarity index 100% rename from build-files/install-and-run.sh rename to build-files/builder-init.sh diff --git a/build-files/runner-init.sh b/build-files/runner-init.sh index 46de866..5f32422 100644 --- a/build-files/runner-init.sh +++ b/build-files/runner-init.sh @@ -1,11 +1,10 @@ set -e -ls -la /code/pm4 - while [ ! -f /code/pm4/done.txt ] do sleep 2 done cd /code/pm4 -./vendor/bin/phpunit --testdox \ No newline at end of file +echo "Running './vendor/bin/phpunit${PHPUNIT_ARGS}'" +./vendor/bin/phpunit${PHPUNIT_ARGS} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 58b339e..d5ebec3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,8 @@ services: - ${HOST_CACHE_PATH}:/root/.cache - pm4:/code/pm4 - pm4-packages:/code/pm4-packages + environment: + - PHPUNIT_ARGS base: image: pm4-base:local build: From 12bff0386f2b1c8bdf4dd79d28f33efcf8bf5a17 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 16 Dec 2021 13:34:45 -0800 Subject: [PATCH 09/71] Update dockerfile base --- Dockerfile | 14 +------------- Dockerfile.base | 15 ++++++++++----- Dockerfile.runner | 2 +- build-files/builder-init.sh | 4 +++- docker-compose.yml | 4 +--- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38071fb..3405a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,7 @@ -FROM pm4-base:local AS build - -COPY ./pm4-tools /tmp/pm4-tools -WORKDIR /tmp/pm4-tools -RUN composer install -RUN composer global config repositories.pm4-tools path /tmp/pm4-tools -RUN composer global require processmaker/pm4-tools -RUN ln -s /root/.config/composer/vendor/bin/pm /bin/pm +FROM processmaker/pm4-base:2.0.0 AS build WORKDIR /code -# RUN mkdir -p /code/pm4-packages -# RUN mkdir -p /code/pm4 - -RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini - ENV CACHE_PATH=/root/.cache COPY ./build-files /code/build-files diff --git a/Dockerfile.base b/Dockerfile.base index c5323c1..2a18906 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -6,8 +6,10 @@ RUN apt update # In ubuntu 20.04, installing php without specifying a version installs 7.4 :) RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 php-imap \ -nginx vim curl git unzip wget supervisor cron mysql-client build-essential rsync \ -libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb +vim curl git unzip wget mysql-client build-essential rsync + +# supervisor nginx cron +# libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb # # node @@ -26,8 +28,8 @@ RUN composer self-update # # cron # -COPY build-files/laravel-cron /etc/cron.d/laravel-cron -RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron +# COPY build-files/laravel-cron /etc/cron.d/laravel-cron +# RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron # # docker client @@ -46,6 +48,9 @@ RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf # # nginx # -COPY build-files/nginx.conf /etc/nginx/nginx.conf +# COPY build-files/nginx.conf /etc/nginx/nginx.conf + +# populate $_ENV with environment variables +RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini EXPOSE 80 443 6001 \ No newline at end of file diff --git a/Dockerfile.runner b/Dockerfile.runner index eb302ae..e0c1631 100644 --- a/Dockerfile.runner +++ b/Dockerfile.runner @@ -1,4 +1,4 @@ -FROM pm4-base:local AS build +FROM processmaker/pm4-base:2.0.0 AS build COPY ./build-files /code/build-files diff --git a/build-files/builder-init.sh b/build-files/builder-init.sh index 39c2ca4..1f936aa 100644 --- a/build-files/builder-init.sh +++ b/build-files/builder-init.sh @@ -5,7 +5,9 @@ while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_ sleep 1 done -/bin/pm install-packages-ci +composer global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git +composer global require processmaker/pm4-tools:dev-master +pm install-packages-ci touch /code/pm4/done.txt diff --git a/docker-compose.yml b/docker-compose.yml index d5ebec3..18bdd36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,6 @@ services: - GITHUB_CONTEXT volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - # - storage:/code/pm4/storage - ${HOST_CACHE_PATH}:/root/.cache - pm4:/code/pm4 - pm4-packages:/code/pm4-packages @@ -42,7 +41,7 @@ services: environment: - PHPUNIT_ARGS base: - image: pm4-base:local + image: processmaker/pm4-base:2.0.0 build: context: . dockerfile: Dockerfile.base @@ -61,7 +60,6 @@ services: - database:/var/lib/mysql volumes: database: - # storage: redis: pm4: pm4-packages: \ No newline at end of file From d9962ef85968df1836ae9bff99c45d2b74ae161b Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 16 Dec 2021 14:18:25 -0800 Subject: [PATCH 10/71] Specify path --- build-files/builder-init.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-files/builder-init.sh b/build-files/builder-init.sh index 1f936aa..5ef325f 100644 --- a/build-files/builder-init.sh +++ b/build-files/builder-init.sh @@ -7,7 +7,8 @@ done composer global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git composer global require processmaker/pm4-tools:dev-master -pm install-packages-ci + +/root/.config/composer/vendor/bin install-packages-ci touch /code/pm4/done.txt From 36d64768d22738dbd63dc7391849c9fec0c1eda9 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 16 Dec 2021 14:25:58 -0800 Subject: [PATCH 11/71] Update builder-init.sh --- build-files/builder-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-files/builder-init.sh b/build-files/builder-init.sh index 5ef325f..2f43630 100644 --- a/build-files/builder-init.sh +++ b/build-files/builder-init.sh @@ -8,7 +8,7 @@ done composer global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git composer global require processmaker/pm4-tools:dev-master -/root/.config/composer/vendor/bin install-packages-ci +/root/.config/composer/vendor/bin/pm install-packages-ci touch /code/pm4/done.txt From f78b0ec32e2973d121c5366a2f3b3fa026710e5a Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 15:52:29 -0800 Subject: [PATCH 12/71] Build and test updates --- .env | 8 ++++- Dockerfile.app-base | 60 ++++++++++++++++++++++++++++++++ Dockerfile.base | 61 ++++++--------------------------- Dockerfile.build | 34 ++++++++++++++++++ build-files/builder-init.sh | 15 -------- build-files/install-and-test.sh | 13 +++++++ build-files/runner-init.sh | 10 ------ docker-compose.yml | 57 ++++++++++-------------------- 8 files changed, 144 insertions(+), 114 deletions(-) create mode 100644 Dockerfile.app-base create mode 100644 Dockerfile.build delete mode 100644 build-files/builder-init.sh create mode 100644 build-files/install-and-test.sh delete mode 100644 build-files/runner-init.sh diff --git a/.env b/.env index 90f7a62..b10ecd6 100644 --- a/.env +++ b/.env @@ -10,7 +10,7 @@ PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost SESSION_SECURE_COOKIE=false -CACHE_DRIVER=redis +CACHE_DRIVER=array SESSION_DOMAIN=null GOOGLE_API_TOKEN=test SLACK_OAUTH_ACCESS_TOKEN=test @@ -20,4 +20,10 @@ DB_USERNAME=root DB_PASSWORD=password DB_DATABASE="processmaker" REDIS_HOST=redis +CACHE_PATH="/pm4-cache" HOST_CACHE_PATH="/home/runner/cache" +TELESCOPE_ENABLED=false + +COMPOSER_MIRROR_PATH_REPOS=1 +PARALLEL_TEST_PROCESSES=6 +# vendor/bin/paratest -p 6 \ No newline at end of file diff --git a/Dockerfile.app-base b/Dockerfile.app-base new file mode 100644 index 0000000..7bc9a17 --- /dev/null +++ b/Dockerfile.app-base @@ -0,0 +1,60 @@ +FROM ubuntu:20.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ="America/Los_Angeles" + +RUN apt update + +# In ubuntu 20.04, installing php without specifying a version installs 7.4 :) +RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 php-imap \ +vim curl git unzip wget mysql-client build-essential rsync + +# supervisor nginx cron +# libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb + +# +# node +# +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN apt -y install nodejs +RUN npm config set cache /root/.cache/npm --global + +# +# install composer +# +RUN wget -O composer-setup.php https://getcomposer.org/installer +RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer +RUN composer self-update + +# +# cron +# +# COPY build-files/laravel-cron /etc/cron.d/laravel-cron +# RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron + +# +# docker client +# +ENV DOCKERVERSION=20.10.5 +RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \ + && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \ + -C /usr/local/bin docker/docker \ + && rm docker-${DOCKERVERSION}.tgz + +# +# configure php-fpm to run as root +# +RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf + +# +# nginx +# +# COPY build-files/nginx.conf /etc/nginx/nginx.conf + +# populate $_ENV with environment variables +RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini + + +# Use the correct version of mysqldump +COPY --from=mysql:5.7 /usr/bin/mysqldump /usr/bin/mysqldump + +EXPOSE 80 443 6001 \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base index 2a18906..6a8cc65 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -1,56 +1,17 @@ -FROM ubuntu:20.04 -ENV DEBIAN_FRONTEND=noninteractive -ENV TZ="America/Los_Angeles" +# syntax = docker/dockerfile:1.2 -RUN apt update +FROM php:7.4-alpine -# In ubuntu 20.04, installing php without specifying a version installs 7.4 :) -RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 php-imap \ -vim curl git unzip wget mysql-client build-essential rsync +RUN apk update +RUN apk add bash curl git vim rsync mysql-client -# supervisor nginx cron -# libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions +RUN install-php-extensions imagick exif pcntl zip imap gd pdo_mysql -# -# node -# -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - -RUN apt -y install nodejs -RUN npm config set cache /root/.cache/npm --global +WORKDIR /code +RUN curl -s https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer +ENV COMPOSER_HOME=/cache/composer -# -# install composer -# -RUN wget -O composer-setup.php https://getcomposer.org/installer -RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer -RUN composer self-update -# -# cron -# -# COPY build-files/laravel-cron /etc/cron.d/laravel-cron -# RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron - -# -# docker client -# -ENV DOCKERVERSION=20.10.5 -RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \ - && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \ - -C /usr/local/bin docker/docker \ - && rm docker-${DOCKERVERSION}.tgz - -# -# configure php-fpm to run as root -# -RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf - -# -# nginx -# -# COPY build-files/nginx.conf /etc/nginx/nginx.conf - -# populate $_ENV with environment variables -RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini - -EXPOSE 80 443 6001 \ No newline at end of file diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..3619f50 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,34 @@ +# syntax = docker/dockerfile:1.2 +FROM nolanpro/pm4-ci-base as build + +ARG GITHUB_CONTEXT +ENV GITHUB_CONTEXT=${GITHUB_CONTEXT} +ARG GITHUB_TOKEN +ENV GITHUB_TOKEN=${GITHUB_TOKEN} + +COPY pm4-tools pm4-tools +# RUN ./composer.phar global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git +# RUN composer global config repositories.pm4-tools path /code/pm4-tools +# RUN ./composer.phar global require processmaker/pm4-tools:dev-master +# RUN composer global require processmaker/pm4-tools + +# Install NodeJS +COPY --from=node:14.4-alpine /usr/local /nodejs +ENV PATH="/nodejs/bin:${PATH}" +RUN npm config set cache /cache/npm + +COPY .env pm4-tools/.env +ENV ENV=/root/.profile + +WORKDIR /code/pm4 +RUN /code/pm4-tools/pm build-ci +ENV CYPRESS_INSTALL_BINARY=0 +RUN /code/pm4-tools/pm build-javascript-ci + +RUN rm -rf node_modules + +FROM nolanpro/pm4-ci-base +COPY --from=build /code/pm4 /code/pm4 +COPY --from=build /code/pm4-tools /code/pm4-tools + +COPY ./build-files/install-and-test.sh . diff --git a/build-files/builder-init.sh b/build-files/builder-init.sh deleted file mode 100644 index 2f43630..0000000 --- a/build-files/builder-init.sh +++ /dev/null @@ -1,15 +0,0 @@ -export COMPOSER_AUTH="{\"github-oauth\": {\"github.com\": \"$GITHUB_TOKEN\"}}" - -while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT --silent; do - echo "Waiting for mysql" - sleep 1 -done - -composer global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git -composer global require processmaker/pm4-tools:dev-master - -/root/.config/composer/vendor/bin/pm install-packages-ci - -touch /code/pm4/done.txt - -tail -f /dev/null \ No newline at end of file diff --git a/build-files/install-and-test.sh b/build-files/install-and-test.sh new file mode 100644 index 0000000..dee3697 --- /dev/null +++ b/build-files/install-and-test.sh @@ -0,0 +1,13 @@ +set -ex + +while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT --silent; do + echo "Waiting for mysql" + sleep 1 +done + +echo "memory_limit=10G" >> /usr/local/etc/php/php.ini + +/code/pm4-tools/pm install-ci +cd pm4 +vendor/bin/paratest -p 6 + diff --git a/build-files/runner-init.sh b/build-files/runner-init.sh deleted file mode 100644 index 5f32422..0000000 --- a/build-files/runner-init.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -e - -while [ ! -f /code/pm4/done.txt ] -do - sleep 2 -done - -cd /code/pm4 -echo "Running './vendor/bin/phpunit${PHPUNIT_ARGS}'" -./vendor/bin/phpunit${PHPUNIT_ARGS} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 18bdd36..cf1d219 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,51 +1,32 @@ version: "3.8" services: - builder: - build: . - env_file: - - .env - environment: - - GITHUB_TOKEN - - GITHUB_CONTEXT - volumes: - - ${PM_DOCKER_SOCK}:/var/run/docker.sock - - ${HOST_CACHE_PATH}:/root/.cache - - pm4:/code/pm4 - - pm4-packages:/code/pm4-packages - links: - - redis - - mysql - depends_on: - - mysql - - redis - runner: - image: pm4-runner:local + base: + image: nolanpro/pm4-ci-base build: context: . - dockerfile: Dockerfile.runner - ports: - - ${PM_APP_PORT}:80 - - ${PM_BROADCASTER_PORT}:6001 + dockerfile: Dockerfile.base + build: + image: pm4-ci-build:local + build: + context: . + dockerfile: Dockerfile.build + args: + GITHUB_TOKEN: + GITHUB_CONTEXT: + HOST_CACHE_PATH: + install: + image: pm4-ci-build:local + command: sh install-and-test.sh + volumes: + - ./pm4-tools:/code/pm4-tools + env_file: + - .env links: - redis - mysql depends_on: - mysql - redis - - builder - volumes: - - ${PM_DOCKER_SOCK}:/var/run/docker.sock - - ${HOST_CACHE_PATH}:/root/.cache - - pm4:/code/pm4 - - pm4-packages:/code/pm4-packages - environment: - - PHPUNIT_ARGS - base: - image: processmaker/pm4-base:2.0.0 - build: - context: . - dockerfile: Dockerfile.base - redis: image: redis volumes: From 587e192170669c53423c6887bbb0ae03c0d16aae Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 16:12:08 -0800 Subject: [PATCH 13/71] Update Dockerfile.build --- Dockerfile.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 3619f50..dea9811 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -6,21 +6,21 @@ ENV GITHUB_CONTEXT=${GITHUB_CONTEXT} ARG GITHUB_TOKEN ENV GITHUB_TOKEN=${GITHUB_TOKEN} -COPY pm4-tools pm4-tools -# RUN ./composer.phar global config repositories.pm4-tools vcs https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git -# RUN composer global config repositories.pm4-tools path /code/pm4-tools -# RUN ./composer.phar global require processmaker/pm4-tools:dev-master -# RUN composer global require processmaker/pm4-tools +# COPY pm4-tools pm4-tools +RUN git clone https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git /code/pm4-tools +WORKDIR /code/pm4-tools +RUN composer install +COPY .env /code/pm4-tools/.env # Install NodeJS COPY --from=node:14.4-alpine /usr/local /nodejs ENV PATH="/nodejs/bin:${PATH}" RUN npm config set cache /cache/npm -COPY .env pm4-tools/.env ENV ENV=/root/.profile WORKDIR /code/pm4 + RUN /code/pm4-tools/pm build-ci ENV CYPRESS_INSTALL_BINARY=0 RUN /code/pm4-tools/pm build-javascript-ci From e16f8786750201df19c5774f99b43c10b8adfbb1 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 16:36:56 -0800 Subject: [PATCH 14/71] Update Dockerfile.build --- Dockerfile.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index dea9811..e17a532 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -25,10 +25,11 @@ RUN /code/pm4-tools/pm build-ci ENV CYPRESS_INSTALL_BINARY=0 RUN /code/pm4-tools/pm build-javascript-ci -RUN rm -rf node_modules +# RUN rm -rf node_modules -FROM nolanpro/pm4-ci-base -COPY --from=build /code/pm4 /code/pm4 -COPY --from=build /code/pm4-tools /code/pm4-tools +# FROM nolanpro/pm4-ci-base +# COPY --from=build /code/pm4 /code/pm4 +# COPY --from=build /code/pm4-tools /code/pm4-tools +WORKDIR /code COPY ./build-files/install-and-test.sh . From 36d3b0b601d8a8103947c57424471cc45da62d44 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 19:47:35 -0800 Subject: [PATCH 15/71] Update --- Dockerfile.build | 8 ++++---- docker-compose.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index e17a532..fc7d9bf 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -25,11 +25,11 @@ RUN /code/pm4-tools/pm build-ci ENV CYPRESS_INSTALL_BINARY=0 RUN /code/pm4-tools/pm build-javascript-ci -# RUN rm -rf node_modules +RUN rm -rf node_modules -# FROM nolanpro/pm4-ci-base -# COPY --from=build /code/pm4 /code/pm4 -# COPY --from=build /code/pm4-tools /code/pm4-tools +FROM nolanpro/pm4-ci-base +COPY --from=build /code/pm4 /code/pm4 +COPY --from=build /code/pm4-tools /code/pm4-tools WORKDIR /code COPY ./build-files/install-and-test.sh . diff --git a/docker-compose.yml b/docker-compose.yml index cf1d219..fa02eb1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.base build: - image: pm4-ci-build:local + image: nolanpro/pm4-ci-build build: context: . dockerfile: Dockerfile.build @@ -15,7 +15,7 @@ services: GITHUB_CONTEXT: HOST_CACHE_PATH: install: - image: pm4-ci-build:local + image: nolanpro/pm4-ci-build command: sh install-and-test.sh volumes: - ./pm4-tools:/code/pm4-tools From 3eeab12af3f5639c5792f1a0f429a9ac16fdb655 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 19:51:39 -0800 Subject: [PATCH 16/71] Update docker-compose.yml --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fa02eb1..2d18c97 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,8 +17,8 @@ services: install: image: nolanpro/pm4-ci-build command: sh install-and-test.sh - volumes: - - ./pm4-tools:/code/pm4-tools + # volumes: + # - ./pm4-tools:/code/pm4-tools env_file: - .env links: From 8e735dde422cfd9f48dd4e2706c8d699cdb8a2c8 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 4 Jan 2022 22:44:54 -0800 Subject: [PATCH 17/71] Update docker-compose.yml --- docker-compose.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2d18c97..cd2c39a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.base build: - image: nolanpro/pm4-ci-build + image: pm4-ci-build:local build: context: . dockerfile: Dockerfile.build @@ -15,10 +15,8 @@ services: GITHUB_CONTEXT: HOST_CACHE_PATH: install: - image: nolanpro/pm4-ci-build + image: pm4-ci-build:local command: sh install-and-test.sh - # volumes: - # - ./pm4-tools:/code/pm4-tools env_file: - .env links: From 68b035093d19de85c4bf287b57b29ad36b721a83 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 7 Jan 2022 12:05:27 -0800 Subject: [PATCH 18/71] Update build strategy --- .env | 4 +-- .gitignore | 3 ++ Dockerfile.build | 35 ------------------- Dockerfile.base => Dockerfile.builder | 11 ++++-- Dockerfile.runner | 6 ---- .../{install-and-test.sh => builder.sh} | 8 +++-- docker-compose.yml | 23 +++++------- 7 files changed, 29 insertions(+), 61 deletions(-) delete mode 100644 Dockerfile.build rename Dockerfile.base => Dockerfile.builder (68%) delete mode 100644 Dockerfile.runner rename build-files/{install-and-test.sh => builder.sh} (64%) diff --git a/.env b/.env index b10ecd6..49b2242 100644 --- a/.env +++ b/.env @@ -24,6 +24,6 @@ CACHE_PATH="/pm4-cache" HOST_CACHE_PATH="/home/runner/cache" TELESCOPE_ENABLED=false -COMPOSER_MIRROR_PATH_REPOS=1 +# COMPOSER_MIRROR_PATH_REPOS=1 PARALLEL_TEST_PROCESSES=6 -# vendor/bin/paratest -p 6 \ No newline at end of file +# vendor/bin/paratest -p 6 diff --git a/.gitignore b/.gitignore index bf36004..e45f3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ pmrepo cache pm4-tools +github_context.txt +pr_body.txt +update_context.sh \ No newline at end of file diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index fc7d9bf..0000000 --- a/Dockerfile.build +++ /dev/null @@ -1,35 +0,0 @@ -# syntax = docker/dockerfile:1.2 -FROM nolanpro/pm4-ci-base as build - -ARG GITHUB_CONTEXT -ENV GITHUB_CONTEXT=${GITHUB_CONTEXT} -ARG GITHUB_TOKEN -ENV GITHUB_TOKEN=${GITHUB_TOKEN} - -# COPY pm4-tools pm4-tools -RUN git clone https://${GITHUB_TOKEN}@github.com/ProcessMaker/pm4-tools.git /code/pm4-tools -WORKDIR /code/pm4-tools -RUN composer install -COPY .env /code/pm4-tools/.env - -# Install NodeJS -COPY --from=node:14.4-alpine /usr/local /nodejs -ENV PATH="/nodejs/bin:${PATH}" -RUN npm config set cache /cache/npm - -ENV ENV=/root/.profile - -WORKDIR /code/pm4 - -RUN /code/pm4-tools/pm build-ci -ENV CYPRESS_INSTALL_BINARY=0 -RUN /code/pm4-tools/pm build-javascript-ci - -RUN rm -rf node_modules - -FROM nolanpro/pm4-ci-base -COPY --from=build /code/pm4 /code/pm4 -COPY --from=build /code/pm4-tools /code/pm4-tools - -WORKDIR /code -COPY ./build-files/install-and-test.sh . diff --git a/Dockerfile.base b/Dockerfile.builder similarity index 68% rename from Dockerfile.base rename to Dockerfile.builder index 6a8cc65..7bc7635 100644 --- a/Dockerfile.base +++ b/Dockerfile.builder @@ -1,5 +1,3 @@ -# syntax = docker/dockerfile:1.2 - FROM php:7.4-alpine RUN apk update @@ -14,4 +12,13 @@ RUN curl -s https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer ENV COMPOSER_HOME=/cache/composer +COPY --from=node:14.4-alpine /usr/local /nodejs +ENV PATH="/nodejs/bin:${PATH}" +RUN npm config set cache /cache/npm + +COPY ./pm4-tools /code/pm4-tools +WORKDIR /code/pm4-tools + +WORKDIR /code +COPY build-files/builder.sh . \ No newline at end of file diff --git a/Dockerfile.runner b/Dockerfile.runner deleted file mode 100644 index e0c1631..0000000 --- a/Dockerfile.runner +++ /dev/null @@ -1,6 +0,0 @@ -FROM processmaker/pm4-base:2.0.0 AS build - -COPY ./build-files /code/build-files - -WORKDIR /code -CMD bash build-files/runner-init.sh \ No newline at end of file diff --git a/build-files/install-and-test.sh b/build-files/builder.sh similarity index 64% rename from build-files/install-and-test.sh rename to build-files/builder.sh index dee3697..731ae98 100644 --- a/build-files/install-and-test.sh +++ b/build-files/builder.sh @@ -7,7 +7,11 @@ done echo "memory_limit=10G" >> /usr/local/etc/php/php.ini +composer config --global github-oauth.github.com $GITHUB_TOKEN + +/code/pm4-tools/pm build-ci +/code/pm4-tools/pm build-javascript-ci /code/pm4-tools/pm install-ci -cd pm4 -vendor/bin/paratest -p 6 +cd /code/pm4 +vendor/bin/paratest -p 6 diff --git a/docker-compose.yml b/docker-compose.yml index cd2c39a..42a1d26 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,14 @@ version: "3.8" services: - base: + builder: image: nolanpro/pm4-ci-base build: context: . - dockerfile: Dockerfile.base - build: - image: pm4-ci-build:local - build: - context: . - dockerfile: Dockerfile.build - args: - GITHUB_TOKEN: - GITHUB_CONTEXT: - HOST_CACHE_PATH: - install: - image: pm4-ci-build:local - command: sh install-and-test.sh + dockerfile: Dockerfile.builder + command: sh builder.sh + environment: + - GITHUB_TOKEN + - GITHUB_CONTEXT env_file: - .env links: @@ -25,6 +17,9 @@ services: depends_on: - mysql - redis + volumes: + - ./cache:/cache + redis: image: redis volumes: From b6a82542bde3842dea3927e1d3c4fc605e77c12c Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 31 Jan 2022 21:59:39 -0800 Subject: [PATCH 19/71] Use original ubuntu base image --- .gitignore | 4 +- Dockerfile | 9 - Dockerfile.app-base => Dockerfile.base | 3 +- Dockerfile.builder | 19 +- build-files/builder.sh | 2 - docker-compose.yml | 16 +- github_context_example.json | 362 +++++++++++++++++++++++++ pr_body_example.txt | 22 ++ update_context_example.sh | 4 + 9 files changed, 403 insertions(+), 38 deletions(-) delete mode 100644 Dockerfile rename Dockerfile.app-base => Dockerfile.base (95%) create mode 100644 github_context_example.json create mode 100644 pr_body_example.txt create mode 100644 update_context_example.sh diff --git a/.gitignore b/.gitignore index e45f3ab..44862ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ pmrepo cache pm4-tools -github_context.txt -pr_body.txt -update_context.sh \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3405a3c..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM processmaker/pm4-base:2.0.0 AS build - -WORKDIR /code - -ENV CACHE_PATH=/root/.cache - -COPY ./build-files /code/build-files - -CMD bash build-files/builder-init.sh diff --git a/Dockerfile.app-base b/Dockerfile.base similarity index 95% rename from Dockerfile.app-base rename to Dockerfile.base index 7bc9a17..f8b8f62 100644 --- a/Dockerfile.app-base +++ b/Dockerfile.base @@ -51,8 +51,7 @@ RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf # COPY build-files/nginx.conf /etc/nginx/nginx.conf # populate $_ENV with environment variables -RUN echo "variables_order = \"EPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini - +RUN echo "variables_order = \"EGPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini # Use the correct version of mysqldump COPY --from=mysql:5.7 /usr/bin/mysqldump /usr/bin/mysqldump diff --git a/Dockerfile.builder b/Dockerfile.builder index 7bc7635..cc89f4b 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -1,24 +1,9 @@ -FROM php:7.4-alpine +FROM processmaker/pm4-base:2.0.0 -RUN apk update -RUN apk add bash curl git vim rsync mysql-client - -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ -RUN chmod +x /usr/local/bin/install-php-extensions -RUN install-php-extensions imagick exif pcntl zip imap gd pdo_mysql - -WORKDIR /code -RUN curl -s https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer +RUN npm config set cacphe /cache/npm ENV COMPOSER_HOME=/cache/composer -COPY --from=node:14.4-alpine /usr/local /nodejs -ENV PATH="/nodejs/bin:${PATH}" -RUN npm config set cache /cache/npm - COPY ./pm4-tools /code/pm4-tools -WORKDIR /code/pm4-tools WORKDIR /code - COPY build-files/builder.sh . \ No newline at end of file diff --git a/build-files/builder.sh b/build-files/builder.sh index 731ae98..0d673e9 100644 --- a/build-files/builder.sh +++ b/build-files/builder.sh @@ -5,8 +5,6 @@ while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_ sleep 1 done -echo "memory_limit=10G" >> /usr/local/etc/php/php.ini - composer config --global github-oauth.github.com $GITHUB_TOKEN /code/pm4-tools/pm build-ci diff --git a/docker-compose.yml b/docker-compose.yml index 42a1d26..1be4e81 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: builder: - image: nolanpro/pm4-ci-base + image: local:latest build: context: . dockerfile: Dockerfile.builder @@ -19,11 +19,18 @@ services: - redis volumes: - ./cache:/cache - + + base: + image: processmaker/pm4-base:2.0.0 + build: + context: . + dockerfile: Dockerfile.base + redis: image: redis volumes: - redis:/data + mysql: image: mysql:5.7 restart: always @@ -32,8 +39,7 @@ services: MYSQL_DATABASE: processmaker volumes: - database:/var/lib/mysql + volumes: database: - redis: - pm4: - pm4-packages: \ No newline at end of file + redis: \ No newline at end of file diff --git a/github_context_example.json b/github_context_example.json new file mode 100644 index 0000000..049c3a5 --- /dev/null +++ b/github_context_example.json @@ -0,0 +1,362 @@ +{ + "_links": { + "comments": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1/comments" + }, + "commits": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/commits" + }, + "html": { + "href": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1" + }, + "issue": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1" + }, + "review_comment": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/comments{/number}" + }, + "review_comments": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/comments" + }, + "self": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1" + }, + "statuses": { + "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1" + } + }, + "active_lock_reason": null, + "additions": 49, + "assignee": null, + "assignees": [], + "author_association": "OWNER", + "auto_merge": null, + "base": { + "label": "nolanpro:master", + "ref": "master", + "repo": { + "allow_auto_merge": false, + "allow_forking": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_squash_merge": true, + "allow_update_branch": false, + "archive_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/assignees{/user}", + "blobs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/branches{/branch}", + "clone_url": "https://github.com/nolanpro/docker-compose-actions-workflow.git", + "collaborators_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/comments{/number}", + "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/commits{/sha}", + "compare_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contents/{+path}", + "contributors_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contributors", + "created_at": "2021-12-03T17:21:35Z", + "default_branch": "master", + "delete_branch_on_merge": false, + "deployments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/deployments", + "description": "GitHub Actions workflow example using Docker Compose to build and test a multi-container stack", + "disabled": false, + "downloads_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/downloads", + "events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/events", + "fork": true, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/forks", + "full_name": "nolanpro/docker-compose-actions-workflow", + "git_commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/tags{/sha}", + "git_url": "git://github.com/nolanpro/docker-compose-actions-workflow.git", + "has_downloads": true, + "has_issues": false, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/hooks", + "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow", + "id": 434677808, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/events{/number}", + "issues_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues{/number}", + "keys_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/keys{/key_id}", + "labels_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/labels{/name}", + "language": "Python", + "languages_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/merges", + "milestones_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/milestones{/number}", + "mirror_url": null, + "name": "docker-compose-actions-workflow", + "node_id": "R_kgDOGeioMA", + "notifications_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/notifications{?since,all,participating}", + "open_issues": 1, + "open_issues_count": 1, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", + "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", + "followers_url": "https://api.github.com/users/nolanpro/followers", + "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", + "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/nolanpro", + "id": 2546850, + "login": "nolanpro", + "node_id": "MDQ6VXNlcjI1NDY4NTA=", + "organizations_url": "https://api.github.com/users/nolanpro/orgs", + "received_events_url": "https://api.github.com/users/nolanpro/received_events", + "repos_url": "https://api.github.com/users/nolanpro/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", + "type": "User", + "url": "https://api.github.com/users/nolanpro" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls{/number}", + "pushed_at": "2021-12-15T19:44:42Z", + "releases_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/releases{/id}", + "size": 25, + "ssh_url": "git@github.com:nolanpro/docker-compose-actions-workflow.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/stargazers", + "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscribers", + "subscription_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscription", + "svn_url": "https://github.com/nolanpro/docker-compose-actions-workflow", + "tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/tags", + "teams_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/trees{/sha}", + "updated_at": "2021-12-03T17:49:23Z", + "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow", + "visibility": "public", + "watchers": 0, + "watchers_count": 0 + }, + "sha": "1b7527fd0de7ea8e08b034939ee7336696627358", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", + "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", + "followers_url": "https://api.github.com/users/nolanpro/followers", + "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", + "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/nolanpro", + "id": 2546850, + "login": "nolanpro", + "node_id": "MDQ6VXNlcjI1NDY4NTA=", + "organizations_url": "https://api.github.com/users/nolanpro/orgs", + "received_events_url": "https://api.github.com/users/nolanpro/received_events", + "repos_url": "https://api.github.com/users/nolanpro/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", + "type": "User", + "url": "https://api.github.com/users/nolanpro" + } + }, + "body": "", + "changed_files": 1, + "closed_at": null, + "comments": 0, + "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1/comments", + "commits": 29, + "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/commits", + "created_at": "2021-12-03T20:15:32Z", + "deletions": 8, + "diff_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1.diff", + "draft": false, + "head": { + "label": "nolanpro:testbranch", + "ref": "testbranch", + "repo": { + "allow_auto_merge": false, + "allow_forking": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_squash_merge": true, + "allow_update_branch": false, + "archive_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/assignees{/user}", + "blobs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/branches{/branch}", + "clone_url": "https://github.com/nolanpro/docker-compose-actions-workflow.git", + "collaborators_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/comments{/number}", + "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/commits{/sha}", + "compare_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contents/{+path}", + "contributors_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contributors", + "created_at": "2021-12-03T17:21:35Z", + "default_branch": "master", + "delete_branch_on_merge": false, + "deployments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/deployments", + "description": "GitHub Actions workflow example using Docker Compose to build and test a multi-container stack", + "disabled": false, + "downloads_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/downloads", + "events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/events", + "fork": true, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/forks", + "full_name": "nolanpro/docker-compose-actions-workflow", + "git_commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/tags{/sha}", + "git_url": "git://github.com/nolanpro/docker-compose-actions-workflow.git", + "has_downloads": true, + "has_issues": false, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/hooks", + "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow", + "id": 434677808, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/events{/number}", + "issues_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues{/number}", + "keys_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/keys{/key_id}", + "labels_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/labels{/name}", + "language": "Python", + "languages_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/merges", + "milestones_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/milestones{/number}", + "mirror_url": null, + "name": "docker-compose-actions-workflow", + "node_id": "R_kgDOGeioMA", + "notifications_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/notifications{?since,all,participating}", + "open_issues": 1, + "open_issues_count": 1, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", + "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", + "followers_url": "https://api.github.com/users/nolanpro/followers", + "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", + "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/nolanpro", + "id": 2546850, + "login": "nolanpro", + "node_id": "MDQ6VXNlcjI1NDY4NTA=", + "organizations_url": "https://api.github.com/users/nolanpro/orgs", + "received_events_url": "https://api.github.com/users/nolanpro/received_events", + "repos_url": "https://api.github.com/users/nolanpro/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", + "type": "User", + "url": "https://api.github.com/users/nolanpro" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls{/number}", + "pushed_at": "2021-12-15T19:44:42Z", + "releases_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/releases{/id}", + "size": 25, + "ssh_url": "git@github.com:nolanpro/docker-compose-actions-workflow.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/stargazers", + "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscribers", + "subscription_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscription", + "svn_url": "https://github.com/nolanpro/docker-compose-actions-workflow", + "tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/tags", + "teams_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/trees{/sha}", + "updated_at": "2021-12-03T17:49:23Z", + "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow", + "visibility": "public", + "watchers": 0, + "watchers_count": 0 + }, + "sha": "4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", + "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", + "followers_url": "https://api.github.com/users/nolanpro/followers", + "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", + "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/nolanpro", + "id": 2546850, + "login": "nolanpro", + "node_id": "MDQ6VXNlcjI1NDY4NTA=", + "organizations_url": "https://api.github.com/users/nolanpro/orgs", + "received_events_url": "https://api.github.com/users/nolanpro/received_events", + "repos_url": "https://api.github.com/users/nolanpro/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", + "type": "User", + "url": "https://api.github.com/users/nolanpro" + } + }, + "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1", + "id": 794886517, + "issue_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1", + "labels": [], + "locked": false, + "maintainer_can_modify": false, + "merge_commit_sha": "cda5436dfbca03aae8b6770697148bdf89fa43d4", + "mergeable": null, + "mergeable_state": "unknown", + "merged": false, + "merged_at": null, + "merged_by": null, + "milestone": null, + "node_id": "PR_kwDOGeioMM4vYQF1", + "number": 1, + "patch_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1.patch", + "rebaseable": null, + "requested_reviewers": [], + "requested_teams": [], + "review_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/comments{/number}", + "review_comments": 0, + "review_comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/comments", + "state": "open", + "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1", + "title": "Testbranch", + "updated_at": "2021-12-15T19:44:42Z", + "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", + "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", + "followers_url": "https://api.github.com/users/nolanpro/followers", + "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", + "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/nolanpro", + "id": 2546850, + "login": "nolanpro", + "node_id": "MDQ6VXNlcjI1NDY4NTA=", + "organizations_url": "https://api.github.com/users/nolanpro/orgs", + "received_events_url": "https://api.github.com/users/nolanpro/received_events", + "repos_url": "https://api.github.com/users/nolanpro/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", + "type": "User", + "url": "https://api.github.com/users/nolanpro" + } +} diff --git a/pr_body_example.txt b/pr_body_example.txt new file mode 100644 index 0000000..d2a3c6e --- /dev/null +++ b/pr_body_example.txt @@ -0,0 +1,22 @@ +## Test PR + +Branches needed: + +ci:package-auth:updates-for-ci +ci:package-dynamic-ui:updates-for-ci +ci:package-savedsearch:updates-for-ci +ci:processmaker:updates-for-ci +ci:package-auth:updates-for-ci +ci:package-actions-by-email:updates-for-ci +ci:connector-slack:updates-for-ci +ci:package-googleplaces:updates-for-ci +ci:connector-send-email:updates-for-ci +ci:package-advanced-user-manager:updates-for-ci +ci:connector-docusign:updates-for-ci +ci:package-collections:updates-for-ci +ci:package-data-sources:updates-for-ci +ci:package-data-sources:updates-for-ci +ci:connector-pdf-print:updates-for-ci + +Done! + diff --git a/update_context_example.sh b/update_context_example.sh new file mode 100644 index 0000000..78cad34 --- /dev/null +++ b/update_context_example.sh @@ -0,0 +1,4 @@ +# Sets an example GITHUB_CONTEXT for local testing +# Edit pr_body_example.txt to set the PR's body +# run with source ./update_context_example.sh +export GITHUB_CONTEXT=$(cat github_context_example.json | jq -r ".body |= \"$(cat pr_body_example.txt)\"") From c7d341bc510f89a31149a0d0ac67b2ca748c9118 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 31 Jan 2022 22:18:32 -0800 Subject: [PATCH 20/71] Add composer install for pm4-tools --- Dockerfile.builder | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.builder b/Dockerfile.builder index cc89f4b..fc747c6 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -4,6 +4,8 @@ RUN npm config set cacphe /cache/npm ENV COMPOSER_HOME=/cache/composer COPY ./pm4-tools /code/pm4-tools +WORKDIR /code/pm4-tools +RUN composer install --no-interaction WORKDIR /code COPY build-files/builder.sh . \ No newline at end of file From ce787459c2f4c7fa16b6ffba7ae4da2d27582adc Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 1 Feb 2022 15:32:31 -0800 Subject: [PATCH 21/71] Rename some files and bring back original core runner --- .env | 28 +------------ .env-cicd | 28 +++++++++++++ Dockerfile.base | 17 ++++---- Dockerfile.builder => Dockerfile.cicd | 2 +- Dockerfile.core-app | 16 +++++++ README.md | 31 ++++++++++++++ build-files/{builder.sh => cicd-build-run.sh} | 0 build-files/core-build-run.sh | 42 +++++++++++++++++++ docker-compose.yml | 32 +++++++++++--- ...ntext_example.sh => set_context_example.sh | 2 +- 10 files changed, 156 insertions(+), 42 deletions(-) create mode 100644 .env-cicd rename Dockerfile.builder => Dockerfile.cicd (85%) create mode 100644 Dockerfile.core-app rename build-files/{builder.sh => cicd-build-run.sh} (100%) create mode 100644 build-files/core-build-run.sh rename update_context_example.sh => set_context_example.sh (81%) diff --git a/.env b/.env index 49b2242..d459e6f 100644 --- a/.env +++ b/.env @@ -1,29 +1,5 @@ -PM_VERSION=local -CODEBASE_PATH=/code/pm4 -PACKAGES_PATH=/code/pm4-packages -PM_CI=true +PM_VERSION=4.1.21 PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 -PM_DOCKER_SOCK=/var/run/docker.sock -PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker -PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying -LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost -SESSION_SECURE_COOKIE=false -CACHE_DRIVER=array -SESSION_DOMAIN=null -GOOGLE_API_TOKEN=test -SLACK_OAUTH_ACCESS_TOKEN=test -DB_HOSTNAME=mysql -DB_PORT=3306 -DB_USERNAME=root -DB_PASSWORD=password -DB_DATABASE="processmaker" -REDIS_HOST=redis -CACHE_PATH="/pm4-cache" -HOST_CACHE_PATH="/home/runner/cache" -TELESCOPE_ENABLED=false - -# COMPOSER_MIRROR_PATH_REPOS=1 -PARALLEL_TEST_PROCESSES=6 -# vendor/bin/paratest -p 6 +PM_DOCKER_SOCK=/var/run/docker.sock \ No newline at end of file diff --git a/.env-cicd b/.env-cicd new file mode 100644 index 0000000..154081b --- /dev/null +++ b/.env-cicd @@ -0,0 +1,28 @@ +PM_VERSION=local +CODEBASE_PATH=/code/pm4 +PACKAGES_PATH=/code/pm4-packages +PM_CI=true +PM_APP_URL=http://localhost +PM_APP_PORT=8080 +PM_BROADCASTER_PORT=6004 +PM_DOCKER_SOCK=/var/run/docker.sock +PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker +PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying +LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost +SESSION_SECURE_COOKIE=false +CACHE_DRIVER=array +SESSION_DOMAIN=null +GOOGLE_API_TOKEN=test +SLACK_OAUTH_ACCESS_TOKEN=test +DB_HOSTNAME=mysql +DB_PORT=3306 +DB_USERNAME=root +DB_PASSWORD=password +DB_DATABASE="processmaker" +REDIS_HOST=redis +CACHE_PATH="/pm4-cache" +HOST_CACHE_PATH="/home/runner/cache" +TELESCOPE_ENABLED=false + +# COMPOSER_MIRROR_PATH_REPOS=1 +PARALLEL_TEST_PROCESSES=6 diff --git a/Dockerfile.base b/Dockerfile.base index f8b8f62..6163291 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -6,17 +6,13 @@ RUN apt update # In ubuntu 20.04, installing php without specifying a version installs 7.4 :) RUN apt install -y php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-imagick php-dom php-sqlite3 php-imap \ -vim curl git unzip wget mysql-client build-essential rsync - -# supervisor nginx cron -# libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb +nginx vim curl git unzip wget supervisor cron mysql-client build-essential # # node # RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - RUN apt -y install nodejs -RUN npm config set cache /root/.cache/npm --global # # install composer @@ -28,8 +24,8 @@ RUN composer self-update # # cron # -# COPY build-files/laravel-cron /etc/cron.d/laravel-cron -# RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron +COPY build-files/laravel-cron /etc/cron.d/laravel-cron +RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron # # docker client @@ -48,7 +44,12 @@ RUN sed -i 's/www-data/root/g' /etc/php/7.4/fpm/pool.d/www.conf # # nginx # -# COPY build-files/nginx.conf /etc/nginx/nginx.conf +COPY build-files/nginx.conf /etc/nginx/nginx.conf + +# +# supervisord +# +COPY build-files/services.conf /etc/supervisor/conf.d/services.conf # populate $_ENV with environment variables RUN echo "variables_order = \"EGPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini diff --git a/Dockerfile.builder b/Dockerfile.cicd similarity index 85% rename from Dockerfile.builder rename to Dockerfile.cicd index fc747c6..48a686c 100644 --- a/Dockerfile.builder +++ b/Dockerfile.cicd @@ -8,4 +8,4 @@ WORKDIR /code/pm4-tools RUN composer install --no-interaction WORKDIR /code -COPY build-files/builder.sh . \ No newline at end of file +COPY build-files/cicd-build-run.sh . \ No newline at end of file diff --git a/Dockerfile.core-app b/Dockerfile.core-app new file mode 100644 index 0000000..61b1c82 --- /dev/null +++ b/Dockerfile.core-app @@ -0,0 +1,16 @@ +FROM processmaker/pm4-base:1.0.0 + +ARG PM_VERSION + +WORKDIR /tmp +RUN wget https://github.com/ProcessMaker/processmaker/archive/refs/tags/v${PM_VERSION}.zip +RUN unzip v${PM_VERSION}.zip && rm -rf /code/pm4 && mv processmaker-${PM_VERSION} /code/pm4 + +WORKDIR /code/pm4 +RUN composer install +COPY build-files/laravel-echo-server.json . +RUN npm install --unsafe-perm=true && npm run dev + +COPY build-files/laravel-echo-server.json . +COPY build-files/init.sh . +CMD bash core-build-run.sh && supervisord --nodaemon \ No newline at end of file diff --git a/README.md b/README.md index ce46120..3ac3a97 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,37 @@ This allows for smaller images and better performance than using dind (docker in See [this post](http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/) for more info. The host socket file is usually at /var/run/docker.sock but can be changed in the .env file +# ProcessMaker CI/CD Build +This repository includes our setup for internal CI/CD builds run by Github Actions. This includes all enterprise packages. +## Running locally +1. Create a github personal access token with access to all enterprise packages and set it as an environment variable called GITHUB_TOKEN + ``` + export GITHUB_TOKEN=ghp_........ + ``` +2. Source set_context_example.sh to set an example GITHUB_CONTEXT variable with the PR body from pr_body_example.txt + ``` + source set_context_example.sh + ``` +3. (Optional) Build the base image (otherwise it will get pulled from dockerhub) + ``` + docker-compose build base + ``` +4. Build the local CI/CD image + ``` + docker-compose build cicd + ``` +5. Run the image to build the app and execute phpunit tests + ``` + docker-compose run cicd + ``` +6. To debug, commit the container to an image and run bash. To find the container ID run `docker ps -a` and look for the name pm4core-docker_builder_run... + ``` + docker commit {container id} debug:latest + docker run --rm -it debug bash + ``` + You can then CD into /code/pm4 and run individual phpunit tests + + ## Todo ### Automated builds pushed to dockerhub diff --git a/build-files/builder.sh b/build-files/cicd-build-run.sh similarity index 100% rename from build-files/builder.sh rename to build-files/cicd-build-run.sh diff --git a/build-files/core-build-run.sh b/build-files/core-build-run.sh new file mode 100644 index 0000000..50c000a --- /dev/null +++ b/build-files/core-build-run.sh @@ -0,0 +1,42 @@ +set -ex + +if [ ! -f ".env" ]; then + + while ! mysqladmin ping -u pm -ppass -h mysql --silent; do + echo "Waiting for mysql" + sleep 1 + done + + if [ "${PM_APP_PORT}" = "80" ]; then + PORT_WITH_PREFIX="" + else + PORT_WITH_PREFIX=":${PM_APP_PORT}" + fi + + php artisan processmaker:install --no-interaction \ + --url=${PM_APP_URL}${PORT_WITH_PREFIX} \ + --broadcast-host=${PM_APP_URL}:${PM_BROADCASTER_PORT} \ + --username=admin \ + --password=admin123 \ + --email=admin@processmaker.com \ + --first-name=Admin \ + --last-name=User \ + --db-host=mysql \ + --db-port=3306 \ + --db-name=processmaker \ + --db-username=pm \ + --db-password=pass \ + --data-driver=mysql \ + --data-host=mysql \ + --data-port=3306 \ + --data-name=processmaker \ + --data-username=pm \ + --data-password=pass \ + --redis-host=redis + + + echo "PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker" >> .env + echo "PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying" >> .env + echo "LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost" >> .env + echo "SESSION_SECURE_COOKIE=false" >> .env +fi \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1be4e81..1fd9655 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,16 @@ version: "3.8" services: - builder: - image: local:latest + cicd: + image: cicd:latest build: context: . - dockerfile: Dockerfile.builder - command: sh builder.sh + dockerfile: Dockerfile.cicd + command: sh cicd-build-run.sh environment: - GITHUB_TOKEN - GITHUB_CONTEXT env_file: - - .env + - .env-cicd links: - redis - mysql @@ -31,6 +31,25 @@ services: volumes: - redis:/data + web: + image: processmaker/pm4-core:${PM_VERSION} + ports: + - ${PM_APP_PORT}:80 + - ${PM_BROADCASTER_PORT}:6001 + environment: + - PM_APP_URL + - PM_APP_PORT + - PM_BROADCASTER_PORT + volumes: + - ${PM_DOCKER_SOCK}:/var/run/docker.sock + - storage:/code/pm4/storage + links: + - redis + - mysql + depends_on: + - mysql + - redis + mysql: image: mysql:5.7 restart: always @@ -42,4 +61,5 @@ services: volumes: database: - redis: \ No newline at end of file + redis: + storage: \ No newline at end of file diff --git a/update_context_example.sh b/set_context_example.sh similarity index 81% rename from update_context_example.sh rename to set_context_example.sh index 78cad34..728ce43 100644 --- a/update_context_example.sh +++ b/set_context_example.sh @@ -1,4 +1,4 @@ # Sets an example GITHUB_CONTEXT for local testing # Edit pr_body_example.txt to set the PR's body -# run with source ./update_context_example.sh +# run with source ./set_context_example.sh export GITHUB_CONTEXT=$(cat github_context_example.json | jq -r ".body |= \"$(cat pr_body_example.txt)\"") From 6976a6ab3a32d88d75e4f7ee4a2b1be50fa86e0f Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 2 Feb 2022 22:18:16 -0800 Subject: [PATCH 22/71] Update settings --- .env-cicd | 1 + build-files/cicd-build-run.sh | 4 +++- docker-compose.yml | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.env-cicd b/.env-cicd index 154081b..0bdd987 100644 --- a/.env-cicd +++ b/.env-cicd @@ -23,6 +23,7 @@ REDIS_HOST=redis CACHE_PATH="/pm4-cache" HOST_CACHE_PATH="/home/runner/cache" TELESCOPE_ENABLED=false +BUILD_JAVASCRIPT=true # COMPOSER_MIRROR_PATH_REPOS=1 PARALLEL_TEST_PROCESSES=6 diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 0d673e9..0216c44 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -8,7 +8,9 @@ done composer config --global github-oauth.github.com $GITHUB_TOKEN /code/pm4-tools/pm build-ci -/code/pm4-tools/pm build-javascript-ci +if [ "$BUILD_JAVASCRIPT" = true ] ; then + /code/pm4-tools/pm build-javascript-ci +fi /code/pm4-tools/pm install-ci cd /code/pm4 diff --git a/docker-compose.yml b/docker-compose.yml index 1fd9655..887f4f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,16 @@ services: image: redis volumes: - redis:/data + + debug: + image: debug:latest + command: bash + env_file: + - .env-cicd + links: + - mysql + depends_on: + - mysql web: image: processmaker/pm4-core:${PM_VERSION} From bbcbf1f39ce4240147e22f0d0ce6fbe60b0bb277 Mon Sep 17 00:00:00 2001 From: Diego Bruno Flores Salazar Date: Mon, 7 Feb 2022 13:01:23 -0400 Subject: [PATCH 23/71] FOUR-5258: Move pm4-tools to a subdirectory instead of a repo --- .gitignore | 3 +- pm4-tools/cli/ProcessMaker/CommandLine.php | 196 + pm4-tools/cli/ProcessMaker/Composer.php | 55 + pm4-tools/cli/ProcessMaker/Config.php | 67 + pm4-tools/cli/ProcessMaker/FileSystem.php | 387 ++ pm4-tools/cli/ProcessMaker/Git.php | 110 + pm4-tools/cli/ProcessMaker/Install.php | 153 + pm4-tools/cli/ProcessMaker/Packages.php | 524 ++ pm4-tools/cli/ProcessMaker/PackagesCi.php | 413 ++ pm4-tools/cli/ProcessMaker/PhpUnit.php | 43 + pm4-tools/cli/ProcessMaker/ProcessManager.php | 292 + pm4-tools/cli/pm.php | 297 + pm4-tools/composer.json | 41 + pm4-tools/composer.lock | 5762 +++++++++++++++++ pm4-tools/includes/facades.php | 83 + pm4-tools/includes/helpers.php | 131 + pm4-tools/phpunit.xml | 21 + pm4-tools/pm | 25 + 18 files changed, 8601 insertions(+), 2 deletions(-) create mode 100644 pm4-tools/cli/ProcessMaker/CommandLine.php create mode 100644 pm4-tools/cli/ProcessMaker/Composer.php create mode 100644 pm4-tools/cli/ProcessMaker/Config.php create mode 100644 pm4-tools/cli/ProcessMaker/FileSystem.php create mode 100644 pm4-tools/cli/ProcessMaker/Git.php create mode 100644 pm4-tools/cli/ProcessMaker/Install.php create mode 100644 pm4-tools/cli/ProcessMaker/Packages.php create mode 100644 pm4-tools/cli/ProcessMaker/PackagesCi.php create mode 100644 pm4-tools/cli/ProcessMaker/PhpUnit.php create mode 100644 pm4-tools/cli/ProcessMaker/ProcessManager.php create mode 100644 pm4-tools/cli/pm.php create mode 100644 pm4-tools/composer.json create mode 100644 pm4-tools/composer.lock create mode 100644 pm4-tools/includes/facades.php create mode 100644 pm4-tools/includes/helpers.php create mode 100644 pm4-tools/phpunit.xml create mode 100755 pm4-tools/pm diff --git a/.gitignore b/.gitignore index 44862ec..080fa4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ pmrepo cache -pm4-tools -.DS_Store \ No newline at end of file +.DS_Store diff --git a/pm4-tools/cli/ProcessMaker/CommandLine.php b/pm4-tools/cli/ProcessMaker/CommandLine.php new file mode 100644 index 0000000..a092229 --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/CommandLine.php @@ -0,0 +1,196 @@ +time = microtime(true); + } + + /** + * Returns the timing (in seconds) since the + * CommandLine class was instantiated + * + * @return string + */ + public function timing(): string + { + $seconds = round(abs($this->time - microtime(true)), 2); + $minutes = round($seconds / 60, 2); + $hours = round($minutes / 60, 2); + + if ($hours >= 1.00) { + return "$hours hours"; + } + + if ($minutes >= 1.00) { + return "$minutes minutes"; + } + + return "$seconds seconds"; + } + + /** + * Simple global function to run commands. + * + * @param string $command + * + * @return void + */ + public function quietly(string $command) + { + $this->runCommand($command.' > /dev/null 2>&1'); + } + + /** + * Simple global function to run commands. + * + * @param string $command + * + * @return void + */ + public function quietlyAsUser(string $command) + { + $this->quietly('sudo -u "'.user().'" '.$command.' > /dev/null 2>&1'); + } + + public function transformCommandToRunAsUser(string $command, string $path = null): string + { + return ($path ? 'cd '.$path.' && ' : '').'sudo -u '.user().' '.$command; + } + + /** + * Pass the command to the command line and display the output. + * + * @param string $command + * + * @return void + */ + public function passthru(string $command) + { + passthru($command); + } + + /** + * Create a ProgressBar bound to this class instance + * + * @param int $count + * @param string $type + */ + public function createProgressBar(int $count, string $type = 'minimal'): void + { + $this->progress = new ProgressBar(new ConsoleOutput, $count); + + ProgressBar::setFormatDefinition('message', '%message% (%percent%%)'); + ProgressBar::setFormatDefinition('minimal', 'Progress: %percent%%'); + + $this->progress->setFormat($type); + $this->progress->setRedrawFrequency(25); + $this->progress->minSecondsBetweenRedraws(0.025); + $this->progress->maxSecondsBetweenRedraws(0.05); + } + + /** + * @param int|null $count + * + * @return \Symfony\Component\Console\Helper\ProgressBar + */ + public function getProgress(int $count = null): ProgressBar + { + if (!$this->progress instanceof ProgressBar) { + $this->createProgressBar($count); + } + + return $this->progress; + } + + /** + * Run the given command as the non-root user. + * + * @param string $command + * @param callable|null $onError + * @param string|null $workingDir + * + * @return string + */ + public function run(string $command, callable $onError = null, string $workingDir = null): string + { + return $this->runCommand($command, $onError, $workingDir); + } + + /** + * Run the given command. + * + * @param string $command + * @param callable|null $onError + * @param string|null $workingDir + * + * @return string + */ + public function runAsUser(string $command, callable $onError = null, string $workingDir = null): string + { + return $this->runCommand('sudo -u "'.user().'" '.$command, $onError, $workingDir); + } + + /** + * Run the given command. + * + * @param string $command + * @param callable|null $onError + * @param string|null $workingDir + * + * @return string + */ + public function runCommand(string $command, callable $onError = null, string $workingDir = null): string + { + info("Running Command: $command in $workingDir"); + $onError = $onError ? : function () {}; + + if (method_exists(Process::class, 'fromShellCommandline')) { + $process = Process::fromShellCommandline($command, null, $_ENV); + } else { + $process = new Process($command, null, $_ENV); + } + + if ($workingDir) { + if (is_dir($workingDir) && !is_file($workingDir)) { + $process->setWorkingDirectory($workingDir); + } + } + + $processOutput = ''; + + // $process->setTimeout(null)->run(function ($type, $line) use (&$processOutput) { + // $processOutput .= $line; + // }); + $process->setTimeout(null); + $process->start(); + foreach ($process as $type => $data) { + info($data); + $processOutput .= $data; + } + + if ($process->getExitCode() > 0) { + $onError($process->getExitCode(), $processOutput); + } + + return $processOutput; + } + + public function mustRun($command, $path = null) + { + return $this->runCommand($command, function($code, $output) { + throw new \Exception($output); + }, $path); + } +} diff --git a/pm4-tools/cli/ProcessMaker/Composer.php b/pm4-tools/cli/ProcessMaker/Composer.php new file mode 100644 index 0000000..08c1aae --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/Composer.php @@ -0,0 +1,55 @@ +env('PACKAGES_PATH'); + if (!$path) { + $path = Install::read()['packages_path']; + } + $path = $this->handleTrailingSlash($path, $package); + return $path; + } + + public function codebasePath() + { + $path = $this->env('CODEBASE_PATH'); + if (!$path) { + $path = Install::read()['codebase_path']; + } + return $path; + } + + public function cachePath() + { + return $this->env('CACHE_PATH'); + } + + public function cacheManifestPath() + { + return $this->cachePath() . '/' . 'manifest.json'; + } + + public function codebaseEnv() + { + return Dotenv::createArrayBacked($this->codebasePath())->load(); + } + + public function env($var, $suppressError = false) + { + if (!isset($_ENV[$var])) { + if (!$suppressError) { + throw new \Exception("$var environment variable not found"); + } + return ""; + } + return $_ENV[$var]; + } + + public function handleTrailingSlash($path, $package) + { + if ($package) { + // if package is specified, add a trailing slash if it's missing + $path = rtrim($path, '/') . '/'; + $path = $path . $package; + } else { + // otherwise, make sure there is no trailing slash + $path = rtrim($path, '/'); + } + return $path; + } +} \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/FileSystem.php b/pm4-tools/cli/ProcessMaker/FileSystem.php new file mode 100644 index 0000000..62f0a54 --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/FileSystem.php @@ -0,0 +1,387 @@ +isDir($path)) { + return false; + } + + $success = true; + + CommandLineFacade::runAsUser("rm -rf $path", + function ($error, $output) use (&$success, $path) { + $success = false; + }); + + return $success; + } + + /** + * Create a directory. + * + * @param string $path + * @param string|null $owner + * @param int $mode + * + * @return void + */ + public function mkdir(string $path, string $owner = null, int $mode = 0755): void + { + if (!mkdir($path, $mode, true) && ! is_dir($path)) { + throw new RuntimeException(sprintf('Directory "%s" was not created', $path)); + } + + if ($owner) { + $this->chown($path, $owner); + } + } + + /** + * Ensure that the given directory exists. + * + * @param string $path + * @param string|null $owner + * @param int $mode + * + * @return void + */ + public function ensureDirExists(string $path, string $owner = null, int $mode = 0755) + { + if (!$this->isDir($path)) { + $this->mkdir($path, $owner, $mode); + } + } + + /** + * Create a directory as the non-root user. + * + * @param string $path + * @param int $mode + * + * @return void + */ + public function mkdirAsUser(string $path, int $mode = 0755) + { + $this->mkdir($path, user(), $mode); + } + + /** + * Touch the given path. + * + * @param string $path + * @param string|null $owner + * + * @return string + */ + public function touch(string $path, string $owner = null): string + { + touch($path); + + if ($owner) { + $this->chown($path, $owner); + } + + return $path; + } + + /** + * Touch the given path as the non-root user. + * + * @param string $path + * + * @return string + */ + public function touchAsUser(string $path): string + { + return $this->touch($path, user()); + } + + /** + * Determine if the given file exists. + * + * @param string $path + * + * @return bool + */ + public function exists(string $path): bool + { + return file_exists($path); + } + + /** + * Read the contents of the given file. + * + * @param string $path + * + * @return string + */ + public function get(string $path): string + { + return file_get_contents($path); + } + + /** + * Write to the given file. + * + * @param string $path + * @param string $contents + * @param string|null $owner + * + * @return void + */ + public function put(string $path, string $contents, string $owner = null) + { + file_put_contents($path, $contents); + + if ($owner) { + $this->chown($path, $owner); + } + } + + /** + * Write to the given file as the non-root user. + * + * @param string $path + * @param string $contents + * + * @return void + */ + public function putAsUser(string $path, string $contents) + { + $this->put($path, $contents, user()); + } + + /** + * Append the contents to the given file. + * + * @param string $path + * @param string $contents + * @param string|null $owner + * + * @return void + */ + public function append(string $path, string $contents, string $owner = null) + { + file_put_contents($path, $contents, FILE_APPEND); + + if ($owner) { + $this->chown($path, $owner); + } + } + + /** + * Append the contents to the given file as the non-root user. + * + * @param string $path + * @param string $contents + * + * @return void + */ + public function appendAsUser(string $path, string $contents) + { + $this->append($path, $contents, user()); + } + + /** + * Copy the given file to a new location. + * + * @param string $from + * @param string $to + * + * @return void + */ + public function copy(string $from, string $to) + { + copy($from, $to); + } + + /** + * Copy the given file to a new location for the non-root user. + * + * @param string $from + * @param string $to + * + * @return void + */ + public function copyAsUser(string $from, string $to) + { + copy($from, $to); + + $this->chown($to, user()); + } + + /** + * Create a symlink to the given target. + * + * @param string $target + * @param string $link + * + * @return void + */ + public function symlink(string $target, string $link) + { + if ($this->exists($link)) { + $this->unlink($link); + } + + symlink($target, $link); + } + + /** + * Create a symlink to the given target for the non-root user. + * + * This uses the command line as PHP can't change symlink permissions. + * + * @param string $target + * @param string $link + * @return void + */ + public function symlinkAsUser($target, $link) + { + if ($this->exists($link)) { + $this->unlink($link); + } + + CommandLineFacade::runAsUser('ln -s '.escapeshellarg($target).' '.escapeshellarg($link)); + } + + /** + * Delete the file at the given path. + * + * @param string $path + * + * @return void + */ + public function unlink(string $path) + { + if (file_exists($path) || is_link($path)) { + @unlink($path); + } + } + + /** + * Change the owner of the given path. + * + * @param string $path + * @param string $user + */ + public function chown(string $path, string $user) + { + chown($path, $user); + } + + /** + * Change the group of the given path. + * + * @param string $path + * @param string $group + */ + public function chgrp(string $path, string $group) + { + chgrp($path, $group); + } + + /** + * Resolve the given path. + * + * @param string $path + * + * @return string + */ + public function realpath(string $path): string + { + return realpath($path); + } + + /** + * Determine if the given path is a symbolic link. + * + * @param string $path + * + * @return bool + */ + public function isLink(string $path): bool + { + return is_link($path); + } + + /** + * Resolve the given symbolic link. + * + * @param string $path + * + * @return string + */ + public function readLink(string $path): string + { + return readlink($path); + } + + /** + * Remove all of the broken symbolic links at the given path. + * + * @param string $path + * + * @return void + */ + public function removeBrokenLinksAt(string $path) + { + collect($this->scandir($path))->filter(function ($file) use ($path) { + return $this->isBrokenLink($path.'/'.$file); + })->each(function ($file) use ($path) { + $this->unlink($path.'/'.$file); + }); + } + + /** + * Determine if the given path is a broken symbolic link. + * + * @param string $path + * + * @return bool + */ + public function isBrokenLink(string $path): bool + { + return is_link($path) && ! file_exists($path); + } + + /** + * Scan the given directory path. + * + * @param string $path + * + * @return array + */ + public function scandir(string $path): array + { + return collect(scandir($path))->reject(function ($file) { + return in_array($file, ['.', '..']); + })->values()->all(); + } +} diff --git a/pm4-tools/cli/ProcessMaker/Git.php b/pm4-tools/cli/ProcessMaker/Git.php new file mode 100644 index 0000000..f9b5c94 --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/Git.php @@ -0,0 +1,110 @@ +validateGitRepository($path_to_repo); + + $output = CommandLineFacade::runAsUser('git rev-parse --abbrev-ref HEAD', function ($e, $o) { + throw new RuntimeException('Error trying to retrieve current git branch name'); + }, $path_to_repo); + + return Str::replace([PHP_EOL, "\n"], '', $output); + } + + /** + * @param string $path_to_repo + * + * @return string + */ + public function getCurrentCommitHash(string $path_to_repo): string + { + $this->validateGitRepository($path_to_repo); + + $output = CommandLineFacade::runAsUser('git rev-parse --short HEAD', function ($e, $o) { + throw new RuntimeException('Error trying to retrieve current git commit hash.'); + }, $path_to_repo); + + return Str::replace([PHP_EOL, "\n"], '', $output); + } + + public function getDefaultBranch(string $path): string + { + $this->validateGitRepository($path); + + $command = "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'"; + + $branch = CommandLineFacade::runAsUser($command, function ($e, $o) { + warning('Could not find default git branch.'); + output($o); + }, $path); + + return Str::replace([PHP_EOL, "\n"], '', $branch); + } + + /** + * @param string $branchName + * @param string $path + * @param bool $force + * + * @return string + */ + public function switchBranch(string $branchName, string $path, bool $force = false): string + { + $this->validateGitRepository($path); + + if ($force) { + CommandLineFacade::runAsUser('git reset --hard', null, $path); + CommandLineFacade::runAsUser('git clean -d -f .', null, $path); + } + + $switched = CommandLineFacade::runAsUser("git checkout $branchName", function ($e, $o) { + throw new RuntimeException('Failed to switch branch'); + }, $path); + + return Str::replace([PHP_EOL, "\n"], '', $switched); + } + + public function shallowClone(string $package, string $branch = null, string $path, string $folderName = null) + { + $branchArg = ''; + if ($branch) { + $branchArg = "--branch $branch "; + } + + $token = ConfigFacade::env('GITHUB_TOKEN'); + CommandLineFacade::mustRun("mkdir -p $path"); + CommandLineFacade::mustRun("ls -A1 | xargs rm -rf", $path); + $cmd = "git clone --depth 1 ${branchArg}https://${token}@github.com/processmaker/${package} ${path}"; + CommandLineFacade::mustRun($cmd); + } +} diff --git a/pm4-tools/cli/ProcessMaker/Install.php b/pm4-tools/cli/ProcessMaker/Install.php new file mode 100644 index 0000000..b2e72fb --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/Install.php @@ -0,0 +1,153 @@ +files = $files; + } + + /** + * Create the "sudoers.d" entry for running Valet. + * + * @return void + */ + public function createSudoersEntry(): void + { + $this->files->ensureDirExists('/etc/sudoers.d'); + + $this->files->put('/etc/sudoers.d/pm', 'Cmnd_Alias PM = '.BREW_PREFIX.'/bin/pm * +%admin ALL=(root) NOPASSWD:SETENV: PM'.PHP_EOL); + } + + /** + * Remove the "sudoers.d" entry for running Valet. + * + * @return void + */ + public function removeSudoersEntry() + { + CommandLineFacade::quietly('rm /etc/sudoers.d/pm'); + } + + public function symlinkToUsersBin(): void + { + $this->unlinkFromUsersBin(); + + CommandLineFacade::runAsUser('ln -s "'.realpath(__DIR__.'/../../pm').'" '.$this->bin); + } + + /** + * Remove the symlink from the user's local bin. + * + * @return void + */ + public function unlinkFromUsersBin(): void + { + CommandLineFacade::quietlyAsUser('rm '.$this->bin); + } + + /** + * Install the Valet configuration file. + * + * @param string $codebase_path + * @param string $packages_path + * + * @return void + */ + public function install(string $codebase_path, string $packages_path): void + { + $this->unlinkFromUsersBin(); + + $this->symlinkToUsersBin(); + + $this->createSudoersEntry(); + + $this->createConfigurationDirectory(); + + $this->write([ + 'codebase_path' => $codebase_path, + 'packages_path' => $packages_path + ]); + + $this->files->chown($this->path(), user()); + } + + /** + * Forcefully delete the Valet home configuration directory and contents. + * + * @return void + */ + public function uninstall(): void + { + $this->files->unlink(PM_HOME_PATH); + } + + /** + * Create the Valet configuration directory. + * + * @return void + */ + public function createConfigurationDirectory(): void + { + $this->files->ensureDirExists(PM_HOME_PATH, user()); + } + + /** + * Read the configuration file as JSON. + * + * @return array + */ + public function read(): array + { + return json_decode($this->files->get($this->path()), true); + } + + /** + * Update a specific key in the configuration file. + * + * @param string $key + * @param mixed $value + * + * @return array + */ + public function updateKey(string $key, $value): array + { + return tap($this->read(), function (&$config) use ($key, $value) { + $config[$key] = $value; + $this->write($config); + }); + } + + /** + * Write the given configuration to disk. + * + * @param array $config + * + * @return void + */ + public function write(array $config): void + { + $this->files->putAsUser($this->path(), json_encode( + $config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL + ); + } + + /** + * Get the configuration file path. + * + * @return string + */ + public function path(): string + { + return PM_HOME_PATH.'/config.json'; + } +} diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php new file mode 100644 index 0000000..441a590 --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -0,0 +1,524 @@ +getPackages())) { + throw new LogicException("Package with name \"$name\" does not exist locally."); + } + + return $this->getPackages()[$name]; + } + + /** + * @param string $name + * + * @return string + */ + public function getPackagePath(string $name): string + { + return $this->getPackage($name)['path']; + } + + /** + * @param bool $enterpriseOnly + * + * @return array + */ + public function getSupportedPackages(bool $enterpriseOnly = false): array + { + if (!$this->packageExists('packages')) { + $this->clonePackage('packages'); + } + + // We need the packages meta-package to get the + // list of supported enterprise packages that + // ProcessMaker 4 is compatible with + $packages_package = $this->getPackage('packages'); + $packages_package_path = $packages_package['path']; + + // Make sure we're on the right branch + $defaultBranch = GitFacade::getDefaultBranch($packages_package_path); + $branchSwitchResult = GitFacade::switchBranch($defaultBranch, $packages_package_path); + + // Find and decode composer.json + $composer_json = ComposerFacade::getComposerJson($packages_package_path); + + try { + // We want just the package names for now + $supported_packages = array_keys(get_object_vars($composer_json->extra->processmaker->enterprise)); + } catch (Exception $exception) { + throw new LogicException('Enterprise packages not found in processmaker/packages composer.json'); + } + + if (!$enterpriseOnly) { + // Merge the supported enterprise package names with + // the handful of other packages required for the + // primary (processmaker/processmaker) app to function + $supported_packages = array_merge($supported_packages ?? [], self::$additionalPackages); + } + + // Sort it and and remove two packages so they can be + // prepended as other packages rely on them if the order + // returned is the order installed + $supported_packages = collect($supported_packages)->values()->sort()->reject(static function ($package) { + return $package === 'docker-executor-node-ssr' + || $package === 'connector-send-email' + || $package === 'packages'; + }); + + // Prepend the removed packages so they're installed + // first, assuming the returned order is relied on + // for installation + return $supported_packages->prepend('connector-send-email') + ->prepend('docker-executor-node-ssr') + ->prepend('packages') + ->toArray(); + } + + /** + * @param string $name + * @param bool $force + * + * @return bool + */ + public function clonePackage(string $name, bool $force = false): bool + { + $name = Str::replace('processmaker/', '', $name); + + if (!$force && $this->packageExists($name)) { + throw new LogicException("Package already exists: processmaker/$name"); + } + + if ($force) { + FileSystemFacade::rmdir(ConfigFacade::packagesPath()."/$name"); + } + + $command = "git clone https://github.com/ProcessMaker/$name"; + + $output = CommandLineFacade::runAsUser($command, function ($code, $out) use ($name) { + throw new RuntimeException("Failed to clone $name: ".PHP_EOL.$out); + }, ConfigFacade::packagesPath()); + + return $this->packageExists($name); + } + + /** + * Clones all supported PM4 packages to the local package directory + * + * @param bool $force + * + * @return array + */ + public function cloneAllPackages(bool $force = false): array + { + // Clear the ProcessMaker packages directory before + // we start cloning the new ones down + if ($force) { + foreach ($this->getPackages() as $package) { + FileSystemFacade::rmdir($package['path']); + } + } + + // Clone down the processmaker/packages meta-package to + // to make sure we can reference all official supported + // ProcessMaker 4 enterprise packages + if (!$this->packageExists('packages')) { + $this->clonePackage('packages'); + } + + return $this->getSupportedPackages(); + } + + /** + * @param string $name + * + * @return bool + */ + public function packageExists(string $name): bool + { + if (Str::contains($name, 'processmaker/')) { + $name = Str::replace('processmaker/', '', $name); + } + + return in_array($name, $this->getPackagesListFromDirectory(), true); + } + + /** + * Get the names of the local composer packages + * + * @param string|null $package_directory + * + * @return array + */ + public function getPackagesListFromDirectory(string $package_directory = null): array + { + if (!is_string($package_directory)) { + $package_directory = ConfigFacade::packagesPath(); + } + + return array_filter(FileSystemFacade::scandir($package_directory), function ($dir) use($package_directory) { + + // Set the absolute path to the file or directory + $dir = $package_directory.'/'.$dir; + + // Filter out any non-directory files + return FileSystemFacade::isDir($dir) && !is_file($dir); + }); + } + + /** + * Returns an multi-dimensional array with + * each package name and path + * + * @return array + */ + public function getPackages(): array + { + $packages = array_map(function ($package_name) { + return [ + 'name' => $package_name, + 'path' => ConfigFacade::packagesPath() . "/$package_name" + ]; + }, $this->getPackagesListFromDirectory()); + + return collect($packages)->keyBy('name')->toArray(); + } + + /** + * Get the package version number for a package + * + * @param string $package_directory + * + * @return string + */ + public function getPackageVersion(string $package_directory): string + { + $composer_json = ComposerFacade::getComposerJson($package_directory) ?? new class {}; + + if (!property_exists($composer_json, 'version')) { + return '...'; + } + + return $composer_json->version; + } + + /** + * @param string $path + * + * @return string + */ + public function getCurrentGitBranchName(string $path): string + { + if (!FileSystemFacade::isDir($path)) { + return '...'; + } + + // Run this command and get the current git branch + $branch = CommandLineFacade::runAsUser('git rev-parse --abbrev-ref HEAD', null, $path); + + // Remove unnecessary end of line character(s) + return Str::replace(["\n", PHP_EOL], "", $branch); + } + + /** + * @param bool $verbose + * + * @throws \Illuminate\Contracts\Container\BindingResolutionException + */ + public function pull41(bool $verbose = false) + { + $this->pull($verbose, '4.1-develop'); + } + + /** + * Stores basic package metadata on this class instance. Used to store metadata + * prior to running the pull() method for comparisons afterwards. + * + * @param bool $updated + * @param array $metadata Any package metadata to start with + * + * @return array + */ + public function takePackagesSnapshot(bool $updated = false, array $metadata = []): array + { + foreach ($this->getPackages() as $package) { + + $path = $package['path']; + $version_key = $updated ? 'updated_version' : 'version'; + $branch_key = $updated ? 'updated_branch' : 'branch'; + $hash_key = $updated ? 'updated_commit_hash' : 'commit_hash'; + + $metadata[$package['name']] = [ + 'name' => $package['name'], + $version_key => $this->getPackageVersion($path), + $branch_key => $this->getCurrentGitBranchName($path), + $hash_key => GitFacade::getCurrentCommitHash($path) + ]; + } + + return $metadata; + } + + /** + * @param string $branch + * @param array $commands + * + * @return array + */ + public function buildPullCommands(string $branch, array $commands = []): array + { + foreach ($this->getPackages() as $package) { + $package_commands = [ + 'git reset --hard', + 'git clean -d -f .', + "git checkout $branch", + 'git fetch --all', + 'git pull --force', + ]; + + $commands[$package['name']] = array_map(function ($command) use ($package) { + return CommandLineFacade::transformCommandToRunAsUser($command, $package['path']); + }, $package_commands); + } + + return $commands; + } + + /** + * @param bool $verbose + * @param string|null $branch + * + * @throws \Illuminate\Contracts\Container\BindingResolutionException + */ + public function pull(bool $verbose = false, string $branch = null): void + { + // A quick command (thanks Nolan!) to grab the default branch + $get_default_git_branch = "$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"; + + // Build the commands for each package (keyed by package name) + $commands = $this->buildPullCommands($branch ?? $get_default_git_branch); + + // Store the pre-pull metadata for each package + $metadata = $this->takePackagesSnapshot(); + + // Create a new ProcessManagerFacade instance to run the + // git commands in parallel where possible + $processManager = resolve(ProcessManager::class); + + // Set verbosity for output to stdout + $processManager->setVerbosity($verbose); + + // Set a closure to be called when the final process exits + $processManager->setFinalCallback(function () use ($metadata) { + $this->outputPullResults($metadata); + }); + + // Build the process queue and run + $processManager->buildProcessesBundleAndStart($commands); + } + + /** + * @return array + */ + public function getPackagesTableData(): array + { + $table = []; + + // Build the table rows by merging the compare-with + // package metadata with a recent snapshot + foreach ($this->takePackagesSnapshot() as $package => $updated) { + $table[$package] = $updated; + } + + // Sort the columns in a more sensible way + foreach ($table as $key => $row) { + $table[$key] = [ + 'name' => ''.$row['name'].'', + 'version' => $row['version'], + 'branch' => $row['branch'], + 'commit_hash' => $row['commit_hash'], + ]; + } + + return $table; + } + + /** + * @param array $pre_pull_package_metadata + */ + public function outputPullResults(array $pre_pull_package_metadata) + { + $table = []; + + // Build the table rows + foreach ($this->takePackagesSnapshot(true) as $package => $updated) { + $table[$package] = array_merge($pre_pull_package_metadata[$package], $updated); + } + + // Sort the columns in a more sensible way + foreach ($table as $key => $row) { + $table[$key] = [ + 'name' => $row['name'], + 'version' => $row['version'], + 'updated_version' => $row['updated_version'], + 'branch' => $row['branch'], + 'updated_branch' => $row['updated_branch'], + 'commit_hash' => $row['commit_hash'], + 'updated_commit_hash' => $row['updated_commit_hash'] + ]; + } + + // Add console styling + foreach ($table as $key => $row) { + + // Highlight the package name + $table[$key]['name'] = ''.$row['name'].''; + + // If the versions are the same, no updated occurred. + // If they are different, let's make it easier to see. + if ($row['version'] !== $row['updated_version']) { + $table[$key]['updated_version'] = ''.$row['updated_version'].''; + } + + // Do the same thing with branches, since we may + // have switch to 4.1 or 4.2 during the pull, which + // is set by the user by adding a flag to the command + if ($row['branch'] !== $row['updated_branch']) { + $table[$key]['updated_branch'] = ''.$row['updated_branch'].''; + } + + // One more time to see if the commit hash has changed + if ($row['commit_hash'] !== $row['updated_commit_hash']) { + $table[$key]['updated_commit_hash'] = ''.$row['updated_commit_hash'].''; + } + } + + // Add a new line for space above the table + output(PHP_EOL); + + // Format our results in an easy-to-ready table + table(['Name', 'Version ->', '-> Version', 'Branch ->', '-> Branch', 'Hash ->', '-> Hash'], $table); + } + + /** + * Build the stack of commands to composer require and + * install each enterprise ProcessMaker 4 package + * + * @param bool $for_41_develop + * @param bool $force + * + * @return \Illuminate\Support\Collection + */ + public function buildPackageInstallCommands(bool $for_41_develop = false, bool $force = false): Collection + { + if (!FileSystemFacade::isDir(ConfigFacade::codebasePath())) { + throw new LogicException('Could not find ProcessMaker codebase: '. ConfigFacade::codebasePath()); + } + + // Find out which branch to switch to in the local + // processmaker/processmaker codebase + $branch = $for_41_develop ? '4.1-develop' : 'develop'; + + // Find out which branch we're on + $current_branch = GitFacade::getCurrentBranchName(ConfigFacade::codebasePath()); + + // Make sure we're on the right branch + if ($current_branch !== $branch && ! $force) { + throw new DomainException("Core codebase branch should be \"$branch\" but \"$current_branch\" was found."); + } + + // Grab the list of supported enterprise packages + $enterprise_packages = new Collection($this->getSupportedPackages(true)); + + if ($for_41_develop) { + // Filter out any packages not on the 4.1-develop + // branch which aren't compatible with 4.1 + $enterprise_packages = $enterprise_packages->reject(function ($package) { + if ($package === 'docker-executor-node-ssr') { + return false; + } + + return '4.1-develop' !== GitFacade::getCurrentBranchName($this->getPackagePath($package)); + }); + } + + // Key by package name + $enterprise_packages = $enterprise_packages->keyBy(static function ($package, $index) { + return $package; + }); + + // Build the stack of commands to run + return $enterprise_packages->transform(static function (string $package) { + return new Collection([ + "composer require processmaker/$package --no-interaction", + PHP_BINARY." artisan $package:install --no-interaction", + PHP_BINARY." artisan vendor:publish --tag=$package --no-interaction" + ]); + }); + } + + public function getEnterprisePackages() + { + $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); + $composer = json_decode($composer, true); + $list = Arr::get($composer, 'extra.processmaker.enterprise', []); + return collect(array_keys($list)); + } + + public function getJavascriptPackages($path) + { + $composer = FileSystem::get($path . '/package.json'); + $composer = json_decode($composer, true); + $list = Arr::get($composer, 'dependencies', []); + return collect(array_keys($list))->filter(function($package) { + return Str::startsWith($package, '@processmaker/'); + })->map(function($package) { + return str_replace('@processmaker/', '', $package); + })->filter(function($package) { + return PackagesCi::getBranch($package); + }); + } +} diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php new file mode 100644 index 0000000..30c4144 --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -0,0 +1,413 @@ + 'npm run build-bundle', + "screen-builder" => 'npm run build-bundle', + "vue-form-elements" => 'npm run build-bundle', + ]; + + private $cacheManifest; + private $remoteShas = []; + private $gitHubContext; + + public function build() + { + $this->buildCore(); + $this->buildPackages(); + } + + public function buildJavascript() + { + $javascriptPackages = Packages::getJavascriptPackages(Config::codebasePath()); + $this->installJavascriptPackages($javascriptPackages); + $this->npmRunDev(); + } + + public function install() + { + $this->installCore(); + $list = Packages::getEnterprisePackages(); + $list = $this->orderList($list); + foreach ($list as $package) { + info("Artisan installing $package"); + $this->artisanInstall($package); + } + + $this->artisanCommand('optimize:clear'); + $this->artisanCommand('horizon:terminate'); + + info("Modifying phpunit.xml to add package tests"); + PhpUnit::addTests(PhpUnit::configFile()); + $this->copyDatabase(Config::env('DB_DATABASE'), 'test'); + + info("Done"); + } + + public function shouldUseCache($package) + { + info("Checking cache for package $package"); + return $this->remoteSha($package) === $this->cachedSha($package); + } + + public function fetchBranchSha($package, $branch = null) + { + if (!$branch) { + $branch = 'HEAD'; + } + + $token = Config::env('GITHUB_TOKEN'); + $sha = CommandLine::mustRun("git ls-remote https://${token}@github.com/processmaker/$package $branch | awk '{ print $1}'"); + return trim($sha); + } + + public function setCache($package) + { + if ($package === 'processmaker') { + $from = Config::codebasePath(); + } else { + $from = Config::packagesPath($package); + } + $to = Config::cachePath() . '/' . $package; + $this->copy($from, $to); + $this->updateManifest($package); + } + + public function restoreCache($package) + { + if ($package === 'processmaker') { + $to = Config::codebasePath(); + } else { + $to = Config::packagesPath($package); + } + $from = Config::cachePath() . '/' . $package; + $this->copy($from, $to); + } + + public function copy($from, $to) + { + CommandLine::mustRun("mkdir -p $to"); + CommandLine::mustRun("ls -A1 | xargs rm -rf", $to); + CommandLine::mustRun("rsync -r --exclude='/node_modules' --exclude='/vendor' ${from}/ ${to}"); + } + + private function cachedSha($package) + { + $manifest = $this->getCacheManifest(); + if (isset($manifest[$package])) { + return $manifest[$package]; + } + return null; + } + + private function remoteSha($package) + { + if (isset($this->remoteShas[$package])) { + $sha = $this->remoteShas[$package]; + } else { + $sha = $this->fetchBranchSha($package, $this->getBranch($package)); + $this->remoteShas[$package] = $sha; + } + return $sha; + } + + private function getCacheManifest() + { + if ($this->cacheManifest) { + return $this->cacheManifest; + } + $manifest = []; + if (FileSystem::exists(Config::cacheManifestPath())) { + $manifest = json_decode(FileSystem::get(Config::cacheManifestPath()), true); + } + $this->cacheManifest = $manifest; + return $manifest; + } + + private function updateManifest($package) + { + $manifest = $this->getCacheManifest(); + $manifest[$package] = $this->remoteSha($package); + $this->cacheManifest = $manifest; + $manifest = json_encode($manifest); + FileSystem::put(Config::cacheManifestPath(), $manifest); + } + + private function composerRequireList($list) + { + return $list->map(function($package) { + return "processmaker/$package"; + })->join(" "); + } + + // private function installPackagesPackage() + // { + // Git::clone('packages', Config::packagesPath()); + // Composer::addRepositoryPath('packages'); + // Composer::require('processmaker/packages'); + // $this->artisanInstall('packages'); + // } + + private function artisanInstall($package) + { + return $this->artisanCommand("${package}:install"); + } + + private function artisanCommand($cmd) + { + return CommandLine::runCommand("php artisan ${cmd}", function($code, $output) { + throw new \Exception($output); + }, Config::codebasePath()); + } + + public function getBranch($package) + { + if (!$this->branches) { + $this->setBranches(); + } + if (isset($this->branches[$package])) { + return $this->branches[$package]; + } + + return null; + } + + private function setBranches() + { + $result = preg_match_all('/ci:(.+?):(.+?)(\s|$)/', $this->pullRequestBody(), $matches); + if ($result && $result > 0) { + $this->branches = array_combine($matches[1], $matches[2]); + } else { + $this->branches = []; + } + $this->branches[$this->repoName()] = $this->pullRequestBranch(); + } + + private function pullRequestBody() + { + return Arr::get($this->getGitHubContext(), 'body', ''); + } + + private function pullRequestBranch() + { + return Arr::get($this->getGitHubContext(), 'head.ref', ''); + } + + private function repoName() + { + return Arr::get($this->getGitHubContext(), 'head.repo.name', ''); + } + + private function getGitHubContext() + { + if ($this->gitHubContext) { + return $this->gitHubContext; + } + if (Config::env('GITHUB_CONTEXT', true)) { + $this->gitHubContext = json_decode(Config::env('GITHUB_CONTEXT'), true); + } + return $this->gitHubContext; + } + + private function installCommand() + { + extract($_ENV); + if ($PM_APP_PORT !== "80") { + $portWithPrefix = ":${PM_APP_PORT}"; + } + + return <<cloneCore(); + CommandLine::mustRun('composer install --no-interaction', Config::codebasePath()); + } + + private function buildPackages() + { + info("Installing enterprise packages for CI"); + $list = Packages::getEnterprisePackages(); + + info("Cloning " . $list->count() . " packages"); + foreach ($list as $package) { + $branch = $this->getBranch($package); + $info = "Cloning $package"; + if ($branch) { + $info .= " with branch $branch"; + } + info($info); + Git::shallowClone($package, $branch, Config::packagesPath($package)); + } + + foreach ($list as $package) { + info("Registering local repository path for $package"); + Composer::addRepositoryPath($package); + } + + info("Composer requiring packages"); + $listString = $this->composerRequireList($list); + Composer::require($listString); + } + + private function installCore() + { + $this->createDatabase(Config::env('DB_DATABASE')); + CommandLine::mustRun($this->installCommand(), Config::codebasePath()); + FileSystem::append(Config::codebasePath() . '/.env', $this->additionalEnv()); + } + + private function cloneCore() + { + $pm = 'processmaker'; + info("Cloning processmaker core"); + Git::shallowClone($pm, $this->getBranch($pm), Config::codebasePath()); + } + + public function databaseConnectionParams() + { + extract($_ENV); + return "-h $DB_HOSTNAME -P $DB_PORT -u $DB_USERNAME -p'${DB_PASSWORD}'"; + } + + public function createDatabase($name) + { + $connection = $this->databaseConnectionParams(); + CommandLine::mustRun("mysql $connection -e 'DROP DATABASE IF EXISTS `$name`;'"); + CommandLine::mustRun("mysql $connection -e 'CREATE DATABASE `$name`;'"); + } + + public function copyDatabase($from, $to) + { + $connection = $this->databaseConnectionParams(); + $file = tempnam(sys_get_temp_dir(), 'dump'); + CommandLine::mustRun("mysqldump $connection $from > $file"); + $this->createDatabase($to); + CommandLine::mustRun("mysql $connection $to < $file"); + } + + private function clonePackage($package) + { + Git::shallowClone($package, $this->getBranch($package), Config::packagesPath($package)); + } + + private function installJavascriptPackages($packages) + { + $packagesToBuild = []; + foreach ($packages as $package) { + + // Only clone/build/link if specified in the PR + // Otherwise, just use core's package.json + if (!$this->getBranch($package)) { + continue; + } + + $path = Config::packagesPath($package); + $this->clonePackage($package); + + // unsafe-perm is needed to run postinstall scripts as root + CommandLine::mustRun("npm install --unsafe-perm", $path); + $packagesToBuild[] = $package; + } + + foreach ($packagesToBuild as $package) { + $this->linkDependentPackages(Config::packagesPath($package)); + $this->buildJavascriptPackage($package); + } + + return count($packagesToBuild); + } + + private function linkDependentPackages($path) + { + $dependentPackages = Packages::getJavascriptPackages($path); + foreach ($dependentPackages as $dependentPackage) { + CommandLine::mustRun("mkdir -p node_modules/@processmaker", $path); + $packagePath = Config::packagesPath($dependentPackage); + $nodeModulesPackagePath = "node_modules/@processmaker/${dependentPackage}"; + CommandLine::mustRun("rm -rf $nodeModulesPackagePath", $path); + CommandLine::mustRun("ln -s $packagePath $nodeModulesPackagePath", $path); + } + } + + private function buildJavascriptPackage($package) + { + if (isset($this->javascriptPackageBuildCommands[$package])) { + $cmd = $this->javascriptPackageBuildCommands[$package]; + CommandLine::mustRun($cmd, Config::packagesPath($package)); + } + CommandLine::mustRun('rm -rf node_modules', Config::packagesPath($package)); + } + + private function npmRunDev() + { + // unsafe-perm is needed to run postinstall scripts as root + info("Starting at " . date('c')); + CommandLine::mustRun('npm ci --unsafe-perm', Config::codebasePath()); + $this->linkDependentPackages(Config::codebasePath()); + CommandLine::mustRun('npm run dev', Config::codebasePath()); + info("Finished at " . date('c')); + } + + private function orderList($list) + { + $list = $list->filter(function($item) { + return !in_array($item, ['connector-docusign', 'connector-pdf-print', 'package-vocabularies', 'package-data-sources']); + }); + $list->prepend('package-data-sources'); + $list->prepend('package-vocabularies'); + $list->push('connector-pdf-print'); + $list->push('connector-docusign'); + return $list; + } +} diff --git a/pm4-tools/cli/ProcessMaker/PhpUnit.php b/pm4-tools/cli/ProcessMaker/PhpUnit.php new file mode 100644 index 0000000..3401c2c --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/PhpUnit.php @@ -0,0 +1,43 @@ +preserveWhiteSpace = false; + $dom->formatOutput = true; + $dom->load($path); + + $xpath = new DOMXpath($dom); + $directories = $xpath->query('//testsuite[@name="Features"]')[0]; + + foreach ($list as $package) + { + $testsDirectory = Config::packagesPath($package) . "/tests"; + if (FileSystem::exists($testsDirectory)) { + $directory = $dom->createElement('directory', $testsDirectory); + $directories->appendChild($directory); + } + } + + return $dom->save($path); + } + + public function configFile() + { + return Config::codebasePath() . '/phpunit.xml'; + } + +} \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/ProcessManager.php b/pm4-tools/cli/ProcessMaker/ProcessManager.php new file mode 100644 index 0000000..fb2895c --- /dev/null +++ b/pm4-tools/cli/ProcessMaker/ProcessManager.php @@ -0,0 +1,292 @@ +cli = $cli; + $this->processCollections = $processCollections; + $this->outputCollection = $outputCollection; + } + + public function setVerbosity(bool $verbose) + { + $this->verbose = $verbose; + } + + public function getProcessOutput(string $key = null): Collection + { + return $key ? $this->outputCollection->get($key) : $this->outputCollection; + } + + public function addProcessOutput(string $key, $output) + { + if (!$this->getProcessOutput()->has($key)) { + $this->getProcessOutput()->put($key, new Collection); + } + + $this->getProcessOutput($key)->push($output); + } + + public function findProcessExitCode(string $key): int + { + if (!$output = $this->getProcessOutput($key)) { + return 1; + } + + // Search through the output for the array + // containing the exit code value + $exitCode = $output->reject(function ($line) { + return ! is_array($line) || ! array_key_exists('exit_code', $line); + }); + + // If we can't find it, assume the process + // exited with a general error + if ($exitCode->isNotEmpty()) { + return $exitCode->flatten()->first() ?? 1; + } + + return 1; + } + + /** + * @param string $key + * + * @return Collection + */ + public function getProcessCollections(string $key): Collection + { + if (!$this->processCollections->get($key) instanceof Collection) { + $this->processCollections->put($key, new Collection()); + } + + return $this->processCollections->get($key); + } + + /** + * @param array $commands + */ + public function buildProcessesBundleAndStart(array $commands) + { + $this->startProcessesBundle($this->buildProcessesBundle($commands)); + } + + /** + * @param array $commands + * + * @return \Illuminate\Support\Collection + */ + public function buildProcessesBundle(array $commands): Collection + { + $commands = array_filter($commands, function ($command) { + return !is_string($command); + }); + + if (blank($commands)) { + throw new LogicException('Commands array cannot be empty'); + } + + $bundles = collect($commands)->transform(function (array $set) { + return collect(array_map(function ($command) { + return new Process($command); + }, $set)); + }); + + return $this->setExitListeners($bundles); + } + + /** + * @param \Illuminate\Support\Collection $bundles + * + * @return \Illuminate\Support\Collection + */ + private function setExitListeners(Collection $bundles): Collection + { + // Set each Process to start the next process + // in the bundle when it exists + $bundles->each(function (Collection $bundle) { + return $bundle->transform(function (Process $process, $index) use (&$bundle) { + + $process->on('exit', function ($exitCode, $termSignal) use (&$bundle, $process, $index) { + + if (!$this->verbose) { + $this->cli->getProgress()->advance(); + } + + // Add to the "exited" process collection + $this->getProcessCollections('exited')->push($process); + + // Get the info we need to output to stdout + $pid = $process->getPid(); + $command = $process->getCommand(); + + if ($this->verbose) { + if ($exitCode === 0) { + output("$pid: $command"); + } else { + output("$pid: $command"); + } + } + + // Add to the process collections + if ($exitCode === 0) { + $this->getProcessCollections('successful')->push($process); + } else { + $this->getProcessCollections('errors')->push($process); + } + + // Add to the processOutput property for reading later + $this->addProcessOutput($process->getCommand(), ['exit_code' => $exitCode]); + + // Find the next process to run + $next_process = $bundle->get($index + 1); + + // If one exists, run it + if ($next_process instanceof Process) { + $this->startProcessAndPipeOutput($next_process); + } + + $queued = $this->getProcessCollections('queued')->count(); + $exited = $this->getProcessCollections('exited')->count(); + + // All processes are finished + if ($queued === $exited) { + // Keeps the stdout clean during verbose mode + if (!$this->verbose) { + $this->cli->getProgress()->finish(); + } + + // Last but not least, run the bound callback + $this->getFinalCallback(); + } + }); + + return $process; + }); + }); + + return $bundles; + } + + public function getFinalCallback() + { + if (is_callable($this->finalCallback)) { + return call_user_func($this->finalCallback); + } + } + + public function setFinalCallback(callable $callback) + { + $this->finalCallback = $callback; + } + + /** + * @param \Illuminate\Support\Collection $bundle + * + * @return \Illuminate\Support\Collection + */ + private function validateBundle(Collection $bundle): Collection + { + return $bundle->reject(function ($process) { + return ! $process instanceof Process; + }); + } + + /** + * @param \Illuminate\Support\Collection $bundles + */ + public function startProcessesBundle(Collection $bundles): void + { + $bundles->transform(function (Collection $bundle) { + return $this->validateBundle($bundle); + }); + + if ($bundles->isEmpty()) { + throw new LogicException('No bundles of Processes found'); + } + + $this->setProcessIndexes($bundles); + + $this->getStartProcesses($bundles)->each(function (Process $process) { + $this->startProcessAndPipeOutput($process); + }); + } + + /** + * @param \Illuminate\Support\Collection $bundles + * + * @return \Illuminate\Support\Collection + */ + private function getStartProcesses(Collection $bundles): Collection + { + return $this->validateBundle( + $bundles->map(function (Collection $bundle) { + return $bundle->first(); + }) + ); + } + + /** + * @param \Illuminate\Support\Collection $bundles + * + * @return void + */ + private function setProcessIndexes(Collection $bundles): void + { + $index = 0; + $total_processes = 0; + + // Count up all of the processes + $bundles->each(function ($bundle) use (&$total_processes) { + $total_processes += $bundle->count(); + }); + + // Set the "process_index" property for each + // process among each bundle + $bundles->each(function ($bundle) use (&$index) { + $bundle->transform(function (Process $process) use (&$index) { + $process->index = $index++; + + $this->getProcessCollections('queued')->push($process); + + return $process; + }); + }); + + if (!$this->verbose) { + $this->cli->getProgress($total_processes); + } + } + + /** + * @param \React\ChildProcess\Process $process + */ + private function startProcessAndPipeOutput(Process $process): void + { + if ($process->isRunning()) { + return; + } + + $process->start(); + + $process->stdout->on('data', function ($output) use (&$process) { + $this->addProcessOutput($process->getCommand(), $output); + }); + + $this->getProcessCollections('started')->push($process); + } +} diff --git a/pm4-tools/cli/pm.php b/pm4-tools/cli/pm.php new file mode 100644 index 0000000..6e6067f --- /dev/null +++ b/pm4-tools/cli/pm.php @@ -0,0 +1,297 @@ +#!/usr/bin/env php +load(); +} + +Container::setInstance(new Container); + +$app = new Application('ProcessMaker CLI Tool', '0.5.0'); + +if (!FileSystem::isDir(PM_HOME_PATH)) { + /* + * -------------------------------------------------+ + * | | + * | Command: Install Cli | + * | | + * -------------------------------------------------+ + */ + $app->command('install-cli', function (InputInterface $input, OutputInterface $output) { + + // First thing we want to do is ask the user to + // tell us the absolute path to the core codebase + $helper = $this->getHelperSet()->get('question'); + + // Callback to autocomplete the directories available + // as the user is typing + $callback = function (string $userInput): array { + + $inputPath = preg_replace('%(/|^)[^/]*$%', '$1', $userInput); + $inputPath = '' === $inputPath ? '.' : $inputPath; + $foundFilesAndDirs = @scandir($inputPath) ?: []; + + return array_map(static function ($dirOrFile) use ($inputPath) { + return $inputPath.$dirOrFile; + }, $foundFilesAndDirs); + }; + + $question = "Please enter the absolute path to the local copy of the processmaker/processmaker codebase:".PHP_EOL; + $question = new Question($question); + $question->setAutocompleterCallback($callback); + $codebase_path = $helper->ask($input, $output, $question); + + // Make sure they entered something + if (null === $codebase_path) { + warningThenExit('You must enter a valid absolute path to continue the installation. Please try again.'); + } + + // Check for composer.json + if (!FileSystem::exists("$codebase_path/composer.json")) { + warningThenExit("Could not the composer.json for processmaker/processmaker in: $codebase_path"); + } + + // Next we need to know where all of the local copies + // of the processmaker/* packages will be stored + $question = "Please enter the absolute path to the directory where local copies of the ProcessMaker packages will be stored::".PHP_EOL; + $question = new Question($question); + $question->setAutocompleterCallback($callback); + $packages_path = $helper->ask($input, $output, $question); + + // Make sure they entered something + if (null === $packages_path) { + warningThenExit('You must enter a valid absolute path to continue the installation. Please try again.'); + } + + // Creates the sudoers entry and the base config file/directory + Install::install($codebase_path, $packages_path); + + info('Installation complete!'); + + })->descriptions('Runs the installation process for this tool. Necessary before other commands will appear.'); + +} else { + + /* + * -------------------------------------------------+ + * | | + * | Command: Install Packages | + * | | + * -------------------------------------------------+ + */ + $app->command('install-packages [-4|--for_41_develop]', function (InputInterface $input, OutputInterface $output) { + + // Indicates if we should install the 4.1-develop + // versions of each package or the 4.2 + $for_41_develop = $input->getOption('for_41_develop'); + + // Should the output be verbose or not + $verbose = $input->getOption('verbose'); + + // Use an anonymous function to we can easily re-run if + // we decide to force the installation of the packages + $build_install_commands = static function ($force = false) use ($for_41_develop) { + return Packages::buildPackageInstallCommands($for_41_develop, $force); + }; + + // Builds an array of commands to run in the local + // processmaker/processmaker codebase to require + // each supported package, then install it and + // publish it's vendor assets (if any are available) + try { + $install_commands = $build_install_commands(); + } catch (DomainException $exception) { + + // Show the user the incompatible branch information + warning($exception->getMessage()); + + // Ask the user if they want to force the install anyway + $helper = $this->getHelperSet()->get('question'); + $question = new ConfirmationQuestion('Force install the packages? "No" to abort or "Yes" to proceed: ', false); + + // Bail out if they user doesn't want to force the install + if (false === $helper->ask($input, $output, $question)) { + warningThenExit('Packages install aborted.'); + } + + // Re-run the install but add the force argument to + // prevent the incompatible exception from being thrown + $install_commands = $build_install_commands(true); + } + + // Grab an instance of the CommandLine class + $cli = resolve(\ProcessMaker\Cli\CommandLine::class); + + // Create a progress bar and start it + $cli->createProgressBar($install_commands->flatten()->count(), 'message'); + + // Set the initial message and start up the progress bar + $cli->getProgress()->setMessage('Starting install...'); + $cli->getProgress()->start(); + + // Iterate through the collection of commands + foreach ($install_commands as $package => $command_collection) { + + // Iterate through each command and attempt to run it + foreach ($command_collection as $command) { + + // Update the progress bar + $cli->getProgress()->setMessage("Installing $package..."); + $cli->getProgress()->advance(); + + try { + $command_output = $cli->runAsUser($command, static function ($exitCode, $out) { + throw new RuntimeException($out); + }, Config::codebasePath()); + } catch (RuntimeException $exception) { + + $cli->getProgress()->clear(); + + output("Command Failed: $command"); + output($exception->getMessage()); + + $cli->getProgress()->display(); + + continue; + } + + if (!$verbose) { + continue; + } + + // If the user wants verbose output, then show the + // stdout for all of the successful commands as well + // (in addition to the ones which failed) + $cli->getProgress()->clear(); + + output("Command Success: $command"); + output($command_output); + + $cli->getProgress()->display(); + } + } + + // Clean up the progress bar + $cli->getProgress()->finish(); + $cli->getProgress()->clear(); + + // See how long it took to run everything + $timing = $cli->timing(); + + // Output and we're done! + output(PHP_EOL."Finished in $timing"); + + })->descriptions('Installs all enterprise packages in the local ProcessMaker core (processmaker/processmaker) codebase.', [ + '--for_41_develop' => 'Uses 4.1 version of the supported packages' + ]); + + /* + * -------------------------------------------------+ + * | | + * | Command: Packages | + * | | + * -------------------------------------------------+ + */ + $app->command('packages', function () { + + table(['Name', 'Version', 'Branch', 'Commit Hash'], Packages::getPackagesTableData()); + + })->descriptions('Display the current version, branch, and names of known local packages'); + + /* + * -------------------------------------------------+ + * | | + * | Command: Pull | + * | | + * -------------------------------------------------+ + */ + $app->command('pull [-4|--for_41_develop]', function (InputInterface $input, OutputInterface $output) { + + // Updates to 4.1-branch of packages (or not) + $for_41_develop = $input->getOption('for_41_develop'); + + // Set verbosity level of output + $verbose = $input->getOption('verbose'); + + // Put everything together and run it + $for_41_develop ? Packages::pull41($verbose) : Packages::pull($verbose); + + })->descriptions('Cycles through each local store of supported ProcessMaker 4 packages.', + ['--for_41_develop' => 'Change each package to the correct version for the 4.1 version of processmaker/processmaker'] + ); + + /* + * -------------------------------------------------+ + * | | + * | Command: Clone All | + * | | + * -------------------------------------------------+ + */ + $app->command('clone-all [-f|--force]', function ($force = null) { + foreach (Packages::getSupportedPackages() as $index => $package) { + try { + if (Packages::clonePackage($package)) { + info("Package $package cloned successfully!"); + } + } catch (Exception $exception) { + warning($exception->getMessage()); + } + } + })->descriptions('Clone all supported ProcessMaker 4 packages to a local directory', [ + '--force' => 'Delete the package locally if it exists already' + ]); + +} + +/* +* -------------------------------------------------+ +* | | +* | Command: Install Packages CI | +* | | +* -------------------------------------------------+ +*/ +$app->command('build-ci', function() { + PackagesCi::build(); +}); + +$app->command('build-javascript-ci', function() { + PackagesCi::buildJavascript(); +}); + +$app->command('install-ci', function() { + PackagesCi::install($this); +}); + +$app->command('test-runner', function() { +}); + +$app->run(); diff --git a/pm4-tools/composer.json b/pm4-tools/composer.json new file mode 100644 index 0000000..b8567fa --- /dev/null +++ b/pm4-tools/composer.json @@ -0,0 +1,41 @@ +{ + "name": "processmaker/pm4-tools", + "description": "A lightweight cli tool to aid local develop of ProcessMaker software", + "type": "project", + "license": "MIT", + "bin": ["pm"], + "version": "0.5.0", + "authors": [ + { + "name": "Alex Runyan", + "email": "alex@runyan.co" + } + ], + "require": { + "php": ">=7.2", + "ext-json": "*", + "ext-posix": "*", + "illuminate/support": "^8.73", + "illuminate/container": "^8.73", + "mnapoli/silly": "^1.7", + "react/child-process": "^0.6.4", + "symfony/process": "^5.3", + "symfony/console": "^5.3", + "mockery/mockery": "^1.4", + "phpunit/phpunit": "^9.5", + "vlucas/phpdotenv": "^5.4", + "brianium/paratest": "^6.4" + }, + "require-dev": { + "beyondcode/laravel-dump-server": "^1.7" + }, + "autoload": { + "files": [ + "includes/facades.php", + "includes/helpers.php" + ], + "psr-4": { + "ProcessMaker\\Cli\\": "cli/ProcessMaker/" + } + } +} diff --git a/pm4-tools/composer.lock b/pm4-tools/composer.lock new file mode 100644 index 0000000..c26eb77 --- /dev/null +++ b/pm4-tools/composer.lock @@ -0,0 +1,5762 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "ca1dfce4af07399a8852edf970504a2e", + "packages": [ + { + "name": "brianium/paratest", + "version": "v6.4.1", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "c32a5c4fc2ff339202437d25d19a5f496f880d61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/c32a5c4fc2ff339202437d25d19a5f496f880d61", + "reference": "c32a5c4fc2ff339202437d25d19a5f496f880d61", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "php": "^7.3 || ^8.0", + "phpunit/php-code-coverage": "^9.2.9", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-timer": "^5.0.3", + "phpunit/phpunit": "^9.5.10", + "sebastian/environment": "^5.1.3", + "symfony/console": "^5.4.0 || ^6.0.0", + "symfony/process": "^5.4.0 || ^6.0.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0.0", + "ekino/phpstan-banned-code": "^0.5.0", + "ergebnis/phpstan-rules": "^0.15.3", + "ext-posix": "*", + "infection/infection": "^0.25.3", + "malukenho/mcbumpface": "^1.1.5", + "phpstan/phpstan": "^0.12.99", + "phpstan/phpstan-deprecation-rules": "^0.12.6", + "phpstan/phpstan-phpunit": "^0.12.22", + "phpstan/phpstan-strict-rules": "^0.12.11", + "squizlabs/php_codesniffer": "^3.6.1", + "symfony/filesystem": "^v5.4.0", + "thecodingmachine/phpstan-strict-rules": "^v0.12.2", + "vimeo/psalm": "^4.13.1" + }, + "bin": [ + "bin/paratest" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v6.4.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2021-12-02T09:12:23+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:16:43+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/master" + }, + "time": "2017-07-23T21:35:13+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "0690bde05318336c7221785f2a932467f98b64ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", + "reference": "0690bde05318336c7221785f2a932467f98b64ca", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2021-11-21T21:41:47+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "illuminate/collections", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "5a018387352afa2af30fd2be0a78c31e93295720" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/5a018387352afa2af30fd2be0a78c31e93295720", + "reference": "5a018387352afa2af30fd2be0a78c31e93295720", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "symfony/var-dumper": "Required to use the dump method (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-07T14:48:29+00:00" + }, + { + "name": "illuminate/container", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/6ac391bb27391706c5f921b85060aa2c4ca03fae", + "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-17T15:04:30+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", + "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-07T08:18:44+00:00" + }, + { + "name": "illuminate/macroable", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "aed81891a6e046fdee72edd497f822190f61c162" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-16T13:57:03+00:00" + }, + { + "name": "illuminate/support", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/f542bb78a8a1013ab33fbe14974c45b2a88993d0", + "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.4|^2.0", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "nesbot/carbon": "^2.53.1", + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.4.8" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-03T15:33:45+00:00" + }, + { + "name": "mnapoli/silly", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/silly.git", + "reference": "66807f87abd2ab8e5708754d70b4b601f5614c32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/silly/zipball/66807f87abd2ab8e5708754d70b4b601f5614c32", + "reference": "66807f87abd2ab8e5708754d70b4b601f5614c32", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "php-di/invoker": "~2.0", + "psr/container": "^1.0", + "symfony/console": "~3.0|~4.0|~5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.12", + "mnapoli/phpunit-easymock": "~1.0", + "phpunit/phpunit": "~6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Silly\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Silly CLI micro-framework based on Symfony Console", + "keywords": [ + "PSR-11", + "cli", + "console", + "framework", + "micro-framework", + "silly" + ], + "support": { + "issues": "https://github.com/mnapoli/silly/issues", + "source": "https://github.com/mnapoli/silly/tree/1.7.2" + }, + "time": "2019-11-26T20:07:27+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "issues": "https://github.com/mockery/mockery/issues", + "source": "https://github.com/mockery/mockery/tree/1.4.4" + }, + "time": "2021-09-13T15:28:59+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.55.2", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.54", + "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2021-12-03T14:59:52+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-di/invoker", + "version": "2.3.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-DI/Invoker.git", + "reference": "5214cbe5aad066022cd845dbf313f0e47aed928f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/5214cbe5aad066022cd845dbf313f0e47aed928f", + "reference": "5214cbe5aad066022cd845dbf313f0e47aed928f", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "psr/container": "^1.0|^2.0" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "mnapoli/hard-mode": "~0.3.0", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Invoker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generic and extensible callable invoker", + "homepage": "https://github.com/PHP-DI/Invoker", + "keywords": [ + "callable", + "dependency", + "dependency-injection", + "injection", + "invoke", + "invoker" + ], + "support": { + "issues": "https://github.com/PHP-DI/Invoker/issues", + "source": "https://github.com/PHP-DI/Invoker/tree/2.3.2" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + } + ], + "time": "2021-07-30T15:05:32+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.8.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2021-12-04T23:24:31+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + }, + "time": "2021-09-10T09:02:12+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.4", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "a778f3fb828d68caf8a9ab6567fd8342a86f12fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/a778f3fb828d68caf8a9ab6567fd8342a86f12fe", + "reference": "a778f3fb828d68caf8a9ab6567fd8342a86f12fe", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.4" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-10-12T10:37:07+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/be6dee480fc4692cec0504e65eb486e3be1aa6f2", + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-07-11T12:31:24+00:00" + }, + { + "name": "react/stream", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-07-11T12:37:55+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3", + "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "5be20b3830f726e019162b26223110c8f47cf274" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", + "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-24T10:02:00+00:00" + }, + { + "name": "symfony/translation", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "6fe32b10e912a518805bc9eafc2a87145773cf13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/6fe32b10e912a518805bc9eafc2a87145773cf13", + "reference": "6fe32b10e912a518805bc9eafc2a87145773cf13", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-17T14:20:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "d4394d044ed69a8f244f3445bcedf8a0d7fe2403" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/d4394d044ed69a8f244f3445bcedf8a0d7fe2403", + "reference": "d4394d044ed69a8f244f3445bcedf8a0d7fe2403", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-filter": "*", + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `Config::env()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2021-11-10T01:08:39+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "80953678b19901e5165c56752d087fc11526017c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", + "reference": "80953678b19901e5165c56752d087fc11526017c", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "packages-dev": [ + { + "name": "beyondcode/laravel-dump-server", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/beyondcode/laravel-dump-server.git", + "reference": "e27c7b942ab62f6ac7168359393d328ec5215b89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beyondcode/laravel-dump-server/zipball/e27c7b942ab62f6ac7168359393d328ec5215b89", + "reference": "e27c7b942ab62f6ac7168359393d328ec5215b89", + "shasum": "" + }, + "require": { + "illuminate/console": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0", + "illuminate/http": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0", + "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0", + "php": ">=7.2.5", + "symfony/var-dumper": "^5.0" + }, + "require-dev": { + "larapack/dd": "^1.0", + "phpunit/phpunit": "^7.0|^9.3" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "BeyondCode\\DumpServer\\DumpServerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "BeyondCode\\DumpServer\\": "src" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "marcel@beyondco.de", + "homepage": "https://beyondco.de", + "role": "Developer" + } + ], + "description": "Symfony Var-Dump Server for Laravel", + "homepage": "https://github.com/beyondcode/laravel-dump-server", + "keywords": [ + "beyondcode", + "laravel-dump-server" + ], + "support": { + "issues": "https://github.com/beyondcode/laravel-dump-server/issues", + "source": "https://github.com/beyondcode/laravel-dump-server/tree/1.7.0" + }, + "time": "2020-12-15T10:57:43+00:00" + }, + { + "name": "illuminate/console", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/console.git", + "reference": "1f952710c671b8ca90bb10be585ebcc94f72166a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/console/zipball/1f952710c671b8ca90bb10be585ebcc94f72166a", + "reference": "1f952710c671b8ca90bb10be585ebcc94f72166a", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4", + "symfony/process": "^5.4" + }, + "suggest": { + "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", + "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", + "illuminate/container": "Required to use the scheduler (^8.0).", + "illuminate/filesystem": "Required to use the generator command (^8.0).", + "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Console package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T14:13:40+00:00" + }, + { + "name": "illuminate/filesystem", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/filesystem.git", + "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", + "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4" + }, + "suggest": { + "ext-ftp": "Required to use the Flysystem FTP driver.", + "illuminate/http": "Required for handling uploaded files (^7.0).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Filesystem package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T14:13:40+00:00" + }, + { + "name": "illuminate/http", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/http.git", + "reference": "9750b34b7df8f5a3ef66328dc10a7a51e5d13f6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/http/zipball/9750b34b7df8f5a3ef66328dc10a7a51e5d13f6c", + "reference": "9750b34b7df8f5a3ef66328dc10a7a51e5d13f6c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4" + }, + "suggest": { + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Http\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Http package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T21:48:40+00:00" + }, + { + "name": "illuminate/session", + "version": "v8.75.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/session.git", + "reference": "c5964a2348354f266fb18aac60eed0b81355c258" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/session/zipball/c5964a2348354f266fb18aac60eed0b81355c258", + "reference": "c5964a2348354f266fb18aac60eed0b81355c258", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4" + }, + "suggest": { + "illuminate/console": "Required to use the session:table command (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Session\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Session package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T14:13:40+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "8433fa3145ac78df88b87a4a539118e950828126" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8433fa3145ac78df88b87a4a539118e950828126", + "reference": "8433fa3145ac78df88b87a4a539118e950828126", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/serializer": "^4.4|^5.0|^6.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "5ef86ac7927d2de08dc1e26eb91325f9ccbe6309" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ef86ac7927d2de08dc1e26eb91325f9ccbe6309", + "reference": "5ef86ac7927d2de08dc1e26eb91325f9ccbe6309", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "e012f16688bcb151e965473a70d8ebaa8b1d15ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/e012f16688bcb151e965473a70d8ebaa8b1d15ea", + "reference": "e012f16688bcb151e965473a70d8ebaa8b1d15ea", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/browser-kit": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", + "twig/twig": "<2.13" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2|^3", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2|^3", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T16:56:53+00:00" + }, + { + "name": "symfony/mime", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "d4365000217b67c01acff407573906ff91bcfb34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/d4365000217b67c01acff407573906ff91bcfb34", + "reference": "d4365000217b67c01acff407573906ff91bcfb34", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<4.4" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.2|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "89ab66eaef230c9cd1992de2e9a1b26652b127b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89ab66eaef230c9cd1992de2e9a1b26652b127b9", + "reference": "89ab66eaef230c9cd1992de2e9a1b26652b127b9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/uid": "^5.1|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.2", + "ext-json": "*", + "ext-posix": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/pm4-tools/includes/facades.php b/pm4-tools/includes/facades.php new file mode 100644 index 0000000..f42eed7 --- /dev/null +++ b/pm4-tools/includes/facades.php @@ -0,0 +1,83 @@ +make(static::containerKey()); + + return call_user_func_array([$resolvedInstance, $method], $parameters); + } +} + +/** + * @see \ProcessMaker\Cli\CommandLine + */ +class CommandLine extends Facade {} + +/** + * @see \ProcessMaker\Cli\FileSystem + */ +class FileSystem extends Facade {} + +/** + * @see \ProcessMaker\Cli\Packages + */ +class Packages extends Facade {} + +/** + * @see \ProcessMaker\Cli\Install + */ +class Install extends Facade {} + +/** + * @see \ProcessMaker\Cli\ProcessManager + */ +class ProcessManager extends Facade {} + +/** + * @see \ProcessMaker\Cli\Composer + */ +class Composer extends Facade {} + +/** + * @see \ProcessMaker\Cli\Git + */ +class Git extends Facade {} + +/** + * @see \ProcessMaker\Cli\PackagesCi + */ +class PackagesCi extends Facade {} + +/** + * @see \ProcessMaker\Cli\Config + */ +class Config extends Facade {} + + +/** + * @see \ProcessMaker\Cli\Config + */ +class PhpUnit extends Facade {} \ No newline at end of file diff --git a/pm4-tools/includes/helpers.php b/pm4-tools/includes/helpers.php new file mode 100644 index 0000000..9596fc9 --- /dev/null +++ b/pm4-tools/includes/helpers.php @@ -0,0 +1,131 @@ +runAsUser('printf $(brew --prefix)')); +// } + +if (!defined('PM_HOME_PATH')) { + define('PM_HOME_PATH', $_SERVER['HOME'] . '/.config/pm'); +} + +if (!defined('USER_HOME')) { + define('USER_HOME', getenv('HOME')); +} + +/** + * @param string $output + * @param int $exitCode + * + * @return string + */ +function warningThenExit(string $output, int $exitCode = 0): string { + return warning($output) . exit($exitCode); +} + +/** + * Resolve the given class from the container. + * + * @param string $class + * + * @return mixed + * @throws \Illuminate\Contracts\Container\BindingResolutionException + */ +function resolve(string $class) { + return Container::getInstance()->make($class); +} + +/** + * Swap the given class implementation in the container. + * + * @param string $class + * @param mixed $instance + * + * @return void + */ +function swap(string $class, $instance) { + Container::getInstance()->instance($class, $instance); +} + +/** + * @return mixed + */ +function user() { + if (! isset($_SERVER['SUDO_USER'])) { + return $_SERVER['USER']; + } + + return $_SERVER['SUDO_USER']; +} + +/** + * Verify that the script is currently running as "sudo". + * + * @return void + * @throws \Exception + */ +function should_be_sudo() { + if (!isset($_SERVER['SUDO_USER'])) { + throw new Exception('This command must be run with sudo.'); + } +} + +/** + * Output the given text to the console. + * + * @param string $output + * + * @return void + */ +function info(string $output) { + $secrets = [ + Config::env('GITHUB_TOKEN', true) + ]; + $output = str_replace($secrets, '****', $output); + output(''.$output.''); +} + +/** + * Output the given text to the console. + * + * @param string $output + * + * @return void + */ +function warning(string $output) { + output('' . $output . ''); +} + +/** + * Output a table to the console. + * + * @param array $headers + * @param array $rows + * @return void + */ +function table(array $headers = [], array $rows = []) { + $table = new Table(new ConsoleOutput); + $table->setHeaders($headers)->setRows($rows); + $table->render(); +} + +/** + * Output the given text to the console. + * + * @param string $output + * + * @return void + */ +function output(string $output) { + if (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] === 'testing') { + return; + } + + (new ConsoleOutput())->writeln($output); +} diff --git a/pm4-tools/phpunit.xml b/pm4-tools/phpunit.xml new file mode 100644 index 0000000..1c9c237 --- /dev/null +++ b/pm4-tools/phpunit.xml @@ -0,0 +1,21 @@ + + + + + ./tests + + + + + + diff --git a/pm4-tools/pm b/pm4-tools/pm new file mode 100755 index 0000000..370125d --- /dev/null +++ b/pm4-tools/pm @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +SOURCE="${BASH_SOURCE[0]}" + +# If the current source is a symbolic link, we need to resolve it to an +# actual directory name. We'll use PHP to do this easier than we can +# do it in pure Bash. So, we'll call into PHP CLI here to resolve. +if [[ -L "$SOURCE" ]]; then + DIR=$(php -r "echo dirname(realpath('$SOURCE'));") +else + DIR="$( cd "$( dirname "$SOURCE" )" && pwd )" +fi + +# If we are in the global Composer "bin" directory, we need to bump our +# current directory up two, so that we will correctly proxy into the +# Valet CLI script which is written in PHP. Will use PHP to do it. +if [ ! -f "$DIR/cli/pm.php" ]; then + DIR=$(php -r "echo realpath('$DIR/../runyan-co/pm');") +fi + +if [[ "$EUID" -ne 0 && "$PM_CI" -ne "true" ]]; then + sudo USER="$USER" --preserve-env "$SOURCE" "$@" + exit +fi + +php "$DIR/cli/pm.php" "$@" From 93898513fde735faf7ecb56135dc9c248b28dd30 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 7 Feb 2022 16:56:03 -0800 Subject: [PATCH 24/71] Remove some env vars --- .env-cicd | 2 -- 1 file changed, 2 deletions(-) diff --git a/.env-cicd b/.env-cicd index 0bdd987..308c5b0 100644 --- a/.env-cicd +++ b/.env-cicd @@ -5,7 +5,6 @@ PM_CI=true PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 -PM_DOCKER_SOCK=/var/run/docker.sock PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost @@ -18,7 +17,6 @@ DB_HOSTNAME=mysql DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=password -DB_DATABASE="processmaker" REDIS_HOST=redis CACHE_PATH="/pm4-cache" HOST_CACHE_PATH="/home/runner/cache" From ebd09469ce3ce45fc6ff79592cf51ae7146e2b83 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 8 Feb 2022 09:56:27 -0800 Subject: [PATCH 25/71] Manually add database name to install command --- build-files/cicd-build-run.sh | 10 +++++----- commit_image.sh | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100755 commit_image.sh diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 0216c44..7b35a0f 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -8,10 +8,10 @@ done composer config --global github-oauth.github.com $GITHUB_TOKEN /code/pm4-tools/pm build-ci -if [ "$BUILD_JAVASCRIPT" = true ] ; then - /code/pm4-tools/pm build-javascript-ci -fi -/code/pm4-tools/pm install-ci + +/code/pm4-tools/pm build-javascript-ci + +DB_DATABASE=processmaker \ + /code/pm4-tools/pm install-ci cd /code/pm4 -vendor/bin/paratest -p 6 diff --git a/commit_image.sh b/commit_image.sh new file mode 100755 index 0000000..ab482d3 --- /dev/null +++ b/commit_image.sh @@ -0,0 +1,3 @@ +set -ex +docker commit $(docker ps -aqlf "name=^pm4core-docker_cicd_run") debug +docker container prune -f From a91645fa0c957a0adc8d0c5c15d32b4070453ffa Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 8 Feb 2022 09:57:08 -0800 Subject: [PATCH 26/71] Re-add unit test call --- build-files/cicd-build-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 7b35a0f..d367dbd 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -15,3 +15,4 @@ DB_DATABASE=processmaker \ /code/pm4-tools/pm install-ci cd /code/pm4 +vendor/bin/paratest -p 6 From 12f42883b8e6e834430a974b26f6bf2268ca4e3a Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 10 Feb 2022 11:19:29 -0800 Subject: [PATCH 27/71] Run database in tmpfs --- docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 887f4f1..850d926 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,10 +66,8 @@ services: environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: processmaker - volumes: - - database:/var/lib/mysql + tmpfs: /var/lib/mysql volumes: - database: redis: storage: \ No newline at end of file From 2c746ee5b8a542817af5d632fc083a0d82c61d5d Mon Sep 17 00:00:00 2001 From: Diego Bruno Flores Salazar Date: Fri, 11 Feb 2022 12:36:17 -0400 Subject: [PATCH 28/71] FOUR-5291: Use env variables instead of github context variables --- .env | 4 +- docker-compose.yml | 22 +- github_context_example.json | 362 ---------------------- pm4-tools/cli/ProcessMaker/PackagesCi.php | 41 +-- set_context_example.sh | 2 +- 5 files changed, 31 insertions(+), 400 deletions(-) delete mode 100644 github_context_example.json diff --git a/.env b/.env index d459e6f..780d771 100644 --- a/.env +++ b/.env @@ -2,4 +2,6 @@ PM_VERSION=4.1.21 PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 -PM_DOCKER_SOCK=/var/run/docker.sock \ No newline at end of file +PM_DOCKER_SOCK=/var/run/docker.sock +CI_PROJECT=processmaker +CI_PACKAGE_BRANCH=develop diff --git a/docker-compose.yml b/docker-compose.yml index 850d926..8154650 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,31 +13,31 @@ services: - .env-cicd links: - redis - - mysql + - mysql depends_on: - mysql - - redis + - redis volumes: - ./cache:/cache - + base: image: processmaker/pm4-base:2.0.0 build: context: . dockerfile: Dockerfile.base - + redis: image: redis volumes: - redis:/data - + debug: image: debug:latest command: bash env_file: - .env-cicd links: - - mysql + - mysql depends_on: - mysql @@ -50,12 +50,14 @@ services: - PM_APP_URL - PM_APP_PORT - PM_BROADCASTER_PORT + - CI_PROJECT + - CI_PACKAGE_BRANCH volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - storage:/code/pm4/storage links: - redis - - mysql + - mysql depends_on: - mysql - redis @@ -64,10 +66,10 @@ services: image: mysql:5.7 restart: always environment: - MYSQL_ROOT_PASSWORD: password + MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: processmaker tmpfs: /var/lib/mysql - + volumes: redis: - storage: \ No newline at end of file + storage: diff --git a/github_context_example.json b/github_context_example.json deleted file mode 100644 index 049c3a5..0000000 --- a/github_context_example.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "_links": { - "comments": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1/comments" - }, - "commits": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/commits" - }, - "html": { - "href": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1" - }, - "issue": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1" - }, - "review_comment": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/comments{/number}" - }, - "review_comments": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/comments" - }, - "self": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1" - }, - "statuses": { - "href": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1" - } - }, - "active_lock_reason": null, - "additions": 49, - "assignee": null, - "assignees": [], - "author_association": "OWNER", - "auto_merge": null, - "base": { - "label": "nolanpro:master", - "ref": "master", - "repo": { - "allow_auto_merge": false, - "allow_forking": true, - "allow_merge_commit": true, - "allow_rebase_merge": true, - "allow_squash_merge": true, - "allow_update_branch": false, - "archive_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/{archive_format}{/ref}", - "archived": false, - "assignees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/assignees{/user}", - "blobs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/blobs{/sha}", - "branches_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/branches{/branch}", - "clone_url": "https://github.com/nolanpro/docker-compose-actions-workflow.git", - "collaborators_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/collaborators{/collaborator}", - "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/comments{/number}", - "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/commits{/sha}", - "compare_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/compare/{base}...{head}", - "contents_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contents/{+path}", - "contributors_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contributors", - "created_at": "2021-12-03T17:21:35Z", - "default_branch": "master", - "delete_branch_on_merge": false, - "deployments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/deployments", - "description": "GitHub Actions workflow example using Docker Compose to build and test a multi-container stack", - "disabled": false, - "downloads_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/downloads", - "events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/events", - "fork": true, - "forks": 0, - "forks_count": 0, - "forks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/forks", - "full_name": "nolanpro/docker-compose-actions-workflow", - "git_commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/commits{/sha}", - "git_refs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/refs{/sha}", - "git_tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/tags{/sha}", - "git_url": "git://github.com/nolanpro/docker-compose-actions-workflow.git", - "has_downloads": true, - "has_issues": false, - "has_pages": false, - "has_projects": true, - "has_wiki": true, - "homepage": null, - "hooks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/hooks", - "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow", - "id": 434677808, - "is_template": false, - "issue_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/comments{/number}", - "issue_events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/events{/number}", - "issues_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues{/number}", - "keys_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/keys{/key_id}", - "labels_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/labels{/name}", - "language": "Python", - "languages_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/languages", - "license": { - "key": "mit", - "name": "MIT License", - "node_id": "MDc6TGljZW5zZTEz", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit" - }, - "merges_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/merges", - "milestones_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/milestones{/number}", - "mirror_url": null, - "name": "docker-compose-actions-workflow", - "node_id": "R_kgDOGeioMA", - "notifications_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/notifications{?since,all,participating}", - "open_issues": 1, - "open_issues_count": 1, - "owner": { - "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", - "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", - "followers_url": "https://api.github.com/users/nolanpro/followers", - "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", - "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", - "gravatar_id": "", - "html_url": "https://github.com/nolanpro", - "id": 2546850, - "login": "nolanpro", - "node_id": "MDQ6VXNlcjI1NDY4NTA=", - "organizations_url": "https://api.github.com/users/nolanpro/orgs", - "received_events_url": "https://api.github.com/users/nolanpro/received_events", - "repos_url": "https://api.github.com/users/nolanpro/repos", - "site_admin": false, - "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", - "type": "User", - "url": "https://api.github.com/users/nolanpro" - }, - "private": false, - "pulls_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls{/number}", - "pushed_at": "2021-12-15T19:44:42Z", - "releases_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/releases{/id}", - "size": 25, - "ssh_url": "git@github.com:nolanpro/docker-compose-actions-workflow.git", - "stargazers_count": 0, - "stargazers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/stargazers", - "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/{sha}", - "subscribers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscribers", - "subscription_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscription", - "svn_url": "https://github.com/nolanpro/docker-compose-actions-workflow", - "tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/tags", - "teams_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/teams", - "topics": [], - "trees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/trees{/sha}", - "updated_at": "2021-12-03T17:49:23Z", - "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow", - "visibility": "public", - "watchers": 0, - "watchers_count": 0 - }, - "sha": "1b7527fd0de7ea8e08b034939ee7336696627358", - "user": { - "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", - "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", - "followers_url": "https://api.github.com/users/nolanpro/followers", - "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", - "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", - "gravatar_id": "", - "html_url": "https://github.com/nolanpro", - "id": 2546850, - "login": "nolanpro", - "node_id": "MDQ6VXNlcjI1NDY4NTA=", - "organizations_url": "https://api.github.com/users/nolanpro/orgs", - "received_events_url": "https://api.github.com/users/nolanpro/received_events", - "repos_url": "https://api.github.com/users/nolanpro/repos", - "site_admin": false, - "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", - "type": "User", - "url": "https://api.github.com/users/nolanpro" - } - }, - "body": "", - "changed_files": 1, - "closed_at": null, - "comments": 0, - "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1/comments", - "commits": 29, - "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/commits", - "created_at": "2021-12-03T20:15:32Z", - "deletions": 8, - "diff_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1.diff", - "draft": false, - "head": { - "label": "nolanpro:testbranch", - "ref": "testbranch", - "repo": { - "allow_auto_merge": false, - "allow_forking": true, - "allow_merge_commit": true, - "allow_rebase_merge": true, - "allow_squash_merge": true, - "allow_update_branch": false, - "archive_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/{archive_format}{/ref}", - "archived": false, - "assignees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/assignees{/user}", - "blobs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/blobs{/sha}", - "branches_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/branches{/branch}", - "clone_url": "https://github.com/nolanpro/docker-compose-actions-workflow.git", - "collaborators_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/collaborators{/collaborator}", - "comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/comments{/number}", - "commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/commits{/sha}", - "compare_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/compare/{base}...{head}", - "contents_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contents/{+path}", - "contributors_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/contributors", - "created_at": "2021-12-03T17:21:35Z", - "default_branch": "master", - "delete_branch_on_merge": false, - "deployments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/deployments", - "description": "GitHub Actions workflow example using Docker Compose to build and test a multi-container stack", - "disabled": false, - "downloads_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/downloads", - "events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/events", - "fork": true, - "forks": 0, - "forks_count": 0, - "forks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/forks", - "full_name": "nolanpro/docker-compose-actions-workflow", - "git_commits_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/commits{/sha}", - "git_refs_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/refs{/sha}", - "git_tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/tags{/sha}", - "git_url": "git://github.com/nolanpro/docker-compose-actions-workflow.git", - "has_downloads": true, - "has_issues": false, - "has_pages": false, - "has_projects": true, - "has_wiki": true, - "homepage": null, - "hooks_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/hooks", - "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow", - "id": 434677808, - "is_template": false, - "issue_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/comments{/number}", - "issue_events_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/events{/number}", - "issues_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues{/number}", - "keys_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/keys{/key_id}", - "labels_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/labels{/name}", - "language": "Python", - "languages_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/languages", - "license": { - "key": "mit", - "name": "MIT License", - "node_id": "MDc6TGljZW5zZTEz", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit" - }, - "merges_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/merges", - "milestones_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/milestones{/number}", - "mirror_url": null, - "name": "docker-compose-actions-workflow", - "node_id": "R_kgDOGeioMA", - "notifications_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/notifications{?since,all,participating}", - "open_issues": 1, - "open_issues_count": 1, - "owner": { - "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", - "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", - "followers_url": "https://api.github.com/users/nolanpro/followers", - "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", - "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", - "gravatar_id": "", - "html_url": "https://github.com/nolanpro", - "id": 2546850, - "login": "nolanpro", - "node_id": "MDQ6VXNlcjI1NDY4NTA=", - "organizations_url": "https://api.github.com/users/nolanpro/orgs", - "received_events_url": "https://api.github.com/users/nolanpro/received_events", - "repos_url": "https://api.github.com/users/nolanpro/repos", - "site_admin": false, - "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", - "type": "User", - "url": "https://api.github.com/users/nolanpro" - }, - "private": false, - "pulls_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls{/number}", - "pushed_at": "2021-12-15T19:44:42Z", - "releases_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/releases{/id}", - "size": 25, - "ssh_url": "git@github.com:nolanpro/docker-compose-actions-workflow.git", - "stargazers_count": 0, - "stargazers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/stargazers", - "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/{sha}", - "subscribers_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscribers", - "subscription_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/subscription", - "svn_url": "https://github.com/nolanpro/docker-compose-actions-workflow", - "tags_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/tags", - "teams_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/teams", - "topics": [], - "trees_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/git/trees{/sha}", - "updated_at": "2021-12-03T17:49:23Z", - "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow", - "visibility": "public", - "watchers": 0, - "watchers_count": 0 - }, - "sha": "4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1", - "user": { - "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", - "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", - "followers_url": "https://api.github.com/users/nolanpro/followers", - "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", - "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", - "gravatar_id": "", - "html_url": "https://github.com/nolanpro", - "id": 2546850, - "login": "nolanpro", - "node_id": "MDQ6VXNlcjI1NDY4NTA=", - "organizations_url": "https://api.github.com/users/nolanpro/orgs", - "received_events_url": "https://api.github.com/users/nolanpro/received_events", - "repos_url": "https://api.github.com/users/nolanpro/repos", - "site_admin": false, - "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", - "type": "User", - "url": "https://api.github.com/users/nolanpro" - } - }, - "html_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1", - "id": 794886517, - "issue_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/issues/1", - "labels": [], - "locked": false, - "maintainer_can_modify": false, - "merge_commit_sha": "cda5436dfbca03aae8b6770697148bdf89fa43d4", - "mergeable": null, - "mergeable_state": "unknown", - "merged": false, - "merged_at": null, - "merged_by": null, - "milestone": null, - "node_id": "PR_kwDOGeioMM4vYQF1", - "number": 1, - "patch_url": "https://github.com/nolanpro/docker-compose-actions-workflow/pull/1.patch", - "rebaseable": null, - "requested_reviewers": [], - "requested_teams": [], - "review_comment_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/comments{/number}", - "review_comments": 0, - "review_comments_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1/comments", - "state": "open", - "statuses_url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/statuses/4c380148217dc3dd8b3a03d9746a9e9d4b4a09f1", - "title": "Testbranch", - "updated_at": "2021-12-15T19:44:42Z", - "url": "https://api.github.com/repos/nolanpro/docker-compose-actions-workflow/pulls/1", - "user": { - "avatar_url": "https://avatars.githubusercontent.com/u/2546850?v=4", - "events_url": "https://api.github.com/users/nolanpro/events{/privacy}", - "followers_url": "https://api.github.com/users/nolanpro/followers", - "following_url": "https://api.github.com/users/nolanpro/following{/other_user}", - "gists_url": "https://api.github.com/users/nolanpro/gists{/gist_id}", - "gravatar_id": "", - "html_url": "https://github.com/nolanpro", - "id": 2546850, - "login": "nolanpro", - "node_id": "MDQ6VXNlcjI1NDY4NTA=", - "organizations_url": "https://api.github.com/users/nolanpro/orgs", - "received_events_url": "https://api.github.com/users/nolanpro/received_events", - "repos_url": "https://api.github.com/users/nolanpro/repos", - "site_admin": false, - "starred_url": "https://api.github.com/users/nolanpro/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/nolanpro/subscriptions", - "type": "User", - "url": "https://api.github.com/users/nolanpro" - } -} diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 30c4144..9592c71 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -30,14 +30,14 @@ public function build() $this->buildCore(); $this->buildPackages(); } - + public function buildJavascript() { $javascriptPackages = Packages::getJavascriptPackages(Config::codebasePath()); $this->installJavascriptPackages($javascriptPackages); $this->npmRunDev(); } - + public function install() { $this->installCore(); @@ -166,7 +166,7 @@ private function artisanInstall($package) { return $this->artisanCommand("${package}:install"); } - + private function artisanCommand($cmd) { return CommandLine::runCommand("php artisan ${cmd}", function($code, $output) { @@ -182,7 +182,7 @@ public function getBranch($package) if (isset($this->branches[$package])) { return $this->branches[$package]; } - + return null; } @@ -199,28 +199,17 @@ private function setBranches() private function pullRequestBody() { - return Arr::get($this->getGitHubContext(), 'body', ''); + return $_ENV('CI_PR_BODY'); } - + private function pullRequestBranch() { - return Arr::get($this->getGitHubContext(), 'head.ref', ''); + return $_ENV('CI_PACKAGE_BRANCH'); } - + private function repoName() { - return Arr::get($this->getGitHubContext(), 'head.repo.name', ''); - } - - private function getGitHubContext() - { - if ($this->gitHubContext) { - return $this->gitHubContext; - } - if (Config::env('GITHUB_CONTEXT', true)) { - $this->gitHubContext = json_decode(Config::env('GITHUB_CONTEXT'), true); - } - return $this->gitHubContext; + return $_ENV('CI_PROJECT'); } private function installCommand() @@ -289,7 +278,7 @@ private function buildPackages() info($info); Git::shallowClone($package, $branch, Config::packagesPath($package)); } - + foreach ($list as $package) { info("Registering local repository path for $package"); Composer::addRepositoryPath($package); @@ -306,7 +295,7 @@ private function installCore() CommandLine::mustRun($this->installCommand(), Config::codebasePath()); FileSystem::append(Config::codebasePath() . '/.env', $this->additionalEnv()); } - + private function cloneCore() { $pm = 'processmaker'; @@ -319,7 +308,7 @@ public function databaseConnectionParams() extract($_ENV); return "-h $DB_HOSTNAME -P $DB_PORT -u $DB_USERNAME -p'${DB_PASSWORD}'"; } - + public function createDatabase($name) { $connection = $this->databaseConnectionParams(); @@ -335,7 +324,7 @@ public function copyDatabase($from, $to) $this->createDatabase($to); CommandLine::mustRun("mysql $connection $to < $file"); } - + private function clonePackage($package) { Git::shallowClone($package, $this->getBranch($package), Config::packagesPath($package)); @@ -367,7 +356,7 @@ private function installJavascriptPackages($packages) return count($packagesToBuild); } - + private function linkDependentPackages($path) { $dependentPackages = Packages::getJavascriptPackages($path); @@ -388,7 +377,7 @@ private function buildJavascriptPackage($package) } CommandLine::mustRun('rm -rf node_modules', Config::packagesPath($package)); } - + private function npmRunDev() { // unsafe-perm is needed to run postinstall scripts as root diff --git a/set_context_example.sh b/set_context_example.sh index 728ce43..6ceda6b 100644 --- a/set_context_example.sh +++ b/set_context_example.sh @@ -1,4 +1,4 @@ # Sets an example GITHUB_CONTEXT for local testing # Edit pr_body_example.txt to set the PR's body # run with source ./set_context_example.sh -export GITHUB_CONTEXT=$(cat github_context_example.json | jq -r ".body |= \"$(cat pr_body_example.txt)\"") +export GITHUB_CONTEXT=$(cat pr_body_example.txt) From d631ec7fda4efc58d1c29f288f2797b6edfdf79e Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 09:32:58 -0800 Subject: [PATCH 29/71] Use config helper to get env var --- pm4-tools/cli/ProcessMaker/PackagesCi.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 9592c71..3129e18 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -23,7 +23,6 @@ class PackagesCi { private $cacheManifest; private $remoteShas = []; - private $gitHubContext; public function build() { @@ -199,17 +198,17 @@ private function setBranches() private function pullRequestBody() { - return $_ENV('CI_PR_BODY'); + return Config::env('CI_PR_BODY'); } private function pullRequestBranch() { - return $_ENV('CI_PACKAGE_BRANCH'); + return Config::env('CI_PACKAGE_BRANCH'); } private function repoName() { - return $_ENV('CI_PROJECT'); + return Config::env('CI_PROJECT'); } private function installCommand() From 714d69b292b77518c973b26a5b70952e03b03750 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 09:34:42 -0800 Subject: [PATCH 30/71] Add additional example env vars --- set_context_example.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/set_context_example.sh b/set_context_example.sh index 6ceda6b..e9bbac9 100644 --- a/set_context_example.sh +++ b/set_context_example.sh @@ -1,4 +1,6 @@ # Sets an example GITHUB_CONTEXT for local testing # Edit pr_body_example.txt to set the PR's body # run with source ./set_context_example.sh -export GITHUB_CONTEXT=$(cat pr_body_example.txt) +export CI_PR_BODY="$(cat pr_body_example.txt)" +export CI_PACKAGE_BRANCH="circleci-project-setup" +export CI_PROJECT="docker-compose-actions-workflow" From c65b6287e6d611a759572dfbe082c575ff3763d0 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 09:37:31 -0800 Subject: [PATCH 31/71] Move env vars to correct location --- docker-compose.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8154650..5a3bd51 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,9 @@ services: dockerfile: Dockerfile.cicd command: sh cicd-build-run.sh environment: - - GITHUB_TOKEN - - GITHUB_CONTEXT + - CI_PR_BODY + - CI_PROJECT + - CI_PACKAGE_BRANCH env_file: - .env-cicd links: @@ -50,8 +51,6 @@ services: - PM_APP_URL - PM_APP_PORT - PM_BROADCASTER_PORT - - CI_PROJECT - - CI_PACKAGE_BRANCH volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - storage:/code/pm4/storage From 72b710242ee80a8420f3df8b9a8b29abf4bf2278 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 09:39:24 -0800 Subject: [PATCH 32/71] Add github token back in --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5a3bd51..042b6f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: dockerfile: Dockerfile.cicd command: sh cicd-build-run.sh environment: + - GITHUB_TOKEN - CI_PR_BODY - CI_PROJECT - CI_PACKAGE_BRANCH From 9cd6e8fe86cfb11bd8cfa7aeab8cd05c02d17925 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 12:51:20 -0800 Subject: [PATCH 33/71] Update PackagesCi.php --- pm4-tools/cli/ProcessMaker/PackagesCi.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 3129e18..023d1a1 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -187,6 +187,7 @@ public function getBranch($package) private function setBranches() { + info("Pull Request Body: " . $this->pullRequestBody()); $result = preg_match_all('/ci:(.+?):(.+?)(\s|$)/', $this->pullRequestBody(), $matches); if ($result && $result > 0) { $this->branches = array_combine($matches[1], $matches[2]); @@ -194,6 +195,7 @@ private function setBranches() $this->branches = []; } $this->branches[$this->repoName()] = $this->pullRequestBranch(); + info("Branches: " . print_r($this->branches)); } private function pullRequestBody() From 702178766a148fdcb037a4e020534575deea26c1 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 13:17:39 -0800 Subject: [PATCH 34/71] Move echo server config after pm4 core is cloned --- build-files/cicd-build-run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index d367dbd..493ac35 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -9,6 +9,8 @@ composer config --global github-oauth.github.com $GITHUB_TOKEN /code/pm4-tools/pm build-ci +mv /code/laravel-echo-server.json /code/pm4/ + /code/pm4-tools/pm build-javascript-ci DB_DATABASE=processmaker \ From d45cb7b2bd9d710b271ef273798e1a9334382cbf Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 13:18:00 -0800 Subject: [PATCH 35/71] Debug pr body var --- build-files/cicd-build-run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 493ac35..9f41324 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -7,6 +7,9 @@ done composer config --global github-oauth.github.com $GITHUB_TOKEN +# temp debug +echo "PR BODY $CI_PR_BODY" + /code/pm4-tools/pm build-ci mv /code/laravel-echo-server.json /code/pm4/ From 63f0fe7dee1d7b45340fdea1ef58ef7da88c5cf5 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 13:42:06 -0800 Subject: [PATCH 36/71] Update Dockerfile.cicd --- Dockerfile.cicd | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.cicd b/Dockerfile.cicd index 48a686c..a8d8b21 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -8,4 +8,5 @@ WORKDIR /code/pm4-tools RUN composer install --no-interaction WORKDIR /code +RUN echo "cachebust 1" COPY build-files/cicd-build-run.sh . \ No newline at end of file From 71f1e72f114e89c2059b6ba9e53b40a50e564a04 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 11 Feb 2022 14:06:53 -0800 Subject: [PATCH 37/71] Remove debugging and add helpers --- .env | 2 -- .env-cicd | 3 --- Dockerfile.base | 6 ++++++ Dockerfile.cicd | 1 - build-files/cicd-build-run.sh | 3 --- commit_image.sh | 2 +- container.sh | 1 + docker-compose.yml | 5 +++-- pm4-tools/cli/ProcessMaker/PackagesCi.php | 1 - 9 files changed, 11 insertions(+), 13 deletions(-) create mode 100755 container.sh diff --git a/.env b/.env index 780d771..0c8c7f5 100644 --- a/.env +++ b/.env @@ -3,5 +3,3 @@ PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 PM_DOCKER_SOCK=/var/run/docker.sock -CI_PROJECT=processmaker -CI_PACKAGE_BRANCH=develop diff --git a/.env-cicd b/.env-cicd index 308c5b0..84a57fd 100644 --- a/.env-cicd +++ b/.env-cicd @@ -6,7 +6,6 @@ PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 PROCESSMAKER_SCRIPTS_DOCKER=/usr/local/bin/docker -PROCESSMAKER_SCRIPTS_DOCKER_MODE=copying LARAVEL_ECHO_SERVER_AUTH_HOST=http://localhost SESSION_SECURE_COOKIE=false CACHE_DRIVER=array @@ -18,8 +17,6 @@ DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=password REDIS_HOST=redis -CACHE_PATH="/pm4-cache" -HOST_CACHE_PATH="/home/runner/cache" TELESCOPE_ENABLED=false BUILD_JAVASCRIPT=true diff --git a/Dockerfile.base b/Dockerfile.base index 6163291..a93c8df 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -51,6 +51,12 @@ COPY build-files/nginx.conf /etc/nginx/nginx.conf # COPY build-files/services.conf /etc/supervisor/conf.d/services.conf +# +# laravel echo server +# +RUN mkdir -p /code +COPY build-files/laravel-echo-server.json /code + # populate $_ENV with environment variables RUN echo "variables_order = \"EGPCS\"" > /etc/php/7.4/cli/conf.d/30-env.ini diff --git a/Dockerfile.cicd b/Dockerfile.cicd index a8d8b21..48a686c 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -8,5 +8,4 @@ WORKDIR /code/pm4-tools RUN composer install --no-interaction WORKDIR /code -RUN echo "cachebust 1" COPY build-files/cicd-build-run.sh . \ No newline at end of file diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 9f41324..493ac35 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -7,9 +7,6 @@ done composer config --global github-oauth.github.com $GITHUB_TOKEN -# temp debug -echo "PR BODY $CI_PR_BODY" - /code/pm4-tools/pm build-ci mv /code/laravel-echo-server.json /code/pm4/ diff --git a/commit_image.sh b/commit_image.sh index ab482d3..afe35f2 100755 --- a/commit_image.sh +++ b/commit_image.sh @@ -1,3 +1,3 @@ set -ex -docker commit $(docker ps -aqlf "name=^pm4core-docker_cicd_run") debug +docker commit $(./container.sh) pm4app docker container prune -f diff --git a/container.sh b/container.sh new file mode 100755 index 0000000..6277d56 --- /dev/null +++ b/container.sh @@ -0,0 +1 @@ +docker ps -aqlf "name=^pm4core-docker_cicd_run" diff --git a/docker-compose.yml b/docker-compose.yml index 042b6f3..1fb4b37 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - redis:/data debug: - image: debug:latest + image: pm4app:latest command: bash env_file: - .env-cicd @@ -44,7 +44,8 @@ services: - mysql web: - image: processmaker/pm4-core:${PM_VERSION} + image: pm4app:latest + command: supervisord --nodaemon ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 023d1a1..537ad4a 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -187,7 +187,6 @@ public function getBranch($package) private function setBranches() { - info("Pull Request Body: " . $this->pullRequestBody()); $result = preg_match_all('/ci:(.+?):(.+?)(\s|$)/', $this->pullRequestBody(), $matches); if ($result && $result > 0) { $this->branches = array_combine($matches[1], $matches[2]); From a33af8558c5678a04ec045dd8730b7f252c5b6e2 Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Tue, 15 Feb 2022 15:30:55 -0500 Subject: [PATCH 38/71] Removed paratest running command --- build-files/cicd-build-run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build-files/cicd-build-run.sh b/build-files/cicd-build-run.sh index 493ac35..1d932cc 100644 --- a/build-files/cicd-build-run.sh +++ b/build-files/cicd-build-run.sh @@ -17,4 +17,3 @@ DB_DATABASE=processmaker \ /code/pm4-tools/pm install-ci cd /code/pm4 -vendor/bin/paratest -p 6 From cee9ae78357edf6e866569face49ad62c7dd5a90 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 15 Feb 2022 12:37:43 -0800 Subject: [PATCH 39/71] Remvoe debugging and update example env --- pm4-tools/cli/ProcessMaker/PackagesCi.php | 1 - pr_body_example.txt | 14 -------------- set_context_example.sh | 4 ++-- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 537ad4a..3129e18 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -194,7 +194,6 @@ private function setBranches() $this->branches = []; } $this->branches[$this->repoName()] = $this->pullRequestBranch(); - info("Branches: " . print_r($this->branches)); } private function pullRequestBody() diff --git a/pr_body_example.txt b/pr_body_example.txt index d2a3c6e..061aab4 100644 --- a/pr_body_example.txt +++ b/pr_body_example.txt @@ -2,21 +2,7 @@ Branches needed: -ci:package-auth:updates-for-ci -ci:package-dynamic-ui:updates-for-ci -ci:package-savedsearch:updates-for-ci -ci:processmaker:updates-for-ci -ci:package-auth:updates-for-ci -ci:package-actions-by-email:updates-for-ci -ci:connector-slack:updates-for-ci -ci:package-googleplaces:updates-for-ci ci:connector-send-email:updates-for-ci -ci:package-advanced-user-manager:updates-for-ci -ci:connector-docusign:updates-for-ci -ci:package-collections:updates-for-ci -ci:package-data-sources:updates-for-ci -ci:package-data-sources:updates-for-ci -ci:connector-pdf-print:updates-for-ci Done! diff --git a/set_context_example.sh b/set_context_example.sh index e9bbac9..226ba71 100644 --- a/set_context_example.sh +++ b/set_context_example.sh @@ -2,5 +2,5 @@ # Edit pr_body_example.txt to set the PR's body # run with source ./set_context_example.sh export CI_PR_BODY="$(cat pr_body_example.txt)" -export CI_PACKAGE_BRANCH="circleci-project-setup" -export CI_PROJECT="docker-compose-actions-workflow" +export CI_PACKAGE_BRANCH="updates-for-ci" +export CI_PROJECT="processmaker" From 4a65429087ba95efd49d3a6f98e6cde31434eee4 Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Tue, 15 Feb 2022 17:09:27 -0500 Subject: [PATCH 40/71] Added script for building docker image --- build-docker-image.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 build-docker-image.sh diff --git a/build-docker-image.sh b/build-docker-image.sh new file mode 100755 index 0000000..1d2f894 --- /dev/null +++ b/build-docker-image.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ -n "${CIRCLE_TAG}" ]; then + TAG="latest" +else + TAG=$(echo "${CIRCLE_BRANCH}" | sed 's;/;-;g') +fi + +docker build -t processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" . +echo "$DOCKER_PROJECT_OWNER_PASSWD" | docker login -u "$DOCKER_PROJECT_OWNER" --password-stdin +docker push processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" + From 1870cd16b826b956345cf4cd63d7dc369c9dd048 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Feb 2022 09:29:40 -0800 Subject: [PATCH 41/71] Use env vars for the tag name --- Dockerfile.cicd | 5 +++-- build-files/cicd-run-app.sh | 14 ++++++++++++++ docker-compose.yml | 7 ++++--- pm4-tools/cli/ProcessMaker/PackagesCi.php | 14 +++++++++++--- pm4-tools/cli/pm.php | 3 --- 5 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 build-files/cicd-run-app.sh diff --git a/Dockerfile.cicd b/Dockerfile.cicd index 48a686c..ff5630d 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -1,6 +1,6 @@ FROM processmaker/pm4-base:2.0.0 -RUN npm config set cacphe /cache/npm +RUN npm config set cache /cache/npm --global ENV COMPOSER_HOME=/cache/composer COPY ./pm4-tools /code/pm4-tools @@ -8,4 +8,5 @@ WORKDIR /code/pm4-tools RUN composer install --no-interaction WORKDIR /code -COPY build-files/cicd-build-run.sh . \ No newline at end of file +COPY build-files/cicd-build-run.sh . +COPY build-files/cicd-run-app.sh . \ No newline at end of file diff --git a/build-files/cicd-run-app.sh b/build-files/cicd-run-app.sh new file mode 100644 index 0000000..39a6890 --- /dev/null +++ b/build-files/cicd-run-app.sh @@ -0,0 +1,14 @@ +set -ex + +MYSQL_CONNECTION="-u $DB_USERNAME -p\"$DB_PASSWORD\" -h $DB_HOSTNAME -P $DB_PORT" + +while ! mysqladmin ping $MYSQL_CONNECTION --silent; do + echo "Waiting for mysql" + sleep 1 +done + +mysql $MYSQL_CONNECTION -e "DROP DATABASE IF EXISTS $DB_DATABASE;" +mysql $MYSQL_CONNECTION -e "CREATE DATABASE $DB_DATABASE;" +mysql $MYSQL_CONNECTION $DB_DATABASE < database.sql + +supervisord --nodaemon \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1fb4b37..2c769bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - redis:/data debug: - image: pm4app:latest + image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} command: bash env_file: - .env-cicd @@ -44,8 +44,8 @@ services: - mysql web: - image: pm4app:latest - command: supervisord --nodaemon + image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} + command: bash ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 @@ -53,6 +53,7 @@ services: - PM_APP_URL - PM_APP_PORT - PM_BROADCASTER_PORT + - DB_DATABASE=processmaker volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - storage:/code/pm4/storage diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 3129e18..c0ad957 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -52,11 +52,17 @@ public function install() info("Modifying phpunit.xml to add package tests"); PhpUnit::addTests(PhpUnit::configFile()); - $this->copyDatabase(Config::env('DB_DATABASE'), 'test'); + $this->exportDatabase(); + $this->cleanUp(); info("Done"); } + public function cleanUp() + { + CommandLine::mustRun('rm -rf node_modules', Config::codebasePath()); + } + public function shouldUseCache($package) { info("Checking cache for package $package"); @@ -315,10 +321,12 @@ public function createDatabase($name) CommandLine::mustRun("mysql $connection -e 'CREATE DATABASE `$name`;'"); } - public function copyDatabase($from, $to) + public function exportDatabase() { + $from = Config::env('DB_DATABASE'); + $to = 'test'; + $file = 'database.sql'; $connection = $this->databaseConnectionParams(); - $file = tempnam(sys_get_temp_dir(), 'dump'); CommandLine::mustRun("mysqldump $connection $from > $file"); $this->createDatabase($to); CommandLine::mustRun("mysql $connection $to < $file"); diff --git a/pm4-tools/cli/pm.php b/pm4-tools/cli/pm.php index 6e6067f..2dd9b8d 100644 --- a/pm4-tools/cli/pm.php +++ b/pm4-tools/cli/pm.php @@ -291,7 +291,4 @@ PackagesCi::install($this); }); -$app->command('test-runner', function() { -}); - $app->run(); From bb3788dcb52d521b12a15f4a0bb162e76a2b551b Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Wed, 16 Feb 2022 15:59:11 -0500 Subject: [PATCH 42/71] Made some mods to the login and using the right env for dockerhub token --- build-docker-image.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-docker-image.sh b/build-docker-image.sh index 1d2f894..5bddb06 100755 --- a/build-docker-image.sh +++ b/build-docker-image.sh @@ -7,6 +7,5 @@ else fi docker build -t processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" . -echo "$DOCKER_PROJECT_OWNER_PASSWD" | docker login -u "$DOCKER_PROJECT_OWNER" --password-stdin +echo "$DOCKERHUB_TOKEN" | docker login -u processmaker --password-stdin docker push processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" - From 63ad5577a72ff9956aa831a9d87acdbb070ff8ba Mon Sep 17 00:00:00 2001 From: Diego Bruno Flores Salazar Date: Thu, 17 Feb 2022 12:52:53 -0400 Subject: [PATCH 43/71] FOUR-5408: Add Endtest script --- run-endtest-tests.sh | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 run-endtest-tests.sh diff --git a/run-endtest-tests.sh b/run-endtest-tests.sh new file mode 100755 index 0000000..4f34aa7 --- /dev/null +++ b/run-endtest-tests.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +## TODO: Add here the test suites that we want to execute. Ex. +# testSuites=(350178) +# testSuites=(245814 245815) +testSuites=(357469) + +declare -A testsStatus +declare -A testsHashes +declare -A testsRequest + +# Default Values +AppID=${ENDTEST_APP_ID:=""} +AppCode=${ENDTEST_APP_CODE:=""} +SERVER_URL=${SERVER_URL:=""} +PM_USER="admin" +PM_PASSWORD="admin" + +echo "Sending tests to EndTest platform" +timeElapsed=0 +exitCode=0 +for test in "${testSuites[@]}" +do + testsStatus[$test]="" + testsHashes[$test]="" + testsRequest[$test]="https://endtest.io/api.php?action=runWeb&appId=${AppID}&appCode=${AppCode}&suite=${test}&platform=windows&os=windows10&browser=chrome&resolution=1920x1200&geolocation=sanfrancisco&cases=all¬es=TestFromEndtest.cloud.processmaker.io&username=${PM_USER}&pwd=${PM_PASSWORD}&URL=${SERVER_URL}" + + echo "Get Hash for execution test suite id: $test" + testsHashes[$test]=$(curl -s -X GET --header "Accept: */*" "${testsRequest[$test]}") + echo "Hash: ${testsHashes[$test]}" + # TODO: if not_allowed then show error + pendingTest=true + echo "Test in progress..." + testTimeElapsed=0 + while $pendingTest; do + sleep 60 + timeElapsed=$((timeElapsed + 1)) + testTimeElapsed=$((testTimeElapsed + 1)) + result=$(curl -s -X GET --header "Accept: */*" "https://endtest.io/api.php?action=getResults&appId=${AppID}&appCode=${AppCode}&hash=${testsHashes[$test]}&format=json") + if [ "$result" == "Test is still running." ] + then + testsStatus[$test]=$result + echo "Status: $result Time Elapsed of this test: $testTimeElapsed minutes." + pendingTest=true + elif [ "$result" == "Processing video recording." ] + then + testsStatus[$test]=$result + echo "Status: $result Time Elapsed of this test: $testTimeElapsed minutes." + pendingTest=true + elif [ "$result" == "Stopping." ] + then + testsStatus[$test]=$result + echo "Status: $result Time Elapsed of this test: $testTimeElapsed minutes." + pendingTest=true + elif [ "$result" == "Erred." ] + then + testsStatus[$test]=$result + echo "TestSuite failed for ID: $test, Status: $result" + echo "Time Elapsed of this test: $testTimeElapsed minutes." + echo "Please check this link for detailed info: https://endtest.io/results?hash=${testsHashes[$test]}" + pendingTest=false + exitCode=1 + elif [ "$result" == "" ] + then + testsStatus[$test]=$result + echo "Status: $result Time Elapsed of this test: $testTimeElapsed minutes." + else + # TODO - Nice to have: Upload results to CI + echo "$result" > "$test".json + pendingTest=false + testsStatus[$test]="Completed" + echo "Test completed for ID: $test. Time Elapsed of this test: $testTimeElapsed minutes." + fi + done +done + +if [ $exitCode -ne 0 ]; then + echo "TestSuites finished with Errors, please see logs above." +else + echo "TestSuites finished successfully." +fi + +echo "Elapsed time of all tests: $timeElapsed" +exit $exitCode From 5476ceff2d8cfd5a8e29d8ac73842ce2d635abf3 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Feb 2022 21:23:10 -0800 Subject: [PATCH 44/71] Pass in image tag name as env var --- build-docker-image.sh | 8 ++++---- build-files/cicd-run-app.sh | 13 +++++++------ commit_image.sh | 3 --- docker-compose.yml | 16 +++++++++++++++- 4 files changed, 26 insertions(+), 14 deletions(-) delete mode 100755 commit_image.sh diff --git a/build-docker-image.sh b/build-docker-image.sh index 5bddb06..55e7633 100755 --- a/build-docker-image.sh +++ b/build-docker-image.sh @@ -1,11 +1,11 @@ #!/bin/bash -if [ -n "${CIRCLE_TAG}" ]; then +if [ -z "${IMAGE_TAG}" ]; then TAG="latest" else - TAG=$(echo "${CIRCLE_BRANCH}" | sed 's;/;-;g') + TAG=$(echo "${IMAGE_TAG}" | sed 's;/;-;g') fi -docker build -t processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" . +docker commit $(./container.sh) processmaker/pm4app:"$TAG" echo "$DOCKERHUB_TOKEN" | docker login -u processmaker --password-stdin -docker push processmaker/"${CIRCLE_PROJECT_REPONAME}":"$TAG" +docker push processmaker/pm4app:"$TAG" diff --git a/build-files/cicd-run-app.sh b/build-files/cicd-run-app.sh index 39a6890..1bb8bc7 100644 --- a/build-files/cicd-run-app.sh +++ b/build-files/cicd-run-app.sh @@ -1,14 +1,15 @@ set -ex -MYSQL_CONNECTION="-u $DB_USERNAME -p\"$DB_PASSWORD\" -h $DB_HOSTNAME -P $DB_PORT" - -while ! mysqladmin ping $MYSQL_CONNECTION --silent; do +while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT --silent; do echo "Waiting for mysql" sleep 1 done -mysql $MYSQL_CONNECTION -e "DROP DATABASE IF EXISTS $DB_DATABASE;" -mysql $MYSQL_CONNECTION -e "CREATE DATABASE $DB_DATABASE;" -mysql $MYSQL_CONNECTION $DB_DATABASE < database.sql +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "DROP DATABASE IF EXISTS $DB_DATABASE;" +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "CREATE DATABASE $DB_DATABASE;" +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT $DB_DATABASE < database.sql + +cd /code/pm4 +PM_CI=false php artisan docker-executor-php:install supervisord --nodaemon \ No newline at end of file diff --git a/commit_image.sh b/commit_image.sh deleted file mode 100755 index afe35f2..0000000 --- a/commit_image.sh +++ /dev/null @@ -1,3 +0,0 @@ -set -ex -docker commit $(./container.sh) pm4app -docker container prune -f diff --git a/docker-compose.yml b/docker-compose.yml index 2c769bd..2136d8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,18 +42,32 @@ services: - mysql depends_on: - mysql + + phpunit: + image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} + working_dir: /code/pm4 + command: vendor/bin/paratest -p 6 + links: + - mysql + - redis + depends_on: + - mysql + - redis web: image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} - command: bash + command: sh cicd-run-app.sh ports: - ${PM_APP_PORT}:80 - ${PM_BROADCASTER_PORT}:6001 + - 9001:9001 environment: - PM_APP_URL - PM_APP_PORT - PM_BROADCASTER_PORT - DB_DATABASE=processmaker + - PM_CI=false + - CACHE_DRIVER=redis volumes: - ${PM_DOCKER_SOCK}:/var/run/docker.sock - storage:/code/pm4/storage From 04b5c769df4d5764f1848d7a823fa32852632dfe Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 18 Feb 2022 12:59:32 -0800 Subject: [PATCH 45/71] Update container.sh --- container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.sh b/container.sh index 6277d56..074d1e1 100755 --- a/container.sh +++ b/container.sh @@ -1 +1 @@ -docker ps -aqlf "name=^pm4core-docker_cicd_run" +docker ps -aqlf "name=cicd_run" From b8a883b340aeee6d278ccb8f250ce96a6962e8b7 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 18 Feb 2022 15:03:01 -0800 Subject: [PATCH 46/71] Use image tag env var --- .env | 3 +++ build-docker-image.sh | 10 ++-------- docker-compose.yml | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 0c8c7f5..90ba3b4 100644 --- a/.env +++ b/.env @@ -3,3 +3,6 @@ PM_APP_URL=http://localhost PM_APP_PORT=8080 PM_BROADCASTER_PORT=6004 PM_DOCKER_SOCK=/var/run/docker.sock + +CI_PROJECT=processmaker +CI_PACKAGE_BRANCH=updates-for-ci \ No newline at end of file diff --git a/build-docker-image.sh b/build-docker-image.sh index 55e7633..4e102ce 100755 --- a/build-docker-image.sh +++ b/build-docker-image.sh @@ -1,11 +1,5 @@ #!/bin/bash -if [ -z "${IMAGE_TAG}" ]; then - TAG="latest" -else - TAG=$(echo "${IMAGE_TAG}" | sed 's;/;-;g') -fi - -docker commit $(./container.sh) processmaker/pm4app:"$TAG" +docker commit $(./container.sh) processmaker/pm4app:"$IMAGE_TAG" echo "$DOCKERHUB_TOKEN" | docker login -u processmaker --password-stdin -docker push processmaker/pm4app:"$TAG" +docker push processmaker/pm4app:"$IMAGE_TAG" diff --git a/docker-compose.yml b/docker-compose.yml index 2136d8c..efcf1b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - redis:/data debug: - image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} + image: processmaker/pm4app:${IMAGE_TAG} command: bash env_file: - .env-cicd @@ -44,7 +44,7 @@ services: - mysql phpunit: - image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} + image: processmaker/pm4app:${IMAGE_TAG} working_dir: /code/pm4 command: vendor/bin/paratest -p 6 links: @@ -55,7 +55,7 @@ services: - redis web: - image: processmaker/pm4app:${CI_PROJECT}-${CI_PACKAGE_BRANCH} + image: processmaker/pm4app:${IMAGE_TAG} command: sh cicd-run-app.sh ports: - ${PM_APP_PORT}:80 From ff316c618197fb2fa1cebe55a05cc58470a0c149 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 21 Feb 2022 10:47:47 -0800 Subject: [PATCH 47/71] Add phpunit script to load the test db before running --- Dockerfile.cicd | 3 ++- build-files/cicd-run-phpunit.sh | 13 +++++++++++++ docker-compose.yml | 5 +++-- set_context_example.sh | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 build-files/cicd-run-phpunit.sh diff --git a/Dockerfile.cicd b/Dockerfile.cicd index ff5630d..d63739c 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -9,4 +9,5 @@ RUN composer install --no-interaction WORKDIR /code COPY build-files/cicd-build-run.sh . -COPY build-files/cicd-run-app.sh . \ No newline at end of file +COPY build-files/cicd-run-app.sh . +COPY build-files/cicd-run-phpunit.sh . \ No newline at end of file diff --git a/build-files/cicd-run-phpunit.sh b/build-files/cicd-run-phpunit.sh new file mode 100644 index 0000000..bc8a323 --- /dev/null +++ b/build-files/cicd-run-phpunit.sh @@ -0,0 +1,13 @@ +set -ex + +while ! mysqladmin ping -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT --silent; do + echo "Waiting for mysql" + sleep 1 +done + +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "DROP DATABASE IF EXISTS test;" +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "CREATE DATABASE test;" +mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT test < database.sql + +cd /code/pm4 +vendor/bin/paratest -p $PARALLEL_TEST_PROCESSES \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index efcf1b0..20385d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,8 +45,9 @@ services: phpunit: image: processmaker/pm4app:${IMAGE_TAG} - working_dir: /code/pm4 - command: vendor/bin/paratest -p 6 + command: sh cicd-run-phpunit.sh + env_file: + - .env-cicd links: - mysql - redis diff --git a/set_context_example.sh b/set_context_example.sh index 226ba71..8fa5a7a 100644 --- a/set_context_example.sh +++ b/set_context_example.sh @@ -1,6 +1,7 @@ -# Sets an example GITHUB_CONTEXT for local testing +# Sets variables normally set by circleci but for local testing # Edit pr_body_example.txt to set the PR's body # run with source ./set_context_example.sh export CI_PR_BODY="$(cat pr_body_example.txt)" export CI_PACKAGE_BRANCH="updates-for-ci" export CI_PROJECT="processmaker" +export IMAGE_TAG="processmaker-updates-for-ci" From 46c9c14ee0a625268506de95d29a1a87b1aded14 Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Mon, 21 Feb 2022 17:38:19 -0500 Subject: [PATCH 48/71] Added the script to deploy to qa servers --- deploy-to-qa.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 deploy-to-qa.sh diff --git a/deploy-to-qa.sh b/deploy-to-qa.sh new file mode 100644 index 0000000..47bbc21 --- /dev/null +++ b/deploy-to-qa.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +git clone https://github.com/ProcessMaker/pm4core-docker.git --branch v2 --depth 1 + +sed -i "s#\${CI_PROJECT}#$CI_PROJECT#g" pm4core-docker/docker-compose.yml +sed -i "s#\${CI_PACKAGE_BRANCH}#$CI_PACKAGE_BRANCH#g" pm4core-docker/docker-compose.yml +sed -i "s#\${PM_APP_PORT}#$PM_APP_PORT#g" pm4core-docker/docker-compose.yml +sed -i "s#\${PM_BROADCASTER_PORT}#$PM_BROADCASTER_PORT#g" pm4core-docker/docker-compose.yml +sed -i "s#\${PM_DOCKER_SOCK}#/var/run/docker.sock#g" pm4core-docker/docker-compose.yml +sed -i "s#\${IMAGE_TAG}#$IMAGE_TAG#g" pm4core-docker/docker-compose.yml + +ssh ssh-qapackages-pm4 " sudo rm -rf /home/DeployQA/$CI_PROJECT-$CI_PACKAGE_BRANCH/*" +ssh ssh-qapackages-pm4 " sudo mkdir -p /home/DeployQA/$CI_PROJECT-$CI_PACKAGE_BRANCH" +ssh ssh-qapackages-pm4 " sudo chmod 777 /home/DeployQA/$CI_PROJECT-$CI_PACKAGE_BRANCH" +scp -r -o StrictHostKeyChecking=no -o ProxyCommand='ssh -o StrictHostKeyChecking=no buildbot@buildbot.processmaker.net -A -W %h:%p' pm4core-docker buildbot@qa-pm4packages:/home/DeployQA/$CI_PROJECT-$CI_PACKAGE_BRANCH/ +ssh ssh-qapackages-pm4 " sudo docker login -u=processmaker -p=$DOCKERHUB_TOKEN" +ssh ssh-qapackages-pm4 " sudo docker-compose -p $CI_PROJECT-$CI_PACKAGE_BRANCH -f /home/DeployQA/$CI_PROJECT-$CI_PACKAGE_BRANCH/pm4core-docker/docker-compose.yml up web >/dev/null 2>&1 &" From 2b524ed62a1111e376d81b5b87797a8783ddb3a6 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Aug 2022 16:16:44 -0700 Subject: [PATCH 49/71] Re-enable phpunit in existing CI --- build-files/cicd-run-phpunit.sh | 5 +++-- pm4-tools/cli/ProcessMaker/PackagesCi.php | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build-files/cicd-run-phpunit.sh b/build-files/cicd-run-phpunit.sh index bc8a323..a95aefa 100644 --- a/build-files/cicd-run-phpunit.sh +++ b/build-files/cicd-run-phpunit.sh @@ -7,7 +7,8 @@ done mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "DROP DATABASE IF EXISTS test;" mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "CREATE DATABASE test;" -mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT test < database.sql +# mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT test < database.sql cd /code/pm4 -vendor/bin/paratest -p $PARALLEL_TEST_PROCESSES \ No newline at end of file +# vendor/bin/paratest -p $PARALLEL_TEST_PROCESSES +vendor/bin/phpunit \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index c0ad957..3066f01 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -50,9 +50,11 @@ public function install() $this->artisanCommand('optimize:clear'); $this->artisanCommand('horizon:terminate'); - info("Modifying phpunit.xml to add package tests"); - PhpUnit::addTests(PhpUnit::configFile()); - $this->exportDatabase(); + // Skip until package unit test fixes are merged + // info("Modifying phpunit.xml to add package tests"); + // PhpUnit::addTests(PhpUnit::configFile()); + // $this->exportDatabase(); + $this->cleanUp(); info("Done"); From 2924f58c215e39ca3e2b63260a478a011a5238e6 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 09:40:42 -0700 Subject: [PATCH 50/71] Only install specific packages --- Dockerfile.cicd | 3 ++- packages-to-install.php | 11 +++++++++++ pm4-tools/cli/ProcessMaker/Packages.php | 14 +++++++++----- pm4-tools/cli/ProcessMaker/PackagesCi.php | 7 +++---- pm4-tools/cli/ProcessMaker/PhpUnit.php | 2 +- 5 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 packages-to-install.php diff --git a/Dockerfile.cicd b/Dockerfile.cicd index d63739c..f741a51 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -10,4 +10,5 @@ RUN composer install --no-interaction WORKDIR /code COPY build-files/cicd-build-run.sh . COPY build-files/cicd-run-app.sh . -COPY build-files/cicd-run-phpunit.sh . \ No newline at end of file +COPY build-files/cicd-run-phpunit.sh . +COPY packages-to-install.php . \ No newline at end of file diff --git a/packages-to-install.php b/packages-to-install.php new file mode 100644 index 0000000..9ee2436 --- /dev/null +++ b/packages-to-install.php @@ -0,0 +1,11 @@ + [ 'tests' => false ], + 'package-comments' => [ 'tests' => false ], + 'package-googleplaces' => [ 'tests' => false ], + 'package-process-documenter' => [ 'tests' => false ], + 'package-process-optimization' => [ 'tests' => false ], + 'package-sentry' => [ 'tests' => false ], + 'package-signature' => [ 'tests' => false ], + 'packages' => [ 'tests' => false ], +]; \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index 441a590..eb6db19 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -500,12 +500,16 @@ public function buildPackageInstallCommands(bool $for_41_develop = false, bool $ }); } - public function getEnterprisePackages() + public function getEnterprisePackages($tests = false) { - $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); - $composer = json_decode($composer, true); - $list = Arr::get($composer, 'extra.processmaker.enterprise', []); - return collect(array_keys($list)); + // $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); + // $composer = json_decode($composer, true); + // $list = Arr::get($composer, 'extra.processmaker.enterprise', []); + $list = collect(require(__DIR__ . '/../../../packages-to-install.php')); + if ($tests) { + $list = $list->filter(fn($p) => $p['tests'] === true); + } + return $list->keys(); } public function getJavascriptPackages($path) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 3066f01..76b6af7 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -50,10 +50,9 @@ public function install() $this->artisanCommand('optimize:clear'); $this->artisanCommand('horizon:terminate'); - // Skip until package unit test fixes are merged - // info("Modifying phpunit.xml to add package tests"); - // PhpUnit::addTests(PhpUnit::configFile()); - // $this->exportDatabase(); + info("Modifying phpunit.xml to add package tests"); + PhpUnit::addTests(PhpUnit::configFile()); + $this->exportDatabase(); $this->cleanUp(); diff --git a/pm4-tools/cli/ProcessMaker/PhpUnit.php b/pm4-tools/cli/ProcessMaker/PhpUnit.php index 3401c2c..b7dca99 100644 --- a/pm4-tools/cli/ProcessMaker/PhpUnit.php +++ b/pm4-tools/cli/ProcessMaker/PhpUnit.php @@ -13,7 +13,7 @@ class PhpUnit { public function addTests($path) { - $list = Packages::getEnterprisePackages(); + $list = Packages::getEnterprisePackages(true); $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; From 0a6e2f983a78542821e7e7a7556d43f24309fb45 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 11:19:22 -0700 Subject: [PATCH 51/71] Only install prod dependencies --- pm4-tools/cli/ProcessMaker/PackagesCi.php | 36 ++++++++++++----------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 76b6af7..26a8a95 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -41,7 +41,10 @@ public function install() { $this->installCore(); $list = Packages::getEnterprisePackages(); - $list = $this->orderList($list); + + // Our packages-to-install.php is ordered + // $list = $this->orderList($list); + foreach ($list as $package) { info("Artisan installing $package"); $this->artisanInstall($package); @@ -160,14 +163,6 @@ private function composerRequireList($list) })->join(" "); } - // private function installPackagesPackage() - // { - // Git::clone('packages', Config::packagesPath()); - // Composer::addRepositoryPath('packages'); - // Composer::require('processmaker/packages'); - // $this->artisanInstall('packages'); - // } - private function artisanInstall($package) { return $this->artisanCommand("${package}:install"); @@ -390,21 +385,28 @@ private function npmRunDev() { // unsafe-perm is needed to run postinstall scripts as root info("Starting at " . date('c')); - CommandLine::mustRun('npm ci --unsafe-perm', Config::codebasePath()); + CommandLine::mustRun('npm ci --unsafe-perm --omit=dev', Config::codebasePath()); $this->linkDependentPackages(Config::codebasePath()); + CommandLine::mustRun('npm install cross-env', Config::codebasePath()); CommandLine::mustRun('npm run dev', Config::codebasePath()); info("Finished at " . date('c')); } private function orderList($list) { - $list = $list->filter(function($item) { - return !in_array($item, ['connector-docusign', 'connector-pdf-print', 'package-vocabularies', 'package-data-sources']); + return $list->sortBy(function($package) { + switch($package) { + // Must be installed first + case 'package-data-vocabularies': + return 0; + + // Must be installed last + case 'connector-docusign': + return 2; + + default: + return 1; + } }); - $list->prepend('package-data-sources'); - $list->prepend('package-vocabularies'); - $list->push('connector-pdf-print'); - $list->push('connector-docusign'); - return $list; } } From 0c119c8784cc184c114fd2c29acb8846a8c19539 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 11:19:32 -0700 Subject: [PATCH 52/71] Use node 16 for base image --- Dockerfile.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.base b/Dockerfile.base index a93c8df..a573868 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -11,7 +11,7 @@ nginx vim curl git unzip wget supervisor cron mysql-client build-essential # # node # -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt -y install nodejs # From 6800a6633d535c9a68f47f21bd009ea40a62248d Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 11:19:48 -0700 Subject: [PATCH 53/71] Enable testdox for phpunit for better output --- build-files/cicd-run-phpunit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-files/cicd-run-phpunit.sh b/build-files/cicd-run-phpunit.sh index a95aefa..07ee10e 100644 --- a/build-files/cicd-run-phpunit.sh +++ b/build-files/cicd-run-phpunit.sh @@ -11,4 +11,4 @@ mysql -u $DB_USERNAME -p"$DB_PASSWORD" -h $DB_HOSTNAME -P $DB_PORT -e "CREATE DA cd /code/pm4 # vendor/bin/paratest -p $PARALLEL_TEST_PROCESSES -vendor/bin/phpunit \ No newline at end of file +vendor/bin/phpunit --testdox \ No newline at end of file From c1efc049f9f5b84a13ee9feddc98249a08d4c6e5 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 16:02:37 -0700 Subject: [PATCH 54/71] Add package-webentry --- docker-compose.yml | 2 +- packages-to-install.php | 2 ++ pm4-tools/cli/ProcessMaker/PackagesCi.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 20385d8..aca8c0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,7 +80,7 @@ services: - redis mysql: - image: mysql:5.7 + image: mysql:8 restart: always environment: MYSQL_ROOT_PASSWORD: password diff --git a/packages-to-install.php b/packages-to-install.php index 9ee2436..798ec26 100644 --- a/packages-to-install.php +++ b/packages-to-install.php @@ -8,4 +8,6 @@ 'package-sentry' => [ 'tests' => false ], 'package-signature' => [ 'tests' => false ], 'packages' => [ 'tests' => false ], + + 'package-webentry' => [ 'tests' => true ], ]; \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 26a8a95..2bdbec8 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -55,7 +55,7 @@ public function install() info("Modifying phpunit.xml to add package tests"); PhpUnit::addTests(PhpUnit::configFile()); - $this->exportDatabase(); + // $this->exportDatabase(); $this->cleanUp(); From 407972604e5ecd309f1073ea9bba93ef50abb3bd Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 Sep 2022 16:49:20 -0700 Subject: [PATCH 55/71] Install the current project and any packages listed in the pr body --- packages-to-install.php | 2 -- pm4-tools/cli/ProcessMaker/Packages.php | 18 +++++++++++++++++- pm4-tools/cli/ProcessMaker/PackagesCi.php | 9 +++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/packages-to-install.php b/packages-to-install.php index 798ec26..9ee2436 100644 --- a/packages-to-install.php +++ b/packages-to-install.php @@ -8,6 +8,4 @@ 'package-sentry' => [ 'tests' => false ], 'package-signature' => [ 'tests' => false ], 'packages' => [ 'tests' => false ], - - 'package-webentry' => [ 'tests' => true ], ]; \ No newline at end of file diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index eb6db19..3873289 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -505,11 +505,27 @@ public function getEnterprisePackages($tests = false) // $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); // $composer = json_decode($composer, true); // $list = Arr::get($composer, 'extra.processmaker.enterprise', []); + $list = collect(require(__DIR__ . '/../../../packages-to-install.php')); if ($tests) { $list = $list->filter(fn($p) => $p['tests'] === true); } - return $list->keys(); + + $list = $list->keys(); + + // Always install the current package + if (PackagesCi::repoName() !== 'processmaker') { + $list->push(PackagesCi::repoName()); + } + + // Always install packages listed in the pr body + foreach(PackagesCi::getBranches() as $key => $branch) { + if ($key !== 'processmaker') { + $list->push($key); + } + } + + return $list; } public function getJavascriptPackages($path) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 2bdbec8..52e50cf 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -43,7 +43,7 @@ public function install() $list = Packages::getEnterprisePackages(); // Our packages-to-install.php is ordered - // $list = $this->orderList($list); + $list = $this->orderList($list); foreach ($list as $package) { info("Artisan installing $package"); @@ -198,6 +198,11 @@ private function setBranches() $this->branches[$this->repoName()] = $this->pullRequestBranch(); } + public function getBranches() + { + return $this->branches; + } + private function pullRequestBody() { return Config::env('CI_PR_BODY'); @@ -208,7 +213,7 @@ private function pullRequestBranch() return Config::env('CI_PACKAGE_BRANCH'); } - private function repoName() + public function repoName() { return Config::env('CI_PROJECT'); } From 22a2188cfb08e5af703675a56bbe0e9aa374e7f3 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 2 Sep 2022 09:50:54 -0700 Subject: [PATCH 56/71] Update packages-to-install.php --- packages-to-install.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages-to-install.php b/packages-to-install.php index 9ee2436..075fc03 100644 --- a/packages-to-install.php +++ b/packages-to-install.php @@ -8,4 +8,7 @@ 'package-sentry' => [ 'tests' => false ], 'package-signature' => [ 'tests' => false ], 'packages' => [ 'tests' => false ], -]; \ No newline at end of file + + 'package-versions' => [ 'tests' => true ], + 'package-translations' => [ 'tests' => true ], +]; From 0b2c2ec82516a9a987cd4f661b641d9141833825 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 8 Sep 2022 12:26:52 -0700 Subject: [PATCH 57/71] Add debugging --- pm4-tools/cli/ProcessMaker/PackagesCi.php | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 52e50cf..1b40aa2 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -1,18 +1,20 @@ exportDatabase(); - + $this->cleanUp(); info("Done"); @@ -158,7 +160,7 @@ private function updateManifest($package) private function composerRequireList($list) { - return $list->map(function($package) { + return $list->map(function ($package) { return "processmaker/$package"; })->join(" "); } @@ -170,7 +172,7 @@ private function artisanInstall($package) private function artisanCommand($cmd) { - return CommandLine::runCommand("php artisan ${cmd}", function($code, $output) { + return CommandLine::runCommand("php artisan ${cmd}", function ($code, $output) { throw new \Exception($output); }, Config::codebasePath()); } @@ -189,6 +191,7 @@ public function getBranch($package) private function setBranches() { + info("Setting branches from pull request body: " . $this->pullRequestBody()); $result = preg_match_all('/ci:(.+?):(.+?)(\s|$)/', $this->pullRequestBody(), $matches); if ($result && $result > 0) { $this->branches = array_combine($matches[1], $matches[2]); @@ -196,6 +199,7 @@ private function setBranches() $this->branches = []; } $this->branches[$this->repoName()] = $this->pullRequestBranch(); + info("Branches are now: " . print_r($this->branches, true)); } public function getBranches() @@ -342,7 +346,6 @@ private function installJavascriptPackages($packages) { $packagesToBuild = []; foreach ($packages as $package) { - // Only clone/build/link if specified in the PR // Otherwise, just use core's package.json if (!$this->getBranch($package)) { @@ -399,13 +402,13 @@ private function npmRunDev() private function orderList($list) { - return $list->sortBy(function($package) { + return $list->sortBy(function ($package) { switch($package) { // Must be installed first case 'package-data-vocabularies': return 0; - // Must be installed last + // Must be installed last case 'connector-docusign': return 2; From 6f64e09c36e34b7a328cd67edc003c21bc6a5d16 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 8 Sep 2022 12:37:19 -0700 Subject: [PATCH 58/71] Add debugging --- pm4-tools/cli/ProcessMaker/Packages.php | 1 + pm4-tools/cli/ProcessMaker/PackagesCi.php | 2 -- pm4-tools/cli/ProcessMaker/PhpUnit.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index 3873289..393ba5c 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -519,6 +519,7 @@ public function getEnterprisePackages($tests = false) } // Always install packages listed in the pr body + info("Branches found in PR: " . print_r(PackagesCi::getBranches(), true)); foreach(PackagesCi::getBranches() as $key => $branch) { if ($key !== 'processmaker') { $list->push($key); diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 1b40aa2..98aaa68 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -191,7 +191,6 @@ public function getBranch($package) private function setBranches() { - info("Setting branches from pull request body: " . $this->pullRequestBody()); $result = preg_match_all('/ci:(.+?):(.+?)(\s|$)/', $this->pullRequestBody(), $matches); if ($result && $result > 0) { $this->branches = array_combine($matches[1], $matches[2]); @@ -199,7 +198,6 @@ private function setBranches() $this->branches = []; } $this->branches[$this->repoName()] = $this->pullRequestBranch(); - info("Branches are now: " . print_r($this->branches, true)); } public function getBranches() diff --git a/pm4-tools/cli/ProcessMaker/PhpUnit.php b/pm4-tools/cli/ProcessMaker/PhpUnit.php index b7dca99..f00099c 100644 --- a/pm4-tools/cli/ProcessMaker/PhpUnit.php +++ b/pm4-tools/cli/ProcessMaker/PhpUnit.php @@ -14,6 +14,7 @@ class PhpUnit public function addTests($path) { $list = Packages::getEnterprisePackages(true); + info("Phpunit - packages to search for tests in: ", print_r($list, true)); $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; @@ -28,6 +29,7 @@ public function addTests($path) $testsDirectory = Config::packagesPath($package) . "/tests"; if (FileSystem::exists($testsDirectory)) { $directory = $dom->createElement('directory', $testsDirectory); + info("Phpunit - Adding $directory"); $directories->appendChild($directory); } } From 45e6cb9d8534e0c9ab3ea7f743f23f7f7d23ed6a Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 8 Sep 2022 13:51:11 -0700 Subject: [PATCH 59/71] Fix branches --- packages-to-install.php | 4 ++++ pm4-tools/cli/ProcessMaker/Packages.php | 2 +- pm4-tools/cli/ProcessMaker/PackagesCi.php | 3 +++ pm4-tools/cli/ProcessMaker/PhpUnit.php | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages-to-install.php b/packages-to-install.php index 075fc03..d70ab20 100644 --- a/packages-to-install.php +++ b/packages-to-install.php @@ -11,4 +11,8 @@ 'package-versions' => [ 'tests' => true ], 'package-translations' => [ 'tests' => true ], + + // Add new packages here or enable tests only after unit test fixes are merged into develop + 'connector-send-email' => [ 'tests' => false ], + 'package-collections' => [ 'tests' => false ], ]; diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index 393ba5c..50a62c3 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -502,6 +502,7 @@ public function buildPackageInstallCommands(bool $for_41_develop = false, bool $ public function getEnterprisePackages($tests = false) { + // TODO: Bring this part back when all unit test fixes are merged // $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); // $composer = json_decode($composer, true); // $list = Arr::get($composer, 'extra.processmaker.enterprise', []); @@ -519,7 +520,6 @@ public function getEnterprisePackages($tests = false) } // Always install packages listed in the pr body - info("Branches found in PR: " . print_r(PackagesCi::getBranches(), true)); foreach(PackagesCi::getBranches() as $key => $branch) { if ($key !== 'processmaker') { $list->push($key); diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index 98aaa68..ccbf2bf 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -202,6 +202,9 @@ private function setBranches() public function getBranches() { + if (!$this->branches) { + $this->setBranches(); + } return $this->branches; } diff --git a/pm4-tools/cli/ProcessMaker/PhpUnit.php b/pm4-tools/cli/ProcessMaker/PhpUnit.php index f00099c..e16bb2c 100644 --- a/pm4-tools/cli/ProcessMaker/PhpUnit.php +++ b/pm4-tools/cli/ProcessMaker/PhpUnit.php @@ -28,8 +28,8 @@ public function addTests($path) { $testsDirectory = Config::packagesPath($package) . "/tests"; if (FileSystem::exists($testsDirectory)) { + info("Phpunit - Adding $testsDirectory"); $directory = $dom->createElement('directory', $testsDirectory); - info("Phpunit - Adding $directory"); $directories->appendChild($directory); } } From b69c51c7e3d36915825bdce40897cfdb19d44c48 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 12 Sep 2022 08:23:14 -0700 Subject: [PATCH 60/71] Update packages-to-install.php --- packages-to-install.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages-to-install.php b/packages-to-install.php index d70ab20..842b939 100644 --- a/packages-to-install.php +++ b/packages-to-install.php @@ -15,4 +15,5 @@ // Add new packages here or enable tests only after unit test fixes are merged into develop 'connector-send-email' => [ 'tests' => false ], 'package-collections' => [ 'tests' => false ], + 'package-savedsearch' => [ 'tests' => false ], ]; From d54ba7b10f83b36697f46d0b3deb2f099e590350 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 19 Sep 2022 11:43:56 -0700 Subject: [PATCH 61/71] Bring back all packages --- pm4-tools/cli/ProcessMaker/Packages.php | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index 50a62c3..40535d2 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -503,30 +503,32 @@ public function buildPackageInstallCommands(bool $for_41_develop = false, bool $ public function getEnterprisePackages($tests = false) { // TODO: Bring this part back when all unit test fixes are merged - // $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); - // $composer = json_decode($composer, true); - // $list = Arr::get($composer, 'extra.processmaker.enterprise', []); + $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); + $composer = json_decode($composer, true); + $list = Arr::get($composer, 'extra.processmaker.enterprise', []); - $list = collect(require(__DIR__ . '/../../../packages-to-install.php')); - if ($tests) { - $list = $list->filter(fn($p) => $p['tests'] === true); - } + return collect(array_keys($list)); - $list = $list->keys(); + // $list = collect(require(__DIR__ . '/../../../packages-to-install.php')); + // if ($tests) { + // $list = $list->filter(fn($p) => $p['tests'] === true); + // } - // Always install the current package - if (PackagesCi::repoName() !== 'processmaker') { - $list->push(PackagesCi::repoName()); - } + // $list = $list->keys(); - // Always install packages listed in the pr body - foreach(PackagesCi::getBranches() as $key => $branch) { - if ($key !== 'processmaker') { - $list->push($key); - } - } + // // Always install the current package + // if (PackagesCi::repoName() !== 'processmaker') { + // $list->push(PackagesCi::repoName()); + // } + + // // Always install packages listed in the pr body + // foreach(PackagesCi::getBranches() as $key => $branch) { + // if ($key !== 'processmaker') { + // $list->push($key); + // } + // } - return $list; + // return $list; } public function getJavascriptPackages($path) From 22296b7f91655d8c830f553cfad990f9d0427542 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Fri, 7 Oct 2022 16:15:49 -0700 Subject: [PATCH 62/71] Support variable base version --- Dockerfile-php81.base | 68 +++++++++++++++++++++++++++++++++++++++++++ Dockerfile.cicd | 3 +- docker-compose.yml | 9 ++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Dockerfile-php81.base diff --git a/Dockerfile-php81.base b/Dockerfile-php81.base new file mode 100644 index 0000000..c0abc59 --- /dev/null +++ b/Dockerfile-php81.base @@ -0,0 +1,68 @@ +FROM ubuntu:20.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ="America/Los_Angeles" + +RUN apt update +RUN apt install -y software-properties-common +RUN add-apt-repository ppa:ondrej/php + +RUN apt install -y php8.1 php8.1-cli php8.1-fpm php8.1-common +RUN apt install -y php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath php8.1-imagick php8.1-dom php8.1-sqlite3 php8.1-imap +RUN apt install -y nginx vim curl git unzip wget supervisor cron mysql-client build-essential + +# +# node +# +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - +RUN apt -y install nodejs + +# +# install composer +# +RUN wget -O composer-setup.php https://getcomposer.org/installer +RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer +RUN composer self-update + +# +# cron +# +COPY build-files/laravel-cron /etc/cron.d/laravel-cron +RUN chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron + +# +# docker client +# +ENV DOCKERVERSION=20.10.5 +RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \ + && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \ + -C /usr/local/bin docker/docker \ + && rm docker-${DOCKERVERSION}.tgz + +# +# configure php-fpm to run as root +# +RUN sed -i 's/www-data/root/g' /etc/php/8.1/fpm/pool.d/www.conf + +# +# nginx +# +COPY build-files/nginx.conf /etc/nginx/nginx.conf + +# +# supervisord +# +COPY build-files/services.conf /etc/supervisor/conf.d/services.conf + +# +# laravel echo server +# +RUN mkdir -p /code +COPY build-files/laravel-echo-server.json /code + +# populate $_ENV with environment variables +RUN echo "variables_order = \"EGPCS\"" > /etc/php/8.1/cli/conf.d/30-env.ini + +# Use the correct version of mysqldump +# COPY --from=mysql:5.7 /usr/bin/mysqldump /usr/bin/mysqldump + +EXPOSE 80 443 6001 \ No newline at end of file diff --git a/Dockerfile.cicd b/Dockerfile.cicd index f741a51..b4e7ee5 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -1,4 +1,5 @@ -FROM processmaker/pm4-base:2.0.0 +ARG BASE_VERSION +FROM processmaker/pm4-base:${BASE_VERSION} RUN npm config set cache /cache/npm --global ENV COMPOSER_HOME=/cache/composer diff --git a/docker-compose.yml b/docker-compose.yml index aca8c0d..42d3796 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,15 @@ services: build: context: . dockerfile: Dockerfile.cicd + args: + - BASE_VERSION=${BASE_VERSION:-2.0.0} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN - CI_PR_BODY - CI_PROJECT - CI_PACKAGE_BRANCH + - BASE_VERSION env_file: - .env-cicd links: @@ -27,6 +30,12 @@ services: build: context: . dockerfile: Dockerfile.base + + base-php81: + image: processmaker/pm4-base:2.1.0 + build: + context: . + dockerfile: Dockerfile-php81.base redis: image: redis From 4d19b5ab66901034cca5a6daf7b8080765ee459f Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 10 Oct 2022 14:00:03 -0700 Subject: [PATCH 63/71] Use node 16.15.0 in base image --- .env-cicd | 1 - Dockerfile-php81.base => Dockerfile.php81.base | 17 ++++++++++++----- docker-compose.yml | 2 +- pm4-tools/cli/ProcessMaker/Packages.php | 4 ++-- pm4-tools/cli/ProcessMaker/PackagesCi.php | 2 ++ pm4-tools/includes/helpers.php | 1 + 6 files changed, 18 insertions(+), 9 deletions(-) rename Dockerfile-php81.base => Dockerfile.php81.base (77%) diff --git a/.env-cicd b/.env-cicd index 84a57fd..0e8e277 100644 --- a/.env-cicd +++ b/.env-cicd @@ -21,4 +21,3 @@ TELESCOPE_ENABLED=false BUILD_JAVASCRIPT=true # COMPOSER_MIRROR_PATH_REPOS=1 -PARALLEL_TEST_PROCESSES=6 diff --git a/Dockerfile-php81.base b/Dockerfile.php81.base similarity index 77% rename from Dockerfile-php81.base rename to Dockerfile.php81.base index c0abc59..d764023 100644 --- a/Dockerfile-php81.base +++ b/Dockerfile.php81.base @@ -13,8 +13,18 @@ RUN apt install -y nginx vim curl git unzip wget supervisor cron mysql-client bu # # node # -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - -RUN apt -y install nodejs +# RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - +# RUN apt -y install nodejs + +ENV NVM_DIR /root/.nvm +ENV NODE_VERSION 16.15.0 +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash && \ + . "$NVM_DIR/nvm.sh" && \ + nvm install $NODE_VERSION && \ + nvm alias default $NODE_VERSION && \ + nvm use default +ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH # # install composer @@ -62,7 +72,4 @@ COPY build-files/laravel-echo-server.json /code # populate $_ENV with environment variables RUN echo "variables_order = \"EGPCS\"" > /etc/php/8.1/cli/conf.d/30-env.ini -# Use the correct version of mysqldump -# COPY --from=mysql:5.7 /usr/bin/mysqldump /usr/bin/mysqldump - EXPOSE 80 443 6001 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 42d3796..c25518a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: image: processmaker/pm4-base:2.1.0 build: context: . - dockerfile: Dockerfile-php81.base + dockerfile: Dockerfile.php81.base redis: image: redis diff --git a/pm4-tools/cli/ProcessMaker/Packages.php b/pm4-tools/cli/ProcessMaker/Packages.php index 40535d2..4bf34c4 100644 --- a/pm4-tools/cli/ProcessMaker/Packages.php +++ b/pm4-tools/cli/ProcessMaker/Packages.php @@ -503,7 +503,7 @@ public function buildPackageInstallCommands(bool $for_41_develop = false, bool $ public function getEnterprisePackages($tests = false) { // TODO: Bring this part back when all unit test fixes are merged - $composer = FileSystem::get(ConfigFacade::codebasePath() . '/composer.json'); + $composer = FileSystemFacade::get(ConfigFacade::codebasePath() . '/composer.json'); $composer = json_decode($composer, true); $list = Arr::get($composer, 'extra.processmaker.enterprise', []); @@ -533,7 +533,7 @@ public function getEnterprisePackages($tests = false) public function getJavascriptPackages($path) { - $composer = FileSystem::get($path . '/package.json'); + $composer = FileSystemFacade::get($path . '/package.json'); $composer = json_decode($composer, true); $list = Arr::get($composer, 'dependencies', []); return collect(array_keys($list))->filter(function($package) { diff --git a/pm4-tools/cli/ProcessMaker/PackagesCi.php b/pm4-tools/cli/ProcessMaker/PackagesCi.php index ccbf2bf..13972fb 100644 --- a/pm4-tools/cli/ProcessMaker/PackagesCi.php +++ b/pm4-tools/cli/ProcessMaker/PackagesCi.php @@ -7,6 +7,8 @@ use Composer; use CommandLine; use FileSystem; +use Packages; +use PhpUnit; use Illuminate\Contracts\Filesystem\Filesystem as FilesystemFilesystem; use Illuminate\Filesystem\Filesystem as IlluminateFilesystemFilesystem; use Illuminate\Support\Arr; diff --git a/pm4-tools/includes/helpers.php b/pm4-tools/includes/helpers.php index 9596fc9..eb9bb88 100644 --- a/pm4-tools/includes/helpers.php +++ b/pm4-tools/includes/helpers.php @@ -6,6 +6,7 @@ use Illuminate\Container\Container; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\ConsoleOutput; +use \Config; // if (!defined('BREW_PREFIX')) { // define('BREW_PREFIX', (new CommandLine())->runAsUser('printf $(brew --prefix)')); From 6354b78a9786854c6918d12c8d83a1b2cc72a341 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 17 Oct 2022 15:51:52 -0700 Subject: [PATCH 64/71] Use npm 8.9 --- Dockerfile.php81.base | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.php81.base b/Dockerfile.php81.base index d764023..b357f22 100644 --- a/Dockerfile.php81.base +++ b/Dockerfile.php81.base @@ -26,6 +26,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | b ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH +RUN npm install -g npm@8.9 + # # install composer # From 10b173f080aa5445db286f1b1551b64413e110cc Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Mon, 17 Oct 2022 15:52:12 -0700 Subject: [PATCH 65/71] Default to base 2.1.1 --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c25518a..228cdaf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.0.0} + - BASE_VERSION=${BASE_VERSION:-2.1.1} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -32,7 +32,7 @@ services: dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:2.1.0 + image: processmaker/pm4-base:2.1.1 build: context: . dockerfile: Dockerfile.php81.base From 7a1fa3b959657ab82c6624f50d2a0605b37c5319 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 18 Oct 2022 14:04:30 -0700 Subject: [PATCH 66/71] Going back to the default npm 8.5 --- Dockerfile.php81.base | 2 -- docker-compose.yml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile.php81.base b/Dockerfile.php81.base index b357f22..d764023 100644 --- a/Dockerfile.php81.base +++ b/Dockerfile.php81.base @@ -26,8 +26,6 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | b ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH -RUN npm install -g npm@8.9 - # # install composer # diff --git a/docker-compose.yml b/docker-compose.yml index 228cdaf..3c80214 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.1.1} + - BASE_VERSION=${BASE_VERSION:-2.1.2} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -32,7 +32,7 @@ services: dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:2.1.1 + image: processmaker/pm4-base:2.1.2 build: context: . dockerfile: Dockerfile.php81.base From 4f995cdad1af021471c4eba628b5654c37619cf5 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 19 Oct 2022 12:35:19 -0700 Subject: [PATCH 67/71] Use npm 8.9 again --- Dockerfile.php81.base | 2 ++ docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.php81.base b/Dockerfile.php81.base index d764023..b357f22 100644 --- a/Dockerfile.php81.base +++ b/Dockerfile.php81.base @@ -26,6 +26,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | b ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH +RUN npm install -g npm@8.9 + # # install composer # diff --git a/docker-compose.yml b/docker-compose.yml index 3c80214..9d07fa3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.1.2} + - BASE_VERSION=${BASE_VERSION:-2.1.3} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -32,7 +32,7 @@ services: dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:2.1.2 + image: processmaker/pm4-base:2.1.3 build: context: . dockerfile: Dockerfile.php81.base From 98b26a60a334245260ac13710e960298888a7127 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Nov 2022 10:09:11 -0800 Subject: [PATCH 68/71] Update to node 16.18.1 --- Dockerfile.php81.base | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.php81.base b/Dockerfile.php81.base index b357f22..e0ac28e 100644 --- a/Dockerfile.php81.base +++ b/Dockerfile.php81.base @@ -17,7 +17,7 @@ RUN apt install -y nginx vim curl git unzip wget supervisor cron mysql-client bu # RUN apt -y install nodejs ENV NVM_DIR /root/.nvm -ENV NODE_VERSION 16.15.0 +ENV NODE_VERSION 16.18.1 RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash && \ . "$NVM_DIR/nvm.sh" && \ nvm install $NODE_VERSION && \ @@ -26,7 +26,7 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | b ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH -RUN npm install -g npm@8.9 +RUN npm install -g npm@8.19 # # install composer From 004d6a4268e6bba62039888c14f14162f83fcd38 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Nov 2022 10:18:16 -0800 Subject: [PATCH 69/71] Update default base image --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9d07fa3..0c2f10c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.1.3} + - BASE_VERSION=${BASE_VERSION:-2.1.5} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -32,7 +32,7 @@ services: dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:2.1.3 + image: processmaker/pm4-base:${BASE_VERSION:-2.1.5} build: context: . dockerfile: Dockerfile.php81.base From 8da24620080c41ed49f946e6b62bceb91158736d Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Nov 2022 17:09:01 -0800 Subject: [PATCH 70/71] Update docker-compose.yml --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0c2f10c..521eb92 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.1.5} + - BASE_VERSION=${BASE_VERSION:-2.1.6} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -25,14 +25,14 @@ services: volumes: - ./cache:/cache - base: + base-old: image: processmaker/pm4-base:2.0.0 build: context: . dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:${BASE_VERSION:-2.1.5} + image: processmaker/pm4-base:${BASE_VERSION:-2.1.6} build: context: . dockerfile: Dockerfile.php81.base From 2356fb0c9884fd2c0c3a2e1b3bbb8860996b4212 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 8 Feb 2023 11:20:27 -0800 Subject: [PATCH 71/71] Bump base version --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 521eb92..f9449be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile.cicd args: - - BASE_VERSION=${BASE_VERSION:-2.1.6} + - BASE_VERSION=${BASE_VERSION:-2.1.7} command: sh cicd-build-run.sh environment: - GITHUB_TOKEN @@ -32,7 +32,7 @@ services: dockerfile: Dockerfile.base base-php81: - image: processmaker/pm4-base:${BASE_VERSION:-2.1.6} + image: processmaker/pm4-base:${BASE_VERSION:-2.1.7} build: context: . dockerfile: Dockerfile.php81.base