Skip to content

Commit

Permalink
[TASK] Integrate Satis into main app (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft authored Aug 16, 2022
1 parent cc16f7d commit 8efd959
Show file tree
Hide file tree
Showing 29 changed files with 2,037 additions and 3,463 deletions.
7 changes: 0 additions & 7 deletions .ddev/commands/web/satisbuild

This file was deleted.

3 changes: 1 addition & 2 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ hooks:
- exec: cp .env.ddev .env.local
- exec: /mnt/ddev_config/scripts/setup-db
- composer: install
- composer: install -d satis
omit_containers: [db, dba]
use_dns_when_possible: true
timezone: Europe/Zurich
Expand Down Expand Up @@ -91,7 +90,7 @@ web_environment: []
# Please take care with this because it can cause great confusion.

# upload_dir: custom/upload/dir
# would set the destination path for ddev import-files to <docroot>/custom/upload/dir
# would set the destination path for ddev import-files to <docroot>/custom/upload/dir

# working_dir:
# web: /var/www/html
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -70,8 +68,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -108,8 +104,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -159,8 +153,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -207,8 +199,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -247,8 +237,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -287,8 +275,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -327,8 +313,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -385,8 +369,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -464,8 +446,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
- uses: actions/checkout@v3
name: Checkout
with:
submodules: 'recursive'

- name: Set up PHP Version
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
/.vscode/
/public/p/
/public/p2/
/public/satis/
/public/aliases.json
/public/packages.json
/public/satis.html
/tools/**/vendor
/.php-cs-fixer.php
/.php-cs-fixer.cache
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

45 changes: 23 additions & 22 deletions .mage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ magephp:
composer:
path: composer
exclude:
- ./.*
- ./.[!.e]*
- ./public/p
- ./public/p2
- ./public/satis
- ./public/aliases.json
- ./public/packages.json
- ./public/satis.html
- ./stubs
- ./tests
- ./tools
Expand All @@ -29,25 +29,26 @@ magephp:
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader --working-dir=satis' }
on-deploy:
- exec: { cmd: 'mkdir -p var', desc: 'Create var folder' }
- exec: { cmd: 'mkdir -p var/satis', desc: 'Create var/satis folder' }
- exec: { cmd: 'test -d ~/site/shared/public/satis || mkdir -p ~/site/shared/public/satis', desc: 'Create shared/public/satis folder' }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/public/p", to: "public/p" }
- fs/link: { from: "../../../../shared/public/p2", to: "public/p2" }
- fs/link: { from: "../../../../shared/public/packages.json", to: "public/packages.json" }
- fs/link: { from: "../../../../shared/public/satis.html", to: "public/satis.html" }
- fs/link: { from: "../../../../shared/public/satis", to: "public/satis" }
- fs/link: { from: "satis/p", to: "public/p" }
- fs/link: { from: "satis/p2", to: "public/p2" }
- fs/link: { from: "satis/aliases.json", to: "public/aliases.json" }
- fs/link: { from: "satis/packages.json", to: "public/packages.json" }
- exec: { cmd: "sqlite3 ~/site/mage/current/var/gettr.db '.backup var/gettr.db'", desc: "Copy DB" }
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache" }
- exec: { cmd: "php ./bin/console doctrine:migrations:sync-metadata-storage --no-interaction", desc: "Synchronize DB Migrations" }
- exec: { cmd: "php ./bin/console doctrine:migrations:migrate --no-interaction", desc: "Apply DB Migrations" }
on-release:
- exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 }
- exec: { cmd: "crontab cnf/crontab-dev.cron", desc: "Install crontab" }
- fs/copy: { from: 'cnf/nginx.conf', to: '../../../../cnf/nginx.conf' }
on-release:
- exec: { cmd: "nginx-reload", desc: "Reload Nginx Configuration" }
post-release:
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache again" }
- exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 }
- exec: { cmd: "crontab cnf/crontab-dev", desc: "Install crontab" }
post-deploy:
production:
user: get
Expand All @@ -59,25 +60,26 @@ magephp:
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader --working-dir=satis' }
on-deploy:
- exec: { cmd: 'mkdir -p var', desc: 'Create var folder' }
- exec: { cmd: 'mkdir -p var/satis', desc: 'Create var/satis folder' }
- exec: { cmd: 'test -d ~/site/shared/public/satis || mkdir -p ~/site/shared/public/satis', desc: 'Create shared/public/satis folder' }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/public/p", to: "public/p" }
- fs/link: { from: "../../../../shared/public/p2", to: "public/p2" }
- fs/link: { from: "../../../../shared/public/packages.json", to: "public/packages.json" }
- fs/link: { from: "../../../../shared/public/satis.html", to: "public/satis.html" }
- fs/link: { from: "../../../../shared/public/satis", to: "public/satis" }
- fs/link: { from: "satis/p", to: "public/p" }
- fs/link: { from: "satis/p2", to: "public/p2" }
- fs/link: { from: "satis/aliases.json", to: "public/aliases.json" }
- fs/link: { from: "satis/packages.json", to: "public/packages.json" }
- exec: { cmd: "sqlite3 ~/site/mage/current/var/gettr.db '.backup var/gettr.db'", desc: "Copy DB" }
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache" }
- exec: { cmd: "php ./bin/console doctrine:migrations:sync-metadata-storage --no-interaction", desc: "Synchronize DB Migrations" }
- exec: { cmd: "php ./bin/console doctrine:migrations:migrate --no-interaction", desc: "Apply DB Migrations" }
on-release:
- exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 }
- exec: { cmd: "crontab cnf/crontab.cron", desc: "Install crontab" }
- fs/copy: { from: 'cnf/nginx.conf', to: '../../../../cnf/nginx.conf' }
on-release:
- exec: { cmd: "nginx-reload", desc: "Reload Nginx Configuration" }
post-release:
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache again" }
- exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 }
- exec: { cmd: "crontab cnf/crontab", desc: "Install crontab" }
post-deploy:
stage:
user: get-stage
Expand All @@ -89,7 +91,6 @@ magephp:
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader --working-dir=satis' }
on-deploy:
- exec: { cmd: 'test -d ~/site/shared || mkdir -p ~/site/shared', desc: 'Create shared folder' }
- exec: { cmd: 'test -d ~/site/shared/public || mkdir -p ~/site/shared/public', desc: 'Create shared/public folder' }
Expand All @@ -112,5 +113,5 @@ magephp:
- symfony/cache-clear: { env: "prod" }
- exec: { cmd: "php ./bin/console doctrine:migrations:migrate --no-interaction", desc: "Apply DB Migrations" }
- symfony/cache-warmup: { env: "prod" }
- exec: { cmd: "crontab cnf/crontab-stage", desc: "Install crontab" }
- exec: { cmd: "crontab cnf/crontab-stage.cron", desc: "Install crontab" }
post-deploy:
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ and start hacking. To head to the project in the browser run

1. create and edit `.env.local` to overwrite vars from `.env.dist`
1. execute `composer install`
1. execute `composer install -d satis/package-generator` to setup Satis (optional)
1. execute `php ./bin/console doctrine:schema:create` to create database schema

### Database Creation and Migration
Expand Down Expand Up @@ -75,13 +74,6 @@ branch which is deployed then to the production site.
In the dev context you can authorize your requests with the username `developer`
and the password `password` by default.

### Satis / TYPO3 Composer Repository

The Satis application is located at the folder `satis` and contains all relevant
parts for the creation of the TYPO3 Composer Repository at
`https://composer.typo3.org`. This job is started through crontab see `cnf`
folder for the configuration details.

### Download Link Checker

To verify the download links generated by `https://get.typo3.org/json` you can
Expand Down
20 changes: 0 additions & 20 deletions cnf/crontab-dev

This file was deleted.

8 changes: 1 addition & 7 deletions cnf/crontab → cnf/crontab-dev.cron
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

# Redirect output to syslog. Please do not remove this variable
# unless you set MAILTO to a address of your own.
SHELL=/usr/local/vzscripts/sfoutputtosyslog

# make sure to source .profile in your jobs to have all settings like environment variables or PHP versions loaded:
# /bin/bash -c 'source ~/.profile && ~/your/original/command'

# +------------------------------------ minute (0 - 59)
# | +---------------------------- hour (0 - 23)
# | | +-------------------- day of month (1 - 31)
Expand All @@ -15,4 +9,4 @@ SHELL=/usr/local/vzscripts/sfoutputtosyslog

# 10 2 * * * <command>

0 */3 * * * ~/site/mage/current/satis/build.sh -q
5-59/15 * * * * ~/site/mage/current/bin/console satis:build --auto
20 changes: 0 additions & 20 deletions cnf/crontab-stage

This file was deleted.

12 changes: 12 additions & 0 deletions cnf/crontab-stage.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SHELL=/usr/local/vzscripts/sfoutputtosyslog

# +------------------------------------ minute (0 - 59)
# | +---------------------------- hour (0 - 23)
# | | +-------------------- day of month (1 - 31)
# | | | +------------ month (1 - 12)
# | | | | +---- day of week (0 - 6) (Sunday=0 or 7)
# | | | | |

# 10 2 * * * <command>

*/15 * * * * ~/site/mage/current/bin/console satis:build --auto
12 changes: 12 additions & 0 deletions cnf/crontab.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SHELL=/usr/local/vzscripts/sfoutputtosyslog

# +------------------------------------ minute (0 - 59)
# | +---------------------------- hour (0 - 23)
# | | +-------------------- day of month (1 - 31)
# | | | +------------ month (1 - 12)
# | | | | +---- day of week (0 - 6) (Sunday=0 or 7)
# | | | | |

# 10 2 * * * <command>

*/15 * * * * ~/site/mage/current/bin/console satis:build --auto
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@
},
"require": {
"php": ">=8.1",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-sqlite3": "*",
"ext-zlib": "*",
"composer/satis": "^3.0@dev",
"composer/semver": "^3.3",
"doctrine/collections": "^1.6",
"doctrine/dbal": "^3.3",
"doctrine/doctrine-bundle": "^2.7",
Expand Down Expand Up @@ -115,8 +119,6 @@
"symfony/polyfill-php56": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
Expand Down
Loading

0 comments on commit 8efd959

Please sign in to comment.