Reputation: 704
I am creating a release for my Node.js project. The build is configured on gulp.
As a part of the build steps, I need to:
All these steps are configured using gulp as
gulp.task('release', gulpSequence(
'checkout-release-branch',
'bump-version',
'clean:dist',
'compile-ts',
'commit-appversion-changes-to-release',
'push-release-branch'
));
gulp.task('checkout-release-branch', function () {
const packageJSON = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
git.checkout('release-' + appVersion, { args: '-b' }, function (err) {
if (err) throw err;
});
});
gulp.task('bump-version', function () {
return gulp.src(['./package.json'])
.pipe(bump({ version: appVersion }).on('error', log.error))
.pipe(gulp.dest('./'));
});
gulp.task('commit-appversion-changes-to-release', function () {
return gulp.src('.')
.pipe(git.add())
.pipe(git.commit('[Release] Bumped package version number for release'));
});
gulp.task('push-release-branch', function () {
git.push('origin', 'release-' + appVersion, { args: " -u" }, function (err) {
if (err) throw err;
});
});
The above steps when I am running on Azure DevOps give an error for user credentials not being set. I am not sure under what context the build is running. I have given access create and commit branches for "Project Collection Build Service".
What is the way for set credentials for git when I am using gulp-git in Azure DevOps CI builds?
Upvotes: 0
Views: 876