JSPM

  • Created
  • Published
  • Downloads 6648
  • Score
    100M100P100Q133245F
  • License MIT

Angular CLI addon. Publish to any `gh-pages` branch on GitHub (or any other branch on any other remote).

Package Exports

  • angular-cli-ghpages

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-cli-ghpages) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

angular-cli-ghpages

Angular CLI addon. Publish to any gh-pages branch on GitHub (or any other branch on any other remote).
This is NOT IgorMinar/angular-cli-github-pages. Brought to you by the angular2buch.de team!

WHY?

IgorMinar/angular-cli-github-pages is limited to the gh-pages branch of the same repository.

In contrast to this, the Angular2Buch/angular-cli-ghpages addon is able to push to any branch on any repository. It's build on top of tschaub/gh-pages.

This addon works great on Travis-CI.

Installation & Setup

This addon has the following prerequisites:

  • Node.js 4.x
  • Git 1.7.6 or higher
  • Angular project created via angular-cli

To install this addon all you need to do is install angular-cli-github-pages via npm:

npm i angular-cli-ghpages --saveDev

Usage

Run ng build to fill the dist folder. Then execute ng ghpages in order to deploy it.

Usage:

ng build
ng ghpages [OPTIONS]

Options

--repo

  • optional
  • default: url of the origin remote of the current dir (assumes a git repository)

By default, tschaub/gh-pages assumes that the current working directory is a git repository, and that you want to push changes to the origin remote. If instead your script is not in a git repository, or if you want to push to another repository, you can provide the repository URL in the repo option.

--message

  • optional
  • default: Auto-generated commit

The commit message, must be wrapped in quotes.
Hardcoded additional text is always added, if the environment variable process.env.TRAVIS exists (for Travis CI).

Example:

ng ghpages --message "What could possibly go wrong?"

--branch

  • optional
  • default: gh-pages

The name of the branch you'll be pushing to. The default uses GitHub's gh-pages branch, but this can be configured to push to any branch on any remote.

--name & --email

  • optional
  • default: value of git config user.name and git config user.email

If you are running the command in a repository without a user.name or user.email git config properties (or on a machine without these global config properties), you must provide user info before git allows you to commit. In this case provide both name and email string values to identify the committer.

--silent

  • optional
  • default: true (boolean)

Suppress logging. With silent true log messages are suppressed and error messages are sanitized.

This option should be used if the repository URL or other information passed to git commands is sensitive and should not be logged. By default the silent mode is enabled to avoid sensitive data exposure.

Extra

For your convenience, the addon will recognize the environment variable REPO_USER_AND_PASS and will replace this pattern in the --repo string. Please do NOT disable the silent mode if you have credentials in the repository URL!

In example, the following command runs on our Travis-CI:

ng build --environment=production
ng ghpages --repo=https://REPO_USER_AND_PASS@github.com/Angular2Buch/book-monkey2-public.git --name="The Buildbot" --email=buildbot@angular2buch.de

REPO_USER_AND_PASS stores credentials in the format username:password. Special charcaters must be percent-encoded.

License

Code released under the MIT license.