|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
|
|
|
|
|
|
This task update all SUI individual component repos with new versions of components |
|
|
|
|
|
|
|
|
This task update all SUI individual distribution repos with new versions of distributions |
|
|
|
|
|
|
|
|
* Commits changes from create repo |
|
|
* Commits changes from create repo |
|
|
* Pushes changes to GitHub |
|
|
* Pushes changes to GitHub |
|
@ -42,7 +42,7 @@ module.exports = function() { |
|
|
|
|
|
|
|
|
var |
|
|
var |
|
|
index = -1, |
|
|
index = -1, |
|
|
total = release.components.length, |
|
|
|
|
|
|
|
|
total = release.distributions.length, |
|
|
timer, |
|
|
timer, |
|
|
stream, |
|
|
stream, |
|
|
stepRepo |
|
|
stepRepo |
|
@ -53,7 +53,7 @@ module.exports = function() { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Do Git commands synchronously per component, to avoid issues
|
|
|
|
|
|
|
|
|
// Do Git commands synchronously per distribution, to avoid issues
|
|
|
stepRepo = function() { |
|
|
stepRepo = function() { |
|
|
|
|
|
|
|
|
index = index + 1; |
|
|
index = index + 1; |
|
@ -62,10 +62,9 @@ module.exports = function() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var |
|
|
var |
|
|
component = release.components[index] |
|
|
|
|
|
outputDirectory = path.resolve(release.outputRoot + component), |
|
|
|
|
|
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1), |
|
|
|
|
|
repoName = release.distRepoRoot + capitalizedComponent, |
|
|
|
|
|
|
|
|
distribution = release.distributions[index], |
|
|
|
|
|
outputDirectory = path.resolve(path.join(release.outputRoot, distribution.toLowerCase() )), |
|
|
|
|
|
repoName = release.distRepoRoot + distribution, |
|
|
|
|
|
|
|
|
gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git', |
|
|
gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git', |
|
|
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/', |
|
|
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/', |
|
@ -74,14 +73,14 @@ module.exports = function() { |
|
|
? '--author "' + oAuth.name + ' <' + oAuth.email + '>"' |
|
|
? '--author "' + oAuth.name + ' <' + oAuth.email + '>"' |
|
|
: '', |
|
|
: '', |
|
|
|
|
|
|
|
|
componentPackage = fs.existsSync(outputDirectory + 'package.json' ) |
|
|
|
|
|
|
|
|
distributionPackage = fs.existsSync(outputDirectory + 'package.json' ) |
|
|
? require(outputDirectory + 'package.json') |
|
|
? require(outputDirectory + 'package.json') |
|
|
: false, |
|
|
: false, |
|
|
|
|
|
|
|
|
isNewVersion = (version && componentPackage.version != version), |
|
|
|
|
|
|
|
|
isNewVersion = (version && distributionPackage.version != version), |
|
|
|
|
|
|
|
|
commitMessage = (isNewVersion) |
|
|
commitMessage = (isNewVersion) |
|
|
? 'Updated component to version ' + version |
|
|
|
|
|
|
|
|
? 'Updated distribution to version ' + version |
|
|
: 'Updated files from main repo', |
|
|
: 'Updated files from main repo', |
|
|
|
|
|
|
|
|
gitOptions = { cwd: outputDirectory }, |
|
|
gitOptions = { cwd: outputDirectory }, |
|
@ -108,7 +107,7 @@ module.exports = function() { |
|
|
// standard path
|
|
|
// standard path
|
|
|
function commitFiles() { |
|
|
function commitFiles() { |
|
|
// commit files
|
|
|
// commit files
|
|
|
console.info('Committing ' + component + ' files', commitArgs); |
|
|
|
|
|
|
|
|
console.info('Committing ' + distribution + ' files', commitArgs); |
|
|
gulp.src('**/*', gitOptions) |
|
|
gulp.src('**/*', gitOptions) |
|
|
.pipe(git.add(gitOptions)) |
|
|
.pipe(git.add(gitOptions)) |
|
|
.pipe(git.commit(commitMessage, commitOptions)) |
|
|
.pipe(git.commit(commitMessage, commitOptions)) |
|
@ -129,8 +128,8 @@ module.exports = function() { |
|
|
|
|
|
|
|
|
// push changess to remote
|
|
|
// push changess to remote
|
|
|
function pushFiles() { |
|
|
function pushFiles() { |
|
|
console.info('Pushing files for ' + component); |
|
|
|
|
|
git.push('origin', 'master', { args: '-f', cwd: outputDirectory }, function(error) { |
|
|
|
|
|
|
|
|
console.info('Pushing files for ' + distribution); |
|
|
|
|
|
git.push('origin', 'master', { args: '', cwd: outputDirectory }, function(error) { |
|
|
console.info('Push completed successfully'); |
|
|
console.info('Push completed successfully'); |
|
|
createRelease(); |
|
|
createRelease(); |
|
|
}); |
|
|
}); |
|
@ -148,7 +147,7 @@ module.exports = function() { |
|
|
|
|
|
|
|
|
// Tags files locally
|
|
|
// Tags files locally
|
|
|
function tagFiles() { |
|
|
function tagFiles() { |
|
|
console.info('Tagging new version ' + component, version); |
|
|
|
|
|
|
|
|
console.info('Tagging new version ' + distribution, version); |
|
|
git.tag(version, 'Updated version from semantic-ui (automatic)', function (err) { |
|
|
git.tag(version, 'Updated version from semantic-ui (automatic)', function (err) { |
|
|
nextRepo(); |
|
|
nextRepo(); |
|
|
}); |
|
|
}); |
|
@ -159,15 +158,15 @@ module.exports = function() { |
|
|
console.log('Sleeping for 1 second...'); |
|
|
console.log('Sleeping for 1 second...'); |
|
|
// avoid rate throttling
|
|
|
// avoid rate throttling
|
|
|
global.clearTimeout(timer); |
|
|
global.clearTimeout(timer); |
|
|
return stepRepo() |
|
|
|
|
|
|
|
|
timer = global.setTimeout(stepRepo, 500); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(localRepoSetup) { |
|
|
if(localRepoSetup) { |
|
|
commitFiles(); |
|
|
|
|
|
|
|
|
setUser(); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
console.error('Repository must be setup before running update components'); |
|
|
|
|
|
|
|
|
console.error('Repository must be setup before running update distributions'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|