Code Monkey home page Code Monkey logo

gulp-release's Introduction

gulp-release

Greenkeeper badge Build Status js-semistandard-style code style: prettier

A GulpJS plugin that enables support for git-flow style releases. It requires the gitflow command line tool to be installed on your system.

Gitflow

A proposed workflow revolving around the use of git as a central tool. Defines a branching model to follow using best practices and convenience directives.

Installation

gulp-release is a GulpJS plugin. It defines custom tasks that group common flow-related behaviors when releasing software using git.

npm i --save-dev gulp-release

Requirements

  • gitflow ^1.9.0
  • gulp ~3.9
  • node ^8.0.0
  • npm ^5.0.0
# Add node repositories
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

# Install dependencies
sudo apt-get install git-flow
sudo apt-get install -y nodejs
sudo npm i -g npm
sudo npm i -g gulp

Usage

Simple

In your gulpfile.js declare:

'use strict';
const gulp = require('gulp');
const release = require('gulp-release');

release.register(gulp);

This will register tasks on your gulp instance. After that, you'll be able to call (or depend upon) all the tasks described below, such as:

$ gulp release

Advanced

You may pass in an options configuration object to the register method to override some or all of the default settings.

'use strict';
const gulp = require('gulp');
const release = require('gulp-release');

release.register(gulp, { packages: ['package.json'] });

Here, the packages property expects an ordered array of globs that match json files containing version information (i.e: package.json, bower.json, component.json). All version files will be updated on a release, but version number will be read only from the first one.

Read next section for a complete set of available options.

API

register(gulpInst[, options])

Declares tasks on the gulpInst gulp instance. options is an optional object that can be defined to override the following sensible defaults:

 {
     tasks: {
        // Name of the main task (a.k.a, `gulp release`)
       release: 'release'
     },
     messages: {
        // Commmit message on version bumping
       bump: 'Bump release version',

       // Commit message on setting next "-dev" version on `develop`
       next: 'Set next development version'
    },

    // Supports glob syntax
    packages: ['package.json'],

    // Suffix added on development versions (ie.: on `develop` branch)
    devSuffix: '-dev',

    // Path to a custom codenames file. See https://github.com/scriptwerx/gulp-codename/blob/master/codenames.json
    codenames: 'my-codenames.json'
};

This parameters permits you to configure main task name, commit messages and .json files containing a .version attribute that will be bumped on a new release.

Tasks

release

Performs a full, automatic project release. Uses git flow release internally. Name is configurable.

It's required that your version numbering follows semver specifications.

gulp release [-v --version VERSION] [-t --type TYPE] [-m CODENAME] [-c --codenames PATH] [-p --push]

The repository you invoke this task on, must be git flow enabled. Run git flow init if you haven't already, before running gulp release. Otherwise, the task will fail.

  • -v or --version can be used to indicate a specific next version (such as 3.2.2-beta). If unspecified, the version from your first configured package file (ie., package.json) will be used.
  • -t or --type can be used to indicate types of version increment (MAJOR, MINOR or PATCH). Next release version defaults to PATCH increment.
  • If your current version ends with a suffix, next default version will be that same number without the suffix (0.0.2-dev -> 0.0.2).
  • -m provides a human readable "codename" for the release. One will be autogenerated if not provided.
  • -c or --codenames provides a path to a custom codenames JSON file. This takes precedence over the .register() config option if both are set.
  • -p or --push indicate whether to push results (branches and tags) to origin or not after finishing the release process. Defaults to false.

This recipe will perform the following actions, sequentially (default option values are assumed):

  1. Invoke git flow release start -F <version>. Where <version> is either set from a command line argument or read from a package file.
  2. Bump the version on all package files and generate a codename for the release if one was not already provided with -m.
  3. Commit changes from last step to develop using "Bump release version" as message.
  4. Invoke git flow release finish -m <codename> <version>.
  5. Bump the version on all packages files to next development iteration using a -dev suffix (like 1.0.1-dev).
  6. Commit changes from last step to develop using "Set next development version" as message.
  7. If the -p (or --push) flag was set, push all tags and local develop and master branches to origin.

See the git flow release wiki for details on what's happening under the hood when calling git flow release start|finish.

License

MIT

gulp-release's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar nfantone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gulp-release's Issues

An in-range update of gulp-git is breaking the build 🚨

The dependency gulp-git was updated from 2.8.1 to 2.9.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

gulp-git is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 2 commits.

  • cb98cb8 2.9.0
  • c27a014 Ensure git.diff has maxBuffer opt - closes #192

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-promise is breaking the build 🚨

The devDependency eslint-plugin-promise was updated from 4.0.1 to 4.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-promise is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.15.2 to 1.15.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for 1.15.3

🔗 Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of lodash is breaking the build 🚨

The dependency lodash was updated from 4.17.10 to 4.17.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

lodash is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Problem escaping quotes in git push

I have a problem when i want to push changes to origin. The problem is when declare the branches to push:

Error: Command failed: /bin/sh -c git push origin 'develop master' --tags

Would there be an elegant way to solve it ?

Thanks

An in-range update of gulp-json-transform is breaking the build 🚨

The dependency gulp-json-transform was updated from 0.4.5 to 0.4.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

gulp-json-transform is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 4 commits.

  • 7914c5d Updated to v0.4.6 after the removal of gulp-util
  • 75e8d76 Merge pull request #8 from asghol/master
  • 4d9eaa2 No longer dependent on deprecated package (gulp-util), closes #7
  • f671ab2 Removed bad file

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-import is breaking the build 🚨

The devDependency eslint-plugin-import was updated from 2.14.0 to 2.15.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 34 commits.

  • 767f01a bump to v2.15.0
  • 038d668 bump webpack resolver to v0.11.0
  • 20a8f3b bump utils to v2.3.0
  • 1e4100d changelog note for #1261
  • 548ea02 added support for argv parameter of webpack`s config-as-a-function (#1261)
  • fcf2ce7 Merge pull request #1254 from ljharb/travis
  • 64d9be7 allow_failures for dicey Node/ESLint intersection
  • 73080d0 dep-time-travel: use older versions of dependencies
  • 05c3935 repair no-deprecated for ESLint* 5
  • 10c9811 node 4 fix for test util
  • f165237 ah geez, bumping babel-eslint breaks no-amd/no-cjs
  • acfb6e9 jk, test against eslint 2/3 but skip Typescript tests.
  • b686f9d drop ESLint 2/3 from Travis/Appveyor
  • cf1f6f4 [Deps] update debug, eslint-import-resolver-node, has, lodash, minimatch, resolve
  • d290a87 [Dev Deps] update babylon, coveralls, eslint-import-resolver-typescript, gulp, linklocal, nyc, redux, rimraf, sinon, typescript-eslint-parser

There are 34 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Providing Type without Version fails

If providing type of release without specifying version tag causes release to fail.

$ gulp release -t patch
[11:22:34] Using gulpfile ~/gulpfile.js
[11:22:34] Starting 'release'...
[11:22:34] Starting 'release:start'...
[11:22:34] git flow release start -F 1.0.2
Switched to a new branch 'release/1.0.2'

Summary of actions:

  • A new branch 'release/1.0.2' was created, based on 'develop'
  • You are now on branch 'release/1.0.2'

Follow-up actions:

  • Bump the version number now!

  • Start committing last-minute fixes in preparing your release

  • When done, run:

    git flow release finish '1.0.2'

[11:22:35] Finished 'release:start' after 1.23 s
[11:22:35] Starting 'bump'...
[11:22:35] Bumped 1.0.2 to 1.0.3 with type: patch
[11:22:35] Codename is "Platinum Uninorth"
[11:22:35] Finished 'bump' after 44 ms
[11:22:35] Starting 'release:commit'...
[11:22:35] Finished 'release:commit' after 30 ms
[11:22:35] Starting 'release:finish'...
[11:22:35] git flow release finish -m 'Platinum Uninorth' 1.0.3
Fatal: Branch 'release/1.0.3' does not exist and is required.
[11:22:35] 'release:finish' errored after 602 ms
[11:22:35] Error: Command git flow release finish -m 'Platinum Uninorth' 1.0.3 failed with exit code 1
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
[11:22:35] [gulp-release] All done: review changes and push to origin
[11:22:35] Finished 'release' after 1.91 s

failed releasing on Windows

I tried to use this plugin on a windows machine and it failed with the error down there.
When I manually entered "git flow release finish" the command succeeded.

nodejs: v8.11.3
git version 2.19.1.windows.1
"gulp": "^3.9.1"
"gulp-release": "^1.2.0"
"gulp-shell": "^0.6.3"

gulp release -t PATCH -p
[12:50:38] Using gulpfile ~\Documents\WebProjects\git-flow-release\proj\gulpfile.js
[12:50:38] Starting 'release'...
[12:50:38] Starting 'release:start'...
[12:50:38] git flow release start -F 0.1.3
Switched to a new branch 'release/0.1.3'

Summary of actions:

  • A new branch 'release/0.1.3' was created, based on 'develop'
  • You are now on branch 'release/0.1.3'

Follow-up actions:

  • Bump the version number now!

  • Start committing last-minute fixes in preparing your release

  • When done, run:

    git flow release finish '0.1.3'

[12:50:42] Finished 'release:start' after 3.56 s
[12:50:42] Starting 'bump'...
[12:50:42] Bumped 0.1.2 to 0.1.3 with type: patch
[12:50:42] Codename is "Bronze Marklar"
[12:50:42] Finished 'bump' after 49 ms
[12:50:42] Starting 'release:commit'...
[12:50:42] Finished 'release:commit' after 181 ms
[12:50:42] Starting 'release:finish'...
[12:50:42] git flow release finish -m 'Bronze Marklar' 0.1.3
C:/Program Files/Git/usr/bin/gitflow-shFlags: eval: line 890: unexpected EOF while looking for matching '' C:/Program Files/Git/usr/bin/gitflow-shFlags: eval: line 891: syntax error: unexpected end of file [12:50:50] 'release:finish' errored after 8.39 s [12:50:50] Error in plugin "gulp-shell" Message: Command git flow release finish -m 'Bronze Marklar' 0.1.3` failed with exit code 2
[12:50:50] [gulp-release] All done: tags and branches pushed to origin
[12:50:50] Finished 'release' after 12 s

Errors with new gulp-bump and gulp-git version

Hi,
I believe that the update of the transitive dependencies has broken the libray.

gulp-release 1.1.0 have dependencies from:
"gulp-bump": "^2.4.0",
"gulp-git": "^1.11.0",

At this moment, this download:
"gulp-bump" -> 2.5.0" (published 1 Nov)
"gulp-git" -> 1.12.0" (published 19 Oct)

I do not know since when it happens but now it does not work.
I think it's because of the transitive dependencies

gulp-bump transform de package version '2016.0.1' to '22016.0.1' or '16.0.1' to '116.0.2'.
The new version number is wrong and this breaks the branch fetch.

gulp-release give me the following error
Error: Command git flow release finish -m 'CODE' 116.0.2 failed with exit code 1
at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

An in-range update of eslint-plugin-standard is breaking the build 🚨

Version 2.2.0 of eslint-plugin-standard just got published.

Branch Build failing 🚨
Dependency eslint-plugin-standard
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-standard is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 3 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint-config-prettier is breaking the build 🚨

The devDependency eslint-config-prettier was updated from 3.5.0 to 3.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 7 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.