Skip to content

Commit

Permalink
depoyment script petting
Browse files Browse the repository at this point in the history
  • Loading branch information
matepek committed Nov 7, 2018
1 parent 5eb6b67 commit 9ebbff3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 34 deletions.
21 changes: 14 additions & 7 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
.appveyor.yml
.git/**/*
.github/**/*
.gitignore
.prettierrc
.travis.yml
.github
src/**
.vscode/**/*
*.vsix
**/*.map
out/test/**
out/repo_scripts
resources/src
appveyor.yml
out/repo_scripts/**/*
out/test/**/*
out/tests/**/*
package-lock.json
resources/src/**/*
src/**/*
tsconfig.base.json
tsconfig.json
.vscode/**
.gitignore
tslint.json
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@
"xml2js": "^0.4.19"
},
"devDependencies": {
"@types/chai": "^4.1.6",
"@types/chai": "^4.1.7",
"@types/deep-equal": "^1.0.1",
"@types/fs-extra": "^5.0.4",
"@types/mocha": "^5.2.5",
"@types/request-promise": "4.1.42",
"@types/sinon": "^5.0.5",
"@types/xml2js": "^0.4.3",
"deep-equal": "^1.0.1",
"fs-extra": "^7.0.0",
"fs-extra": "^7.0.1",
"request-promise": "4.2.2",
"sinon": "^7.1.0",
"vsce": "^1.52.0"
"sinon": "^7.1.1",
"vsce": "^1.53.0"
},
"engines": {
"vscode": "^1.23.0"
Expand Down
18 changes: 9 additions & 9 deletions src/repo_scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ function main(argv: string[]): Promise<void> {
console.log('deploying');
// pre-checks
assert.strictEqual(path.basename(process.cwd()), githubRepoId);
assert.ok(process.env['TRAVIS_BRANCH'] != undefined);
assert.ok(process.env['GITHUB_API_KEY'] != undefined);
assert.ok(process.env['VSCE_PAT'] != undefined);

if (!process.env['TRAVIS_BRANCH']) {
console.log('not a branch, skipping deployment');
return Promise.resolve();
}

return updateChangelog().then((info: Info|undefined) => {
if (info != undefined) {
return Promise.resolve(info!)
Expand Down Expand Up @@ -153,13 +157,12 @@ function updatePackageJson(info: Info) {
}

function gitCommitAndTag(info: Info) {
console.log('Creating commit and signed tag');
console.log('Creating commit and tag');

return Promise.resolve()
.then(() => {
assert.ok(process.env['TRAVIS_BRANCH'] != undefined);
const branch = process.env['TRAVIS_BRANCH']!;
return spawn('git', 'checkout', branch);
assert.ok(process.env['TRAVIS_BRANCH']);
return spawn('git', 'checkout', process.env['TRAVIS_BRANCH']!);
})
.then(() => {
return spawn(
Expand All @@ -182,12 +185,9 @@ function gitCommitAndTag(info: Info) {
return spawn('git', 'status');
})
.then(() => {
// [skip travis-ci]: because we dont want to build the new commit it
// again
return spawn(
'git', 'commit', '-m',
'[Updated] Release info in CHANGELOG.md: ' + info.full!, '-m',
'[skip travis-ci]');
'[Updated] Release info in CHANGELOG.md: ' + info.full!);
})
.then(() => {
return spawn(
Expand Down

0 comments on commit 9ebbff3

Please sign in to comment.