Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing cronjob #45

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions templates/03-pipelinehelper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,32 +634,20 @@ Resources:
sudo yum install -y php-pecl-memcached
sudo yum remove -y php-pecl-memcached
sudo yum install -y php-redis

sudo yum install -y openssl11

if [ $(uname -a | grep -c x86_64) == "1" ]; then
echo "downloading x86 client for ElastiCache"
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-X86-openssl3
tar -xf '/tmp/latest-64bit-X86-openssl3'
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-X86-openssl1.1
tar -xf '/tmp/latest-64bit-X86-openssl1.1'
else
echo "downloading ARM-64 client for ElastiCache"
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-arm-openssl3
tar -xf '/tmp/latest-64bit-arm-openssl3'
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-arm-openssl1.1
tar -xf '/tmp/latest-64bit-arm-openssl1.1'
fi

cp 'amazon-elasticache-cluster-client.so' /usr/lib64/php/modules/
if [ ! -f /etc/php.d/50-memcached.ini ]; then
touch /etc/php.d/50-memcached.ini
fi
echo 'extension=/usr/lib64/php/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/50-memcached.ini
echo 'extension=igbinary.so;' >> /etc/php.d/50-memcached.ini

if [ ! -f /etc/php.d/20-redis.ini ]; then
touch /etc/php.d/20-redis.ini
fi
echo 'extension=/usr/lib64/php/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/20-redis.ini
echo 'extension=igbinary.so;' >> /etc/php.d/20-redis.ini


echo 'extension=amazon-elasticache-cluster-client.so;' > /etc/php.d/50-elasticache.ini
mode: 000500
owner: root
group: root
Expand Down
15 changes: 15 additions & 0 deletions templates/04-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ Resources:
- install_codedeploy
- install_webserver
- start_webserver
- add_crontab
install_logs:
packages:
yum:
Expand Down Expand Up @@ -470,6 +471,20 @@ Resources:
httpd:
enabled: true
ensureRunning: true
add_crontab:
files:
/tmp/add_crontab.sh:
content: !Sub |
#!/bin/sh -xe
echo "* * * * * apache /usr/bin/php /var/www/moodle/html/admin/cli/cron.php" > /etc/cron.d/moodle
mode: 000500
owner: root
group: root
commands:
add_crontab:
command: ./add_crontab.sh
cwd: /tmp
ignoreErrors: false
Properties:
LaunchTemplateData:
BlockDeviceMappings:
Expand Down