Skip to content

Commit

Permalink
Merge pull request #12 from paastis/fix-ci-1
Browse files Browse the repository at this point in the history
ci: fix
  • Loading branch information
jbuget committed Oct 29, 2022
2 parents f8615e7 + f96983a commit c868b4d
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 42 deletions.
18 changes: 18 additions & 0 deletions my.paastis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rules:
- pattern: 'app-review-pr(\d+)-(back|front)'
linked_apps:
- 'app-review-pr$1-front'

- pattern: 'hello-fastify'
linked_apps:
- 'hellofastifydeux'

- pattern: 'hello-fastify-2'
app_name: 'hellofastifydeux'

- pattern: '.*fastify.*'
app_max_idle_time: 1

- pattern: 'paastis-console'
linked_apps:
- 'paastis-api'
4 changes: 2 additions & 2 deletions src/Scheduler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cron from 'node-cron';
import provider from "./provider/index.js";
import { factory, registry } from "./registry/index.js";
import provider from './provider/index.js';
import { factory, registry } from './registry/index.js';

export default class Scheduler {

Expand Down
2 changes: 1 addition & 1 deletion src/Server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import http from 'http';
import { system, upstream } from "./router/index.js";
import { system, upstream } from './router/index.js';

export default class Server {

Expand Down
2 changes: 1 addition & 1 deletion src/provider/PaasProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { spawn } from 'child_process';
import Promise from 'bluebird';
import config from "../config.js";
import config from '../config.js';

export default class PaasProvider {

Expand Down
4 changes: 2 additions & 2 deletions src/provider/clever-cloud/CleverCloudApp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getStatus } from "@clevercloud/client/cjs/utils/app-status.js";
import PaasApp from "../PaasApp.js";
import { getStatus } from '@clevercloud/client/cjs/utils/app-status.js';
import PaasApp from '../PaasApp.js';

export default class CleverCloudApp extends PaasApp {

Expand Down
8 changes: 4 additions & 4 deletions src/provider/clever-cloud/CleverCloudProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import application from '@clevercloud/client/cjs/api/v2/application.js';
import { addOauthHeader } from '@clevercloud/client/cjs/oauth.node.js';
import { prefixUrl } from '@clevercloud/client/cjs/prefix-url.js';
import { request } from '@clevercloud/client/cjs/request.superagent.js';
import { getStatus } from "@clevercloud/client/cjs/utils/app-status.js";
import { getStatus } from '@clevercloud/client/cjs/utils/app-status.js';

import config from "../../config.js";
import PaasProvider from "../PaasProvider.js";
import CleverCloudApp from "./CleverCloudApp.js";
import config from '../../config.js';
import PaasProvider from '../PaasProvider.js';
import CleverCloudApp from './CleverCloudApp.js';

export default class CleverCloudProvider extends PaasProvider {

Expand Down
2 changes: 1 addition & 1 deletion src/provider/heroku/HerokuApp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PaasApp from "../PaasApp.js";
import PaasApp from '../PaasApp.js';
import _ from 'lodash';

export default class HerokuApp extends PaasApp {
Expand Down
4 changes: 2 additions & 2 deletions src/provider/heroku/HerokuProvider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import Promise from 'bluebird';
import PaasProvider from "../PaasProvider.js";
import HerokuApp from "./HerokuApp.js";
import PaasProvider from '../PaasProvider.js';
import HerokuApp from './HerokuApp.js';
import heroku from './heroku.js';

export default class HerokuProvider extends PaasProvider {
Expand Down
2 changes: 1 addition & 1 deletion src/provider/scalingo/ScalingoApp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PaasApp from "../PaasApp.js";
import PaasApp from '../PaasApp.js';

export default class ScalingoApp extends PaasApp {

Expand Down
6 changes: 3 additions & 3 deletions src/provider/scalingo/ScalingoProvider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import getClient from "./scalingo.js";
import PaasProvider from "../PaasProvider.js";
import ScalingoApp from "./ScalingoApp.js";
import getClient from './scalingo.js';
import PaasProvider from '../PaasProvider.js';
import ScalingoApp from './ScalingoApp.js';

export default class ScalingoProvider extends PaasProvider {

Expand Down
4 changes: 2 additions & 2 deletions src/provider/scalingo/scalingo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clientFromToken } from "scalingo";
import config from "../../config.js";
import { clientFromToken } from 'scalingo';
import config from '../../config.js';

let client;
let tokenLastUpdate;
Expand Down
2 changes: 1 addition & 1 deletion src/redis.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createClient } from 'redis';
import config from "./config.js";
import config from './config.js';


let client;
Expand Down
10 changes: 5 additions & 5 deletions src/registry/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fs from 'fs';
import yaml from "js-yaml";
import yaml from 'js-yaml';
import config from '../config.js';
import redis from '../redis.js';
import RunningAppsRegistry from "./RunningAppRegistry.js";
import RunningAppFactory from "./RunningAppFactory.js";
import RedisRunningAppStore from "./stores/RedisRunningAppStore.js";
import InMemoryRunningAppStore from "./stores/InMemoryRunningAppStore.js";
import RunningAppsRegistry from './RunningAppRegistry.js';
import RunningAppFactory from './RunningAppFactory.js';
import RedisRunningAppStore from './stores/RedisRunningAppStore.js';
import InMemoryRunningAppStore from './stores/InMemoryRunningAppStore.js';

let store;
if (!store) {
Expand Down
4 changes: 2 additions & 2 deletions src/registry/stores/InMemoryRunningAppStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RunningApp from "../RunningApp.js";
import { RunningAppStore } from "./RunningAppStore.js";
import RunningApp from '../RunningApp.js';
import { RunningAppStore } from './RunningAppStore.js';

export default class InMemoryRunningAppStore extends RunningAppStore {

Expand Down
6 changes: 3 additions & 3 deletions src/registry/stores/RedisRunningAppStore.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Promise from "bluebird";
import RunningApp from "../RunningApp.js";
import { RunningAppStore } from "./RunningAppStore.js";
import Promise from 'bluebird';
import RunningApp from '../RunningApp.js';
import { RunningAppStore } from './RunningAppStore.js';

export default class RedisRunningAppStore extends RunningAppStore {

Expand Down
4 changes: 2 additions & 2 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import system from "./system.js";
import upstream from "./upstream.js";
import system from './system.js';
import upstream from './upstream.js';

export {
system,
Expand Down
6 changes: 3 additions & 3 deletions src/router/system.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import config from "../config.js";
import { registry } from "../registry/index.js";
import provider from "../provider/index.js";
import config from '../config.js';
import { registry } from '../registry/index.js';
import provider from '../provider/index.js';

export default async (req, res) => {
try {
Expand Down
10 changes: 4 additions & 6 deletions src/router/upstream.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import provider from "../provider/index.js";
import { factory, registry } from "../registry/index.js";
import config from "../config.js";
import httpProxy from "http-proxy";
import yaml from "js-yaml";
import fs from "fs";
import provider from '../provider/index.js';
import { registry } from '../registry/index.js';
import config from '../config.js';
import httpProxy from 'http-proxy';

const proxy = httpProxy.createProxyServer({ changeOrigin: true, secure: false, preserveHeaderKeyCase: true });

Expand Down
2 changes: 1 addition & 1 deletion test/registry/RunningAppFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('RunningAppFactory#createRunningAppForRegistration', () => {
expect(app.region).toBe(providerZone);
expect(app.name).toBe(appKey);
expect(app.linkedApps).toStrictEqual([]);
expect(app.maxIdleTime).toStrictEqual(1);
expect(app.maxIdleTime).toStrictEqual(15);
expect(app.startedAt).toStrictEqual(startedAt);
expect(app.lastAccessedAt).toStrictEqual(lastAccessedAt);
});
Expand Down

0 comments on commit c868b4d

Please sign in to comment.