Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
normalise app name in ship command
Browse files Browse the repository at this point in the history
 🐿 v2.5.16
  • Loading branch information
leggsimon committed Sep 4, 2017
1 parent 47e3b1c commit ed957b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tasks/ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ const packageJson = require(process.cwd() + '/package.json');
const pipelines = require('../lib/pipelines');
const deploy = require('./deploy').task;
const log = require('../lib/logger');
const normalizeName = require('../lib/normalize-name');

const DEFAULT_REGISTRY_URI = 'https://next-registry.ft.com/v2/';

function task (opts) {

return co(function* (){

let appName = packageJson.name.replace('ft-next-', '');
let appName = normalizeName(packageJson.name);
let pipelineName = opts.pipeline || packageJson.name;
log.info('Deploy to ' + pipelineName);
let apps = yield pipelines.getApps(pipelineName);
Expand Down
10 changes: 5 additions & 5 deletions test/ship.alternateRegistry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('tasks/ship (using alternate registry)', function (){
});

sinon.assert.calledWith(mockScale.task, {
source:appName,
source: 'kat-app',
target:mockApps.staging,
minimal:true,
registry: OVERRIDE_REGISTRY_URI
Expand Down Expand Up @@ -140,17 +140,17 @@ describe('tasks/ship (using alternate registry)', function (){
});

sinon.assert.calledWith(mockScale.task, {
source:appName,
source:'kat-app',
target:mockApps.staging,
registry: OVERRIDE_REGISTRY_URI
});
sinon.assert.calledWith(mockScale.task, {
source:appName,
source:'kat-app',
target:mockApps.production.eu,
registry: OVERRIDE_REGISTRY_URI
});
sinon.assert.calledWith(mockScale.task, {
source:appName,
source:'kat-app',
target:mockApps.production.us,
registry: OVERRIDE_REGISTRY_URI
});
Expand All @@ -169,7 +169,7 @@ describe('tasks/ship (using alternate registry)', function (){
});

sinon.assert.calledWith(mockScale.task, {
source:appName,
source:'kat-app',
target:mockApps.staging,
inhibit:true,
registry: OVERRIDE_REGISTRY_URI
Expand Down

0 comments on commit ed957b4

Please sign in to comment.