0.0.4 • Published 7 years ago

patternfly-eng-publish v0.0.4

Weekly downloads
26
License
Apache-2.0
Repository
github
Last release
7 years ago

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.

0.1.0-alpha.19

7 years ago

0.1.0-alpha.18

7 years ago

0.1.0-alpha.17

7 years ago

0.1.0-alpha.16

7 years ago

0.1.0-alpha.15

7 years ago

0.1.0-alpha.14

7 years ago

0.1.0-alpha.13

7 years ago

0.1.0-alpha.12

7 years ago

0.1.0-alpha.11

7 years ago

0.1.0-alpha.10

7 years ago

0.1.0-alpha.9

7 years ago

0.1.0-alpha.8

7 years ago

0.1.0-alpha.7

7 years ago

0.1.0-alpha.6

7 years ago

0.1.0-alpha.5

7 years ago

0.1.0-alpha.4

7 years ago

0.1.0-alpha.3

7 years ago

0.1.0-alpha.2

7 years ago

0.1.0-alpha.1

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago