diff --git a/kubernetes/app.yml b/kubernetes/app.yml index 7e523f6c..3054d6a7 100644 --- a/kubernetes/app.yml +++ b/kubernetes/app.yml @@ -92,7 +92,11 @@ spec: - name: fetch-examples image: index.docker.io/catarak/p5.js-web-editor:latest command: ["npm", "run", "fetch-examples:prod"] - restartPolicy: OnFailure + imagePullPolicy: Always + envFrom: + - secretRef: + name: web-editor-credentials + restartPolicy: Never --- # cronjob for generative gestaltung p5.js examples apiVersion: batch/v1beta1 @@ -109,4 +113,8 @@ spec: - name: fetch-examples-gg image: index.docker.io/catarak/p5.js-web-editor:latest command: ["npm", "run", "fetch-examples-gg:prod"] - restartPolicy: OnFailure + imagePullPolicy: Always + envFrom: + - secretRef: + name: web-editor-credentials + restartPolicy: Never diff --git a/server/scripts/examples-gg-latest.js b/server/scripts/examples-gg-latest.js index f06a4000..909d7ceb 100644 --- a/server/scripts/examples-gg-latest.js +++ b/server/scripts/examples-gg-latest.js @@ -82,7 +82,7 @@ if (process.env.NODE_ENV === 'production' && process.env.MONGO_RW_USERNAME && pr } else { mongoConnectionString = process.env.MONGO_URL; } -mongoose.connect(mongoConnectionString); +mongoose.connect(mongoConnectionString, { useMongoClient: true }); mongoose.connection.on('error', () => { console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); process.exit(1); diff --git a/server/scripts/examples.js b/server/scripts/examples.js index cce7cd43..2017e7da 100644 --- a/server/scripts/examples.js +++ b/server/scripts/examples.js @@ -53,7 +53,7 @@ if (process.env.NODE_ENV === 'production' && process.env.MONGO_RW_USERNAME && pr mongoConnectionString = process.env.MONGO_URL; } -mongoose.connect(mongoConnectionString); +mongoose.connect(mongoConnectionString, { useMongoClient: true }); mongoose.connection.on('error', () => { console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); process.exit(1);