Skip to content

Commit

Permalink
Remove config PIX_APPS_TO_DEPLOY
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed Jun 13, 2022
1 parent d7c81b4 commit 8e5c90d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions common/services/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ module.exports = {

const client = await ScalingoClient.getInstance(sanitizedEnvironment);

const results = await Promise.all(config.pixApps.map(pixApp => {
return client.deployFromArchive(pixApp, sanitizedReleaseTag);
const results = await Promise.all(config.PIX_APPS.map(pixApp => {
return client.deployFromArchive(`pix-${pixApp}`, sanitizedReleaseTag);
}));

return results;
Expand Down
4 changes: 0 additions & 4 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ module.exports = (function() {
port: _getNumber(process.env.PORT, 3000),
environment: (process.env.NODE_ENV || 'development'),

pixApps: _getCommaSeparatedValues(process.env.PIX_APPS_TO_DEPLOY),

baleen: {
pat: process.env.BALEEN_PERSONAL_ACCESS_TOKEN,
appNamespaces: _getJSON(process.env.BALEEN_APP_NAMESPACES),
Expand Down Expand Up @@ -125,8 +123,6 @@ module.exports = (function() {
config.scalingo.production.token = 'tk-us-scalingo-token-production';
config.scalingo.production.apiUrl = 'https://scalingo.production';

config.pixApps = ['pix-app1', 'pix-app2', 'pix-app3'];

config.prismic.secret = 'prismic-secret';
}

Expand Down
10 changes: 6 additions & 4 deletions test/unit/common/services/releases_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ describe('releases', function() {
// when
const response = await releasesService.deploy('production', 'v1.0');
// then
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-app1', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-app2', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-app3', 'v1.0');
expect(response).to.deep.equal(['OK', 'OK', 'OK']);
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-app', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-certif', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-admin', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-orga', 'v1.0');
sinon.assert.calledWithExactly(scalingoClient.deployFromArchive, 'pix-api', 'v1.0');
expect(response).to.deep.equal(['OK', 'OK', 'OK', 'OK', 'OK']);
});

it('should trigger deployments of managed applications', async () => {
Expand Down

0 comments on commit 8e5c90d

Please sign in to comment.