chore(CI): Updating ionicframework homepage automatically on release

This commit is contained in:
perry
2017-04-19 11:16:42 -05:00
parent fd3c6baec7
commit afc9b36c5d
3 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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, '../..');
@ -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');

View File

@ -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']);
@ -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);
});