Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ochorocho/tdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: ochorocho/tdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 1,432 additions and 124 deletions.
  1. +2 −0 .gitattributes
  2. +42 −0 .github/workflows/build.yml
  3. +53 −3 .github/workflows/test.yml
  4. +3 −2 .gitignore
  5. +1 −1 .gitmessage.txt
  6. +47 −29 .gitpod.yml
  7. +0 −4 .gitpod/commands/preview.sh
  8. +26 −0 .gitpod/docker/Dockerfile
  9. +38 −0 .gitpod/docker/build.sh
  10. +38 −0 .gitpod/docker/config/apache.conf
  11. +10 −0 .gitpod/docker/config/envvars.txt
  12. +97 −0 .gitpod/docker/config/imagemagick-policy.xml
  13. +59 −0 .gitpod/docker/config/install-php.sh
  14. +10 −0 .gitpod/docker/config/mysql-client.cnf
  15. +26 −0 .gitpod/docker/config/mysql.cnf
  16. +12 −0 .gitpod/docker/config/php-setup.sh
  17. +10 −0 .gitpod/docker/config/xdebug.ini
  18. +98 −0 .gitpod/docker/scripts/mailpit
  19. +98 −0 .gitpod/docker/scripts/mysql
  20. +162 −0 .gitpod/docker/scripts/tdk
  21. +43 −0 .gitpod/docker/scripts/tdk-completion
  22. +22 −0 .gitpod/docker/test.sh
  23. +0 −10 .gitpod/images/Dockerfile
  24. +0 −4 .gitpod/images/build.sh
  25. +0 −4 .gitpod/images/test.sh
  26. +54 −0 .gitpod/info.md
  27. +9 −0 .gitpod/php/version.php
  28. +12 −0 .gitpod/phpstorm/codeception.xml
  29. +12 −0 .gitpod/phpstorm/dataSources.xml
  30. +8 −0 .gitpod/phpstorm/modules.xml
  31. +32 −0 .gitpod/phpstorm/php-test-framework.xml
  32. +144 −0 .gitpod/phpstorm/php.xml
  33. +131 −0 .gitpod/phpstorm/tdk.iml
  34. +7 −0 .gitpod/phpstorm/vcs.xml
  35. +50 −0 .gitpod/typo3/AdditionalConfiguration.php
  36. +0 −45 .gitpod/utils/ddev-in-gitpod-setup.sh
  37. +0 −4 .gitpod/utils/env-setup.sh
  38. +12 −0 .gitpod/vscode/launch.json
  39. +23 −0 .gitpod/vscode/settings.json
  40. +1 −1 README.md
  41. +30 −9 Scripts/CommonScript.php
  42. +6 −5 composer.json
  43. +4 −3 tests/Acceptance/TdkCest.php
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.gitpod export-ignore
/.gitpod.yml export-ignore
/tests export-ignore
/.php.cs export-ignore
/codeception.yml export-ignore
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
branches:
- main
schedule:
- cron: "0 1 * * 1"

jobs:
build:
name: Build and Push Container
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.1 ]
steps:
-
name: Checkout code
uses: actions/checkout@v3
-
name: Docker info
run: docker info
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
-
name: Check out code
uses: actions/checkout@v1
-
name: "Build ${{ matrix.php-version }} image"
shell: 'script -q -e -c "bash {0}"'
run: |
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker buildx create --use --platform=linux/arm64,linux/amd64
cd ./.gitpod/docker/
./build.sh -v ${{ matrix.php-version }} -p
56 changes: 53 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: "0 4 * * *"
push:
branches:
- '**'
- '!main'
jobs:
testsuite:
name: Tests
@@ -43,3 +44,52 @@ jobs:

- name: Run acceptance tests
run: ./vendor/bin/codecept run --html
docker:
name: Docker Image Builder
runs-on: ubuntu-latest
steps:
- name: Get Docker Tag Name
id: get-tag
run: |
readonly local tag=$([[ "${{ github.ref_name }}" = "main" ]] && echo "latest" || echo "${{ github.ref_name }}" | tr "/" "-")
echo ::set-output name=tag::$tag
- name: Checkout
uses: actions/checkout@v2

- uses: docker-practice/actions-setup-docker@master
- run: |
set -x
docker version
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ochorocho/gitpod-tdk
tags: |
type=raw,value=${{ steps.get-tag.outputs.tag }},enable=true
-
name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .gitpod/docker/
load: true
tags: ${{ steps.meta.outputs.tags }}
-
name: Test for expected binaries
run: |
echo ${{ steps.get-tag.outputs.tag }}
docker run --rm -v ${GITHUB_WORKSPACE}/.gitpod/docker/test.sh:/tmp/test.sh --entrypoint "bash" ochorocho/gitpod-tdk:${{ steps.get-tag.outputs.tag }} /tmp/test.sh
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ typo3-core
packages/*
!packages/.gitkeep
.ddev/
config/
/config/
test-acceptance-tdk/
/tests/_support/_generated
/tests/_support/_generated
/.vscode
2 changes: 1 addition & 1 deletion .gitmessage.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[BUGFIX|TASK|FEATURE]

Resolves: #
Releases: main, 11.5
Releases: main, 12.4
76 changes: 47 additions & 29 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,71 @@
image: ochorocho/gitpod-tdk:latest
---
# Example
# 8.1 https://gitpod.io/#TDK_PHP_VERSION=8.1,TDK_BRANCH=main,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/main
# 8.0 https://gitpod.io/#TDK_PHP_VERSION=8.0,TDK_BRANCH=main,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/main
# Detect php: https://gitpod.io/#TDK_BRANCH=11.5,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/main
# https://gitpod.io/#TDK_BRANCH=11.5,TDK_PATCH_REF=refs%2Fchanges%2F43%2F70643%2F36,TDK_USERNAME=ochorocho,TDK_PATCH_ID=70643/https://github.com/ochorocho/tdk/tree/feature/add-ssh-command

image: ghcr.io/ochorocho/gitpod-tdk:latest
tasks:
- init: |
.gitpod/utils/ddev-in-gitpod-setup.sh
ddev config --docroot=public --create-docroot --project-type=typo3 --project-name=typo3
command: |
.gitpod/utils/env-setup.sh
- name: TDK
init: |
cp -Rp .gitpod/vscode .vscode
cp -Rp .gitpod/phpstorm .idea
tdk php "$(php .gitpod/php/version.php)" --no-reload
gp open .gitpod/info.md
composer tdk:clone
composer tdk:checkout
composer install
composer tdk:set-git-config
composer tdk:enable-hooks -- --force
composer tdk:set-commit-template -- --file=./.gitmessage.txt
tdk ssh-add
composer tdk:apply-patch
ddev start
touch public/FIRST_INSTALL
composer install
mkdir -p config/system/
cp -Rp .gitpod/typo3/AdditionalConfiguration.php config/system/additional.php
command: |
tdk ssh-add
tdk php "$(php .gitpod/php/version.php)"
sudo service mailpit start
sudo service mysql start
sudo service cron start
sleep 5
tdk db create
TYPO3_CONTEXT=Development TYPO3_DB_DRIVER=mysqli TYPO3_DB_USERNAME=db TYPO3_DB_PASSWORD=db TYPO3_DB_PORT=3306 TYPO3_DB_HOST=127.0.0.1 TYPO3_DB_DBNAME=db TYPO3_SETUP_ADMIN_EMAIL=typo3@example.com TYPO3_SETUP_ADMIN_USERNAME=admin TYPO3_SETUP_ADMIN_PASSWORD=Password.1 TYPO3_PROJECT_NAME=TYPO3-Dev ./vendor/bin/typo3 setup --server-type=apache --force -n
./vendor/bin/typo3 extension:setup
./vendor/bin/typo3 styleguide:generate frontend --create
sleep 5
mysql -udb -pdb db -e 'update pages SET hidden=0 where tx_styleguide_containsdemo = "tx_styleguide_frontend_root";'
composer tdk:help
echo -e "\n** Backend Login **\nUsername: admin\nPassword: Password.1\n"
tdk preview be
# VScode xdebug extension
vscode:
extensions:
# PHP extensions.
- felixfbecker.php-debug
- wongjn.php-sniffer
- neilbrayfield.php-docblocker
- bmewburn.vscode-intelephense-client

# Bash extensions.
- timonwong.shellcheck
- rogalmic.bash-debug
# @todo: Installing sqltools does not work as expected
# it requires a window reload in some cases
- mtxr.sqltools
- mtxr.sqltools-driver-mysql

ports:
# Used by ddev - direct-bind https port
- port: 2222
onOpen: ignore
# Used by ddev - local db clients
- port: 3306
name: database
onOpen: ignore
# Used by projector
- port: 6942
onOpen: ignore
# Used by MailHog
- port: 8025
- port: 8001
name: apache
onOpen: ignore
# Used by phpMyAdmin
- port: 8036
- port: 1025
name: mailpit catcher
onOpen: ignore
# Direct-connect ddev-webserver port that is the main port
- port: 8080
- port: 8025
name: mailpit
onOpen: ignore
# xdebug port
- port: 9000
- port: 9003
name: xdebug
description: xdebug
onOpen: ignore
4 changes: 0 additions & 4 deletions .gitpod/commands/preview.sh

This file was deleted.

26 changes: 26 additions & 0 deletions .gitpod/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Image on docker hub: https://hub.docker.com/r/ochorocho/gitpod-tdk/tags
FROM gitpod/workspace-base:latest

LABEL org.opencontainers.image.source=https://github.com/ochorocho/tdk

USER root

ARG php_version_and_up
ENV PHP_VERSION_UP=${php_version_and_up}
# Add custom config/scripts to container
COPY config /config
COPY config/apache.conf /etc/apache2/apache2.conf
COPY config/envvars.txt /etc/apache2/envvars
COPY scripts/mailpit /etc/init.d/mailpit
COPY scripts/mysql /etc/init.d/mysql
COPY scripts/tdk /usr/bin/
COPY scripts/tdk-completion /etc/bash_completion.d/
COPY config/mysql-client.cnf /etc/mysql/mysql.conf.d/client.cnf
COPY config/mysql.cnf /etc/mysql/mysql.conf.d/mysql.cnf
# Allow ImageMagick 6 to read/write pdf files
COPY config/imagemagick-policy.xml /etc/ImageMagick-6/policy.xml

# Install required packages
RUN add-apt-repository --yes ppa:ondrej/php && \
bash /config/install-php.sh

38 changes: 38 additions & 0 deletions .gitpod/docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

PUSH=""
LOAD=""
IMAGE_NAME="ghcr.io/ochorocho/gitpod-tdk"
IMAGE_VERSION="latest"

help() {
echo "Available options:"
echo " * l - Load the image (--load)"
echo " * p - Push the image (--push)"
echo " * v - PHP versions to install, the given version and up (e.g. 8.1 will install 8.1, 8.2, 8.3, 8.4)"
}

while getopts ":v:hpl" opt; do
case $opt in
h)
help
exit 1
;;
p)
PUSH="--push"
;;
l)
LOAD="--load"
;;
v)
PHP_VERSION_AND_UP="${OPTARG}"
;;
*)
echo "Invalid option: -$OPTARG"
help
exit 1
;;
esac
done

docker build --progress plain --no-cache --pull . -f Dockerfile -t $IMAGE_NAME:$IMAGE_VERSION --build-arg php_version_and_up="${PHP_VERSION_AND_UP:=8.1}" $PUSH $LOAD
38 changes: 38 additions & 0 deletions .gitpod/docker/config/apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Apache httpd v2.4 minimal configuration
# see https://wiki.apache.org/httpd/Minimal_Config for documentation

ServerRoot ${GITPOD_REPO_ROOT}

PidFile ${APACHE_PID_FILE}
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

# Modules as installed/activated via apt-get
IncludeOptional /etc/apache2/mods-enabled/*.load
IncludeOptional /etc/apache2/mods-enabled/*.conf

# Configure hostname and port for server
ServerName ${APACHE_SERVER_NAME}
Listen *:8001

# Configure Logging
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog ${APACHE_LOG_DIR}/access.log common
ErrorLog ${APACHE_LOG_DIR}/error.log

# Never change this block
<Directory />
AllowOverride None
Require all denied
</Directory>

# Direcrory and files to be served
DirectoryIndex index.html index.htm index.php
DocumentRoot "${GITPOD_REPO_ROOT}/${APACHE_DOCROOT_IN_REPO}"
<Directory "${GITPOD_REPO_ROOT}/${APACHE_DOCROOT_IN_REPO}">
AllowOverride all
Require all granted
</Directory>

# Include conf installed via apt-get
IncludeOptional /etc/apache2/conf-enabled/*.conf
10 changes: 10 additions & 0 deletions .gitpod/docker/config/envvars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export APACHE_RUN_USER="gitpod"
export APACHE_RUN_GROUP="gitpod"
export APACHE_RUN_DIR=/var/run/apache2
export APACHE_PID_FILE="$APACHE_RUN_DIR/apache.pid"
export APACHE_LOCK_DIR=/var/lock/apache2
export APACHE_DOCROOT_IN_REPO=public
export APACHE_SERVER_NAME=localhost
export APACHE_LOG_DIR=/var/log/apache2
export TYPO3_CONTEXT=Development
export GITPOD_REPO_ROOT=/workspace/tdk
Loading