Skip to content

Commit

Permalink
Merge pull request #11277 from driftyco/CI-Updates
Browse files Browse the repository at this point in the history
chore(CI): Updating ionicframework homepage automatically on release
  • Loading branch information
perrygovier authored Apr 19, 2017
2 parents fd3c6ba + afc9b36 commit a5a85de
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/docs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ function run {
./node_modules/.bin/gulp docs.dgeni --doc-version="$VERSION_NAME"
./node_modules/.bin/gulp docs.dgeni --doc-version="nightly"

./node_modules/.bin/gulp docs.homepageVersionUpdate

else

if [ -d "$DOCS_DEST/nightly/api" ]; then
Expand Down
2 changes: 2 additions & 0 deletions scripts/gulp/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ES_2015 = 'es2015';
export const ES5 = 'es5';
export const INDEX_JS = 'index.js';
export const BUNDLES = 'bundles';
export const SITE_NAME = 'ionic-site';

// File Paths
export const PROJECT_ROOT = join(__dirname, '../..');
Expand All @@ -36,6 +37,7 @@ export const DIST_VENDOR_ROOT = join(DIST_ROOT, VENDOR_NAME);
export const NODE_MODULES_ROOT = join(PROJECT_ROOT, NODE_MODULES);
export const SCRIPTS_ROOT = join(PROJECT_ROOT, SCRIPTS_NAME);
export const SRC_ROOT = join(PROJECT_ROOT, SRC_NAME);
export const SITE_ROOT = join(PROJECT_ROOT, '..', SITE_NAME);

export const SRC_COMPONENTS_ROOT = join(SRC_ROOT, COMPONENTS_NAME);
export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers');
Expand Down
15 changes: 15 additions & 0 deletions scripts/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { valid }from 'semver';
import { argv } from 'yargs';

import { DIST_DEMOS_ROOT } from '../constants';
import { SITE_ROOT } from '../constants';
import { PROJECT_ROOT } from '../constants';

task('docs', ['docs.dgeni', 'docs.demos', 'docs.sassVariables']);

Expand Down Expand Up @@ -136,3 +138,16 @@ task('docs.sassVariables', () => {
writeFileSync(outputFile, JSON.stringify(variables));
}));
});

task('docs.homepageVersionUpdate', () => {
// This assumes you're currently releasing
const sourcePackageJSON = require(`${PROJECT_ROOT}/package.json`);
let now = new Date();

const frameworkInfo = JSON.stringify({
version: sourcePackageJSON.version,
date: now.toISOString().split('T')[0]
}, null, 2);

writeFileSync(`${SITE_ROOT}/server/data/framework-info.json`, frameworkInfo);
});

0 comments on commit a5a85de

Please sign in to comment.