Skip to content

Instantly share code, notes, and snippets.

View StefanieD's full-sized avatar

Stefanie Drost StefanieD

View GitHub Profile
@StefanieD
StefanieD / SitemapProvider.php
Created June 10, 2020 08:58
Sulu sitemap provider for static Symfony routes
<?php
namespace App\Service;
use Sulu\Bundle\WebsiteBundle\Sitemap\Sitemap;
use Sulu\Bundle\WebsiteBundle\Sitemap\SitemapProviderInterface;
use Sulu\Bundle\WebsiteBundle\Sitemap\SitemapUrl;
use Symfony\Component\Routing\RouterInterface;
class SitemapProvider implements SitemapProviderInterface
{
@StefanieD
StefanieD / 01cronjobs.config
Last active June 12, 2021 03:12
Run AWS Elastic Beanstalk container commands based on environment
container_commands:
# check for environemt within command to use leader flag
01_portfolio_update_cron_job:
command: 'if [ "$SYMFONY_ENV" != "staging" ]; then cat .ebextensions/cronjobs/portfolio_cron_job.txt > /etc/cron.d/portfolio_cron_job && chmod 644 /etc/cron.d/portfolio_cron_job; else echo "dont include portfolio cron";fi'
leader_only: true
# command should run on all instances, we can use the test command for environment check
02_synch_cron_job:
command: cat .ebextensions/cronjobs/synch_cron.txt > /etc/cron.d/synch_cron && chmod 644 /etc/cron.d/synch_cron
test: '[ "$SYMFONY_ENV" == "develop" ]'
@StefanieD
StefanieD / timezone.config
Created October 30, 2016 09:43
AWS Elastic Beanstalk configuration file for set up your app timezone (independent from EC2 region).
container_commands:
01changePHP:
command: sed -i '/PHP_DATE_TIMEZONE/ s/UTC/Europe\/Berlin/' /etc/php.d/environment.ini
01achangePHP:
command: sed -i '/aws.php_date_timezone/ s/UTC/Europe\/Berlin/' /etc/php.d/environment.ini
02change_AWS_PHP:
command: sed -i '/PHP_DATE_TIMEZONE/ s/UTC/Europe\/Berlin/' /etc/httpd/conf.d/aws_env.conf
03php_ini_set:
command: sed -i '/date.timezone/ s/UTC/Europe\/Berlin/' /etc/php.ini
commands:
@StefanieD
StefanieD / cleanup_bucket.config
Created August 11, 2015 17:31
Script for clean up app versions in AWS Elastic Beanstalk
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/600_delete_old_versions.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
if [ "$SYMFONY_ENV" = "prod" ]; then
@StefanieD
StefanieD / Readme.md
Created July 3, 2015 15:17
Install and use Supervisord with AWS Elastic Beanstalk, Symfony 2 and RabbitMq Bundle
  • Place the supervisord.conf under .ebextensions/supervisor/

  • Place the supervisor.config under .ebextensions/

  • Place the data_import_consumer.conf under .ebextensions/supervisor/