-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from jeffyoung/master
Begin using fastlane tools
- Loading branch information
Showing
51 changed files
with
1,241 additions
and
820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import ma = require('vsts-task-lib/mock-answer'); | ||
import tmrm = require('vsts-task-lib/mock-run'); | ||
import path = require('path'); | ||
import os = require('os'); | ||
|
||
let taskPath = path.join(__dirname, '..', 'app-store-promote.js'); | ||
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
tmr.setInput('authType', 'UserAndPass'); | ||
tmr.setInput('username', 'creds-username'); | ||
tmr.setInput('password', 'creds-password'); | ||
tmr.setInput('appIdentifier', 'com.microsoft.test.appId'); | ||
tmr.setInput('chooseBuild', 'Specify'); | ||
|
||
tmr.setInput('buildNumber', '42'); | ||
|
||
process.env['MOCK_NORMALIZE_SLASHES'] = true; | ||
process.env['GEM_CACHE'] = '/usr/bin/customGemCache'; | ||
//process.env['HOME'] = '/usr/bin'; | ||
let gemCache: string = process.env['GEM_CACHE']; | ||
|
||
//construct a string that is JSON, call JSON.parse(string), send that to ma.TaskLibAnswers | ||
let myAnswers: string = `{ | ||
"which": { | ||
"ruby": "/usr/bin/ruby", | ||
"gem": "/usr/bin/gem", | ||
"fastlane": "/usr/bin/fastlane" | ||
}, | ||
"checkPath" : { | ||
"/usr/bin/ruby": true, | ||
"/usr/bin/gem": true, | ||
"/usr/bin/fastlane": true | ||
}, | ||
"exec": { | ||
"/usr/bin/gem install fastlane": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"/usr/bin/gem update fastlane -i ${gemCache}": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"fastlane deliver submit_build -u creds-username -a com.microsoft.test.appId -n 42 --skip_binary_upload true --skip_metadata true --skip_screenshots true --force": { | ||
"code": 0, | ||
"stdout": "consider it delivered!" | ||
} | ||
} | ||
}`; | ||
let json: any = JSON.parse(myAnswers); | ||
// Cast the json blob into a TaskLibAnswers | ||
tmr.setAnswers(<ma.TaskLibAnswers>json); | ||
|
||
// This is how you can mock NPM packages... | ||
os.platform = () => { | ||
return 'darwin'; | ||
}; | ||
tmr.registerMock('os', os); | ||
|
||
tmr.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.