Merge pull request #5966 from Budibase/feat/qa-templates
Return QA templates when environment variable is set
This commit is contained in:
commit
2f1401a576
|
@ -29,7 +29,7 @@ export const buildTemplateEndpoints = API => ({
|
||||||
*/
|
*/
|
||||||
getAppTemplates: async () => {
|
getAppTemplates: async () => {
|
||||||
return await API.get({
|
return await API.get({
|
||||||
url: "/api/templates?type=app",
|
url: "/api/templates",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const { downloadTemplate } = require("../../utilities/fileSystem")
|
const { downloadTemplate } = require("../../utilities/fileSystem")
|
||||||
|
const env = require("../../environment")
|
||||||
|
|
||||||
// development flag, can be used to test against templates exported locally
|
// development flag, can be used to test against templates exported locally
|
||||||
const DEFAULT_TEMPLATES_BUCKET =
|
const DEFAULT_TEMPLATES_BUCKET =
|
||||||
"prod-budi-templates.s3-eu-west-1.amazonaws.com"
|
"prod-budi-templates.s3-eu-west-1.amazonaws.com"
|
||||||
|
|
||||||
exports.fetch = async function (ctx) {
|
exports.fetch = async function (ctx) {
|
||||||
const { type = "app" } = ctx.query
|
let type = env.TEMPLATE_REPOSITORY
|
||||||
let response,
|
let response,
|
||||||
error = false
|
error = false
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -78,6 +78,7 @@ module.exports = {
|
||||||
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
||||||
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
||||||
SQL_MAX_ROWS: process.env.SQL_MAX_ROWS,
|
SQL_MAX_ROWS: process.env.SQL_MAX_ROWS,
|
||||||
|
TEMPLATE_REPOSITORY: process.env.TEMPLATE_REPOSITORY || "app",
|
||||||
_set(key, value) {
|
_set(key, value) {
|
||||||
process.env[key] = value
|
process.env[key] = value
|
||||||
module.exports[key] = value
|
module.exports[key] = value
|
||||||
|
|
Loading…
Reference in New Issue