Added 'currentImageName' setting plus migration (#701)

This commit is contained in:
Miguel Serrano 2020-03-09 13:15:40 +01:00 committed by GitHub
parent faf78b69e6
commit f7ac10cc97
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,23 @@
const Settings = require('settings-sharelatex')
const mongojs = require('mongojs')
const db = mongojs(Settings.mongo.url, ['projects'])
exports.migrate = (client, done) => {
console.log(`>> Setting 'imageName' in projects`)
if (!Settings.currentImageName) {
console.log(`>> 'currentImageName' is not defined, no projects updated`)
return done()
}
console.log(`>> Setting 'imageName' = ${Settings.currentImageName}`)
db.projects.update(
{ imageName: { $exists: false } },
{ $set: { imageName: Settings.currentImageName } },
{ multi: true },
done
)
}
exports.rollback = (client, done) => done()

View file

@ -194,6 +194,8 @@ settings =
www: {lngCode:process.env["SHARELATEX_SITE_LANGUAGE"] or "en", url: siteUrl} www: {lngCode:process.env["SHARELATEX_SITE_LANGUAGE"] or "en", url: siteUrl}
defaultLng: process.env["SHARELATEX_SITE_LANGUAGE"] or "en" defaultLng: process.env["SHARELATEX_SITE_LANGUAGE"] or "en"
currentImageName: process.env["TEX_LIVE_DOCKER_IMAGE"]
apis: apis:
web: web:
url: "http://localhost:3000" url: "http://localhost:3000"