Skip to content
This repository was archived by the owner on Oct 25, 2018. It is now read-only.

update release script and deployment README #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 11 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# READ-ONLY READ-ONLY READ-ONLY

This repo is a READ-ONLY repo. It contains the built output of the content
This repo is a READ-ONLY repo used for deploying the Guides.
It contains the built output of the content
from https://github.com/emberjs/guides. If you would like to make corrections
or additions to a guide, please open a pull request at
https://github.com/emberjs/guides.
Expand All @@ -9,102 +10,35 @@ https://github.com/emberjs/guides.

These instructions are for publishing a new version of the site at http://guides.emberjs.com. This section is intended for members of the Ember.js release team.

To avoid repetitive typing, set the version number as an environmental variable:

```shell
VERSION=<version number>
```

_NOTE: Historically, this version number was the new one (i.e. a new release of 2.4 would have meant building 2.4
files and putting them here). With our CD process running smoothly, we don't tend to refresh our old version of the guides until release. When doing the below release, we need to do these instructions twice (once for 2.12 and again for 2.13, as the current 2.12 folder will be about 5-6 weeks out of date with the "built-on-the-fly" version of the 2.12 guides)_

For `<version number>` we use the following format `v<major version>.<minor version>.<patch>`, so
`v1.10.0` is correct but `1.9.1` is not.

### Automatic publishing

_Note: we'd love to automate this even further down the road ..._
### Automatic publishing (recommended)

Ensure your `guides` repo is a sibling directory with this repo (`guides.emberjs.com`)

Build the latest guides and commit them as an update to the old version of guides (v2.16.0 in our case):

```shell
VERSION=<version number> # v2.16.0
sh release.sh
```

Commit your changes.

Re-run with the new version number (v2.17.0 in our example):
Run the release script with the new version number (v2.17.0 in our example).
This will build the app for deployment.

```shell
VERSION=<version number> # v2.17.0
sh release.sh
VERSION=<version number> sh release.sh
```

Then manually update `snapshots/_redirects` to redirect to the new current version.
Check the diff against master to make sure that
`snapshot/_redirects` and `snapshots/version.json`
reflect the new version number.

Then commit and push this repo:
Push the changes, and Netlify will deploy the update.

```shell
git add --all
git commit -m "Add snapshot for Ember.js revision $VERSION"
git push
```

Once those changes have hit Github, rebuild the latest Travis build of the `emberjs/guides` repo ([https://travis-ci.org/emberjs/guides](https://travis-ci.org/emberjs/guides)) which re-deploys
guides with the new version.

### Manual publishing

In the [main guides repo](https://github.com/emberjs/guides), make a branch with the version number:

```shell
git checkout -b $VERSION
git push
```

Next, build a new snapshot:

```shell
bundle exec middleman build
```

### Update the guides site repo

Move the build to the guides _site_ repo (this repo):

```shell
mv guides/build guides.emberjs.com/snapshots/$VERSION
```

Now, change directories into the guides site repo. Update the list of versions:

```shell
node tasks/update-versions.js
```

_The above step swaps out some constants that are part of our built files and updates `snapshots/version.json` with the latest versions_

You'll will also need to update `snapshots/_redirects` to redirect to the new current version.

Then commit and push this repo:

```shell
git add --all
git commit -m "Add snapshot for Ember.js revision $VERSION"
git push
```

Once those changes have hit Github, rebuilding the latest Travis build of the `emberjs/guides` repo will re-deploy
guides with the new version.

### Continuous Deploy Setup

Our main repo (https://github.com/emberjs/guides) is setup to auto-deploy to Netlify on every commit to `master` (as seen at https://github.com/emberjs/guides/blob/master/.travis/continuous-delivery.sh#L42). This uses a Netlify access token tied to the `ember-guides-deploy-bot` user account. If you need to generate a new Netlify access token (which requires Github access to that account), please contact @wifelette, @locks or @acorncom for the credentials.

### Manual Publishing
### Manual Deploy Setup

Publishing this repo manually isn't needed at this point, as it's handled by our main `emberjs/guides` repo.

Expand Down
5 changes: 3 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ cd ../guides.emberjs.com
mkdir $VERSION
mv ../guides/build snapshots/$VERSION
node tasks/update-versions

# NEEDS TO UPDATE _redirects
sed -Ei .bak "s/v[0-9]+[.][0-9]+[.][0-9]+/$VERSION/g" snapshots/_redirects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are .bak files part of gitignore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove .bak to avoid the temporary file.

git add --all
git commit -m "Add snapshot for Ember.js revision $VERSION"