Skip to content

Commit

Permalink
chore(): modify npm and nightly publish scripts for experimental package
Browse files Browse the repository at this point in the history
* feat(): bind experimentals versioning to Covalent's

* feat(): update links

* feat(): experimental nightly build w/ core nightly build refactored into it

* chore(): modify npm script and nightly script for experimental usage
  • Loading branch information
stevenov7 authored and emoralesb05 committed Jun 27, 2018
1 parent 0a1ac11 commit 3149b68
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The source has two parts, the platform and a documentation app.

## Adding a new platform feature (component/module/utility)

Please reference these [docs](https://github.com/Teradata/covalent/blob/93c5a064d1aa19fab5015f5def2b300f48671de2/src/platform/experimental/README.md).
Please reference these [docs](https://github.com/Teradata/covalent/blob/develop/src/platform/experimental/README.md).



Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build:lib": "bash scripts/build-release && gulp version-placeholder",
"build:universal": "bash scripts/build-universal",
"publish:npm": "npm run build:lib && bash scripts/npm-publish",
"publish:nightly": "npm run build:lib && bash scripts/nightly-publish",
"publish:nightly": "npm run build:lib && bash scripts/nightly-publish core && bash scripts/nightly-publish experimental",
"ghpages:deploy": "npm run build:docs -- --base-href /covalent/ && bash scripts/ghpages-deploy",
"release:start": "bash scripts/start-release",
"release:finish": "bash scripts/finish-release",
Expand Down
31 changes: 21 additions & 10 deletions scripts/nightly-publish
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@

set -o errexit -o nounset

buildDir="deploy/platform/core"
package=$1

buildDir="deploy/platform/${package}"

commitSha=$(git rev-parse --short HEAD)
commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)
commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)
commitMessage=$(git log --oneline -n 1)

repoName="covalent-nightly"
repoUrl="https://github.com/Teradata/covalent-nightly.git"
if [ $package = "core" ]
then
repoName="covalent-nightly"
repoUrl="https://github.com/Teradata/covalent-nightly.git"
else
repoName="covalent-${package}-nightly"
repoUrl="https://github.com/Teradata/covalent-${package}-nightly.git"
fi
repoDir="deploy/$repoName"

echo "Cloning $repoUrl into $repoDir"
git clone $repoUrl $repoDir

echo "Cleaning nightly repo and moving release files into it"
rm -rf $repoDir/*
cp -r $buildDir/* $repoDir
cp -rf $buildDir/* $repoDir
cd $repoDir

# Prepare Git for pushing the artifacts to the repository.
Expand All @@ -29,9 +37,12 @@ git config credential.helper "store --file=.git/credentials"

echo "https://${COVALENT_NIGHTLY_TOKEN}:@github.com" > .git/credentials

git add -A
git commit -m "$commitMessage"
git tag "$commitSha"
git push origin master --tags

echo "Finished publishing nightly build"
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "$commitMessage"
git tag "$commitSha"
git push origin master --tags
echo "Finished publishing nightly build for ${package}"
else
echo "No changes to commit for ${package}";
fi
8 changes: 6 additions & 2 deletions scripts/npm-publish
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ for package in ./deploy/platform/*
do
if [ -d ${package} ]
then
npm publish ${package} --access=public --tag=$tag
# ignore experimental package
if [[ !(${package} =~ "experimental") ]]
then
npm publish ${package} --access=public --tag=$tag
fi
fi
done

#logout when finished
npm logout
npm logout
echo "Published successfully [scope: $scope]. Use 'npm install [package-name]' in the project you want to use it."
2 changes: 1 addition & 1 deletion src/platform/experimental/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@covalent/experimental",
"description": "Teradata UI Platform Experimental Module",
"version": "0.0.0-EXPERIMENTAL",
"version": "0.0.0-COVALENT",
"license": "MIT",
"author": "Teradata UX",
"contributors": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="https://goo.gl/jrNtS9"> Test Link </a>
<a href="https://github.com/Teradata/covalent"> Test Link </a>

0 comments on commit 3149b68

Please sign in to comment.