Skip to content

Commit

Permalink
Script for syncing build
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Dec 1, 2017
1 parent a27fa6e commit 5243522
Show file tree
Hide file tree
Showing 4 changed files with 1,120 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
out
_build
node_modules

.DS_Store
Expand Down
40 changes: 40 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const gulp = require('gulp')
const $ = require('shelljs')

const GITHUB_TOKEN = process.env['GITHUB_TOKEN']
if (!GITHUB_TOKEN) {
$.echo('This script clones vscode-website and requires access token')
$.exit(1)
}

const URL = `https://${GITHUB_TOKEN}@github.com/microsoft/vscode-website`

gulp.task('clone-repo', done => {
if (!$.which('git')) {
$.echo('This command requires git')
$.exit(1)
done()
}

// Go to _build
if (!$.test('-e', '_build')) {
$.mkdir('_build')
}
$.cd('_build')

// Clone prod branch of vscode-website
if (!$.test('-e', 'vscode-website')) {
$.exec(`git clone --depth=1 --branch=prod ${URL}`)
}

// Copy over MD/asset files
$.mkdir('vscode-website/vscode-docs')
$.cp('-R', ['../blogs', '../docs', '../images', '../release-notes', '../tutorials'], 'vscode-website/vscode-docs')

// Go to vscode-website
$.cd('vscode-website')
// Run setup to fetch vscode-website-dist
$.exec(`scripts/setup.sh ${GITHUB_TOKEN}`)
// Run build to sync changes to vscode-website-dist
$.exec(`scripts/build.sh`)
})
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-docs.git"
},
"devDependencies": {
"gulp": "^3.9.1",
"shelljs": "^0.7.8"
}
}
Loading

0 comments on commit 5243522

Please sign in to comment.