Browse Source

Prepare for another green/blue switch.

pull/26/head
Zed A. Shaw 2 months ago
parent
commit
61aec2039d
3 changed files with 8 additions and 9 deletions
  1. +2
    -2
      scripts/services/ci.js
  2. +4
    -5
      scripts/services/ciq.js
  3. +2
    -2
      staging.config.js

+ 2
- 2
scripts/services/ci.js View File

@@ -133,8 +133,8 @@ exports.needs_prod_code = build.rule('needs production code', {
log.info("Generating the production code and restarting server.");

const build_info = {
code: [f.code_git_log.latest.hash, f.code_git_log.date],
db: [f.db_git_log.latest.hash, f.db_git_log.date]
code: [f.code_git_log.latest.hash, f.code_git_log.latest.date],
db: [f.db_git_log.latest.hash, f.db_git_log.latest.date]
};

await fs.writeFile('static/build.json', JSON.stringify(build_info));

+ 4
- 5
scripts/services/ciq.js View File

@@ -2,10 +2,10 @@

const minimist = require('minimist');
const watch = require('watch');
const { log } = require('../lib/logging');
const rr = require('../lib/rr');
const { log } = require('../../lib/logging');
const rr = require('../../lib/rr');
const Queue = require('bull');
const secrets = require('../lib/secrets');
const secrets = require('../../lib/secrets');
const config = minimist(process.argv.slice(3));
const assert = require('assert');
const fs = require('fs');
@@ -16,8 +16,7 @@ log.level = config.debug ? 'debug' : 'info';

log.debug("Got config:", config);

const rules_name = process.argv[2];
assert(rules_name, "You need to give rules_name.");
const rules_name = './scripts/services/ci.js';
assert(secrets.webhook_hash, "You need to set secrets.webhook_hash");

gitQ.process((job) => {

+ 2
- 2
staging.config.js View File

@@ -30,10 +30,10 @@ module.exports = {
},
{
name: 'ci',
script: './scripts/rrq ./scripts/services/ci.js --debug',
script: './scripts/services/ciq.js --debug',
instances: 1,
autorestart: true,
watch: ["scripts/services/ci.js", "scripts/services/generator.js"],
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'development'

Loading…
Cancel
Save