Files
firefox-accounts-mirror/packages/fxa-admin-server/pm2.config.js
dschom d96797ae6a task(CI): Improve nx caching for CI pipelines
Because:
- Not all CI operations where taking advantage of NX caches

This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
2023-08-29 11:19:54 -07:00

49 lines
1.4 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const PATH = process.env.PATH.split(':')
.filter((p) => !p.includes(process.env.TMPDIR))
.join(':');
const nest = require.resolve('@nestjs/cli/bin/nest.js');
const getDevScript = () => `${nest} start --debug=9150 --watch`;
const getProdScript = () => 'node dist/packages/fxa-admin-server/src/main.js';
const script =
process.env.CI === 'true' || process.env.NODE_ENV === 'production'
? getProdScript()
: getDevScript();
module.exports = {
apps: [
{
name: 'admin-server',
script,
cwd: __dirname,
max_restarts: '1',
min_uptime: '2m',
env: {
CONFIG_FILES: 'secrets.json',
PATH,
NODE_ENV: 'development',
TS_NODE_TRANSPILE_ONLY: 'true',
TS_NODE_FILES: 'true',
PORT: '8095',
SENTRY_ENV: 'local',
SENTRY_DSN: process.env.SENTRY_DSN_ADMIN_PANEL,
FIRESTORE_EMULATOR_HOST: 'localhost:9090',
TRACING_SERVICE_NAME: 'fxa-admin-server',
},
filter_env: ['npm_'],
watch: ['src'],
ignore_watch: [
'src/graphql.ts',
'src/schema.gql',
'src/config/gql/allowlist/*.json',
],
time: true,
},
],
};