From afc9b36c5d4356aa71e7256537df00b27f653d68 Mon Sep 17 00:00:00 2001 From: perry Date: Wed, 19 Apr 2017 11:16:42 -0500 Subject: [PATCH] chore(CI): Updating ionicframework homepage automatically on release --- scripts/docs/deploy.sh | 2 ++ scripts/gulp/constants.ts | 2 ++ scripts/gulp/tasks/docs.ts | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/scripts/docs/deploy.sh b/scripts/docs/deploy.sh index d8e4be7f29..1e93393f15 100755 --- a/scripts/docs/deploy.sh +++ b/scripts/docs/deploy.sh @@ -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 diff --git a/scripts/gulp/constants.ts b/scripts/gulp/constants.ts index 05fe33b550..ad6d9a14a1 100644 --- a/scripts/gulp/constants.ts +++ b/scripts/gulp/constants.ts @@ -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'); diff --git a/scripts/gulp/tasks/docs.ts b/scripts/gulp/tasks/docs.ts index 18d97c9d92..94dbebf709 100644 --- a/scripts/gulp/tasks/docs.ts +++ b/scripts/gulp/tasks/docs.ts @@ -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); +});