Skip to content

Commit

Permalink
Yet another fix for CI to find branch that contaisn tag latest
Browse files Browse the repository at this point in the history
Reviewed By: svcscm

Differential Revision: D2937802

fb-gh-sync-id: 3bd617d5fc7fea42d264acfbd229fd15b335a95d
shipit-source-id: 3bd617d5fc7fea42d264acfbd229fd15b335a95d
  • Loading branch information
bestander authored and facebook-github-bot-5 committed Feb 15, 2016
1 parent e5ba46c commit ecb1643
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ general:
- gh-pages # list of branches to ignore
machine:
node:
version: 5.1.0
version: 5.6.0
environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH"
TERM: "dumb"
Expand All @@ -22,18 +22,16 @@ dependencies:
- buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
- buck/bin/buck fetch ReactAndroid/src/test/...
- buck/bin/buck fetch ReactAndroid/src/androidTest/...
# using npm@3 because of problems with shrink-wrapped optional deps installs on linux
- npm install -g [email protected]
- source scripts/circle-ci-android-setup.sh && getAndroidSDK
- ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog
- cd website && npm install
cache_directories:
- "ReactAndroid/build/downloads"
- "buck"
- "buck-out/bin"
- "website/node_modules"
override:
- npm install
- cd website && npm install

test:
pre:
Expand Down
4 changes: 2 additions & 2 deletions website/publish-gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ mkdir(`-p`, `build`);
const currentCommit = exec(`git rev-parse HEAD`).stdout.trim();
const latestTagCommit = exec(`git ls-remote origin latest`).stdout.split(/\s/)[0];
// pass along which branch contains latest version so that gh-pages root could mark it as latest
const branchWithLatestTag = exec(`git branch --contains latest`).stdout;
const branchWithLatestTag = exec(`git branch -r --contains ${latestTagCommit}`).stdout.split('/')[1];
let latestVersion = ``;
if (branchWithLatestTag.indexOf(`-stable`) !== -1) {
latestVersion = branchWithLatestTag.slice(0, branchWithLatestTag.indexOf(`-stable`)).trim();
latestVersion = branchWithLatestTag.slice(0, branchWithLatestTag.indexOf(`-stable`));
}

if (!CI_PULL_REQUEST && CIRCLE_PROJECT_USERNAME === `facebook`) {
Expand Down
2 changes: 1 addition & 1 deletion website/src/react-native/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var versions = React.createClass({
].concat(availableDocs.map((version) => {
const isLatest = Metadata.config.RN_LATEST_VERSION === version;
return {
title: isLatest ? `${version} + (current)` : version,
title: isLatest ? `${version} (current)` : version,
path: isLatest ? '/react-native' : '/react-native/releases/' + version
}
}));
Expand Down

0 comments on commit ecb1643

Please sign in to comment.