mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Update gh pages task (#3762)
* Add task for updating github pages from develop
This commit is contained in:
@@ -56,6 +56,7 @@ module.exports = {
|
||||
gitSyncMaster: gitTasks.syncMaster,
|
||||
gitCreateRC: gitTasks.createRC,
|
||||
gitRecompile: gitTasks.recompile,
|
||||
gitUpdateGithubPages: gitTasks.updateGithubPages,
|
||||
typings: typings.typings,
|
||||
package: packageTasks.package,
|
||||
checkLicenses: licenseTasks.checkLicenses
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
"test:setupselenium": "selenium-standalone install --config=./tests/scripts/selenium-config.js",
|
||||
"test:startselenium": "selenium-standalone start --config=./tests/scripts/selenium-config.js",
|
||||
"typings": "gulp typings",
|
||||
"updateGithubPages": "gulp gitUpdateGithubPages",
|
||||
"version": "gulp build && git add -A"
|
||||
},
|
||||
"main": "./index.js",
|
||||
|
||||
@@ -21,7 +21,7 @@ const upstream_url = "https://github.com/google/blockly.git";
|
||||
function syncBranch(branchName) {
|
||||
return function(done) {
|
||||
execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' });
|
||||
execSync('git checkout ' + branchName, { stdio: 'inherit' });
|
||||
checkoutBranch(branchName);
|
||||
execSync('git pull ' + upstream_url + ' ' + branchName,
|
||||
{ stdio: 'inherit' });
|
||||
execSync('git push origin ' + branchName, { stdio: 'inherit' });
|
||||
@@ -56,6 +56,13 @@ function getRCBranchName() {
|
||||
return 'rc_' + yyyy + '_' + mm;
|
||||
};
|
||||
|
||||
// If branch does not exist then create the branch.
|
||||
// If branch exists switch to branch.
|
||||
function checkoutBranch(branchName) {
|
||||
execSync('git checkout ' + branchName + ' || git checkout -b ' + branchName,
|
||||
{ stdio: 'inherit' });
|
||||
}
|
||||
|
||||
// Recompile and push to origin.
|
||||
const recompile = gulp.series(
|
||||
syncDevelop,
|
||||
@@ -93,9 +100,20 @@ const createRC = gulp.series(
|
||||
},
|
||||
);
|
||||
|
||||
// Update github pages with what is currently in develop.
|
||||
const updateGithubPages = gulp.series(
|
||||
syncBranch('gh-pages'),
|
||||
function(done) {
|
||||
execSync('git pull ' + upstream_url + ' develop', { stdio: 'inherit' });
|
||||
execSync('git push ' + upstream_url + ' gh-pages', { stdio: 'inherit' });
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
syncDevelop: syncDevelop,
|
||||
syncMaster: syncMaster,
|
||||
createRC: createRC,
|
||||
recompile: recompile
|
||||
recompile: recompile,
|
||||
updateGithubPages: updateGithubPages
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user