Skip to content

Commit

Permalink
Merge pull request #141 from famoser/maintenance
Browse files Browse the repository at this point in the history
Replace deployer with agnes
  • Loading branch information
famoser authored Oct 26, 2021
2 parents 3ff608a + 8a410f6 commit a54adb5
Show file tree
Hide file tree
Showing 15 changed files with 689 additions and 265 deletions.
5 changes: 1 addition & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ APP_SECRET=somesecret
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.sqlite"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.sqlite
DATABASE_URL=sqlite:///%kernel.project_dir%/var/persistent/data.sqlite
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
Expand All @@ -26,6 +26,3 @@ MAILER_URL=null://localhost
CONTACT_EMAIL=[email protected]
ADMIN_EMAIL=[email protected]

FREE_PERIOD_DAYS=31
REGISTER_FEE=1500
YEARLY_FEE=500
33 changes: 0 additions & 33 deletions .env.test.travis

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ yarn-error.log
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

.config
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ before_install:
# prepare programming environment
install:
# copy config files
- cp .env.test.travis .env.test
- cp phpunit.xml.dist phpunit.xml

# configure fontawesome
Expand All @@ -49,7 +48,7 @@ install:
- chmod +x ./bin/console

# install local-php-security-checker
- wget -O local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64
- wget -O local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64
- chmod +x local-php-security-checker

# check if travis fulfills symfony requirements
Expand All @@ -72,7 +71,7 @@ script:
# frontend vulnerability check
- yarn audit --groups dependencies

# backend lint
# backend lint
- '[[ "$TRAVIS_PHP_VERSION" == "nightly" ]] || ./vendor/bin/php-cs-fixer fix --diff --dry-run -v'
- ./bin/console lint:yaml config
- ./bin/console lint:yaml translations
Expand Down
45 changes: 45 additions & 0 deletions agnes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
agnes:
version: 4

build:
path: .build

github:
api_token: '%env(GITHUB_API_TOKEN)%'
repository: famoser/nodika

config:
path: .config
repository:
url: [email protected]:agnes-config/famoser-nodika

data:
shared_folders:
- var/persistent

files:
- path: .env.local
required: true

scripts:
build:
hook: build
script:
- composer install --verbose --prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts
- yarn install
- yarn run encore production
- rm -rf node_modules

deploy:
hook: deploy
script:
- php bin/console cache:clear -n
- find var -type d -print0 | xargs -0 chmod 0755
- find var -type f -print0 | xargs -0 chmod 0644
- php bin/console doctrine:migrations:migrate -n

rollback:
hook: rollback
script:
- cd $PREVIOUS_RELEASE_PATH && export MIGRATE_TO=$(php bin/console doctrine:migrations:latest)
- php bin/console doctrine:migrations:migrate $MIGRATE_TO -n
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.6",
"deployer/deployer": "^6.1",
"doctrine/doctrine-fixtures-bundle": "^3.0",
"famoser/agnes": "^4",
"friendsofphp/php-cs-fixer": "^3",
"phpunit/phpunit": "^8",
"symfony/browser-kit": "^4.0",
Expand Down Expand Up @@ -79,18 +79,13 @@
"symfony/polyfill-php56": "*"
},
"scripts": {
"configure-environment": [
"cp -n servers.yml.dist servers.yml"
],
"prepare-environment": [
"vendor/bin/cghooks update",
"vendor/bin/requirements-checker",
"php bin/console doctrine:migrations:migrate -q",
"php bin/console doctrine:fixtures:load -q"
],
"pre-install-cmd": "@configure-environment",
"post-install-cmd": "@prepare-environment",
"pre-update-cmd": "@configure-environment",
"post-update-cmd": "@prepare-environment",
"auto-scripts": {
"cache:clear": "symfony-cmd",
Expand Down
Loading

0 comments on commit a54adb5

Please sign in to comment.