Skip to content

Commit

Permalink
Set cron-job and migrate-build-files env credentials to use moodle-se…
Browse files Browse the repository at this point in the history
…crets

Added 10 second deley to file delete for migrate script
  • Loading branch information
warrenchristian1telus committed Jan 3, 2024
1 parent f5ddf20 commit 3f9ed5a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
18 changes: 17 additions & 1 deletion openshift/migrate-build-files-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ objects:
- name: cron-config
mountPath: /var/www/html/config.php
subPath: config.php
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-user
- name: DB_NAME
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-name
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-password
command:
- bash
- "-c"
Expand All @@ -66,4 +82,4 @@ parameters:
value: "moodle"
- name: BUILD_TAG
required: true
value: "dev"
value: "dev"
28 changes: 14 additions & 14 deletions openshift/moodle-cron-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@ objects:
path: ./.env
defaultMode: 420
containers:
- name: moodle-cron-job-job
- name: ${BUILD_NAME}
image: ${IMAGE_REPO}${BUILD_NAMESPACE}/${BUILD_NAME}:${BUILD_TAG}
env:
- name: DB_NAME
value: ${DB_NAME}
- name: DB_USER
value: ${DB_USER}
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-user
- name: DB_NAME
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-name
- name: DB_PASSWORD
value: ${DB_PASSWORD}
valueFrom:
secretKeyRef:
name: moodle-secrets
key: database-password
volumeMounts:
- name: moodle-data
mountPath: /var/www/html
Expand Down Expand Up @@ -81,12 +90,3 @@ parameters:
- name: BUILD_TAG
required: true
value: "dev"
- name: DB_USER
required: true
value: "moodle"
- name: DB_NAME
required: true
value: "moodle"
- name: DB_PASSWORD
required: true
value: "CHANGE_ME"
3 changes: 2 additions & 1 deletion openshift/scripts/migrate-build-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# echo "Delete Moodle config..."

# rm -f /var/www/html/config.php
echo "Deleting shared Moodle files..."
echo "Deleting shared Moodle files... in 10...9...8..."
sleep 10
rm -rf /var/www/html/*
# echo "Move Moodle web files to /tmp/old..."
# mv /var/www/html/* /tmp/old
Expand Down

0 comments on commit 3f9ed5a

Please sign in to comment.