Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

patternfly-eng-publish

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

patternfly-eng-publish

A collection of scripts for publishing PatternFly sites.

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

patternfly-eng-publish

A set of scripts for publishing PatternFly sites.

Usage

This script will publish files to the gh-pages branch of your repo.

publish-ghpages.sh [option] folder

Example: publish-ghpages.sh

OPTIONS:
h       Display this message
t       Perform a deploy from travis, using a travis encrypted key
w       Remove non-web files from the SITE_FOLDER/components folder prior to publishing
b       Remote branch this script will publish to
        default: gh-pages
r       Git repo this script will publish to
        eg.: origin, upstream, bleathem, git@github.com:bleathem/bleathem.github.io.git
        default: origin

Installation

npm install --save-dev patternfly-eng-publish

Add a run script to your package.json with appropriate options set:

"scripts": {
    "publish": "publish-ghpages.sh public"
  },

Use npm run publish to publish the site.

Invoking from travis

Add another npm run script:

"scripts": {
    "publish-travis": "publish-ghpages.sh -t public"
  },

Update the .travis.yml file to invoke the script:

env:
  global:
    - ENCRYPTION_LABEL: "XXXXXXXXXXXX"
    - COMMIT_AUTHOR_EMAIL: "patternfly-build@redhat.com"
    - TRIGGER_REPO_SLUG: "patternfly/patternfly-atomic"
    - TRIGGER_REPO_BRANCH: "master"

...

after_success:
  - npm run publish-travis

Adding deploy keys

We create a new key for every repo. Upload the public key to the repos via the github UI under Settings -> Deploy Keys.

ssh-keygen -t rsa -b 4096 -C "patternfly-build@redhat.com" -f deploy-key_patternfly-design

The private key gets encrypted and placed in the repo itself. gem isntall travis to use the travis tool to encrypt it. Don't follow the instructions in the output of that command, but you do extract the encryption label from that message.

travis encrypt-file deploy_key

The publish-ghpages cript is written such that it will look for the file called "deploy_key.enc" and use the ENCRYPTION_LABEL env var to decrypt it. It then uses ssh-agent to load the key and use it for git pushes (over ssh).

There is no need to share the keys. We can re-create them more easily than we can manage sharing them.

Keywords

patternfly

FAQs

Package last updated on 01 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts