mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Main changes: * Use gulpfile now (build was getting way too disorganized with custom tasks; gulpfiles are much easier to build clean custom tasks with than Grunt. * View README#Development for updated commands * Docs written for ionContent, ionHeaderBar, ionInfiniteScroll. * Docs are pushed to ajoslin's fork of ionic-site until they reach a * point where they can be published. **TODO, In Order of Priority** 1. Finish writing source-documentation for all existing components 2. Add multiple versions of docs (one per release & nightly, latest stable release docs being shown by default) 3. Add examples generation 4. Add searchbar to docs
129 lines
3.7 KiB
Bash
Executable File
129 lines
3.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Task that runs every time CI server is pushed to
|
|
|
|
ARG_DEFS=(
|
|
)
|
|
|
|
function init {
|
|
# If we are on travis, set our git credentials to make the travis commits look better
|
|
if [[ "$TRAVIS" == "true" ]]; then
|
|
git config --global user.name 'Ionotron'
|
|
git config --global user.email hi@ionicframework.com
|
|
export GH_ORG=driftyco
|
|
else
|
|
# For testing if we aren't on travis
|
|
export TRAVIS_BUILD_NUMBER=$RANDOM
|
|
export TRAVIS_PULL_REQUEST=false
|
|
export TRAVIS_COMMIT=$(git rev-parse HEAD)
|
|
export TRAVIS_BRANCH=master
|
|
# use your github username as GH_ORG to push to, and it will push to ORG/ionic-code, etc
|
|
export GH_ORG=ajoslin
|
|
fi
|
|
}
|
|
|
|
function run {
|
|
cd ../..
|
|
|
|
echo "GH_ORG=$GH_ORG"
|
|
echo "TRAVIS_BRANCH=$TRAVIS_BRANCH"
|
|
echo "TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER"
|
|
echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
|
|
echo "TRAVIS_COMMIT=$TRAVIS_COMMIT"
|
|
|
|
# check for stupid mistakes
|
|
# gulp ddescribe-iit
|
|
|
|
# Run simple quick tests on Phantom to be sure any tests pass
|
|
# Tests are run on cloud browsers after build
|
|
# gulp karma --browsers=PhantomJS --reporters=dots
|
|
|
|
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
|
|
echo "-- This is a pull request build; will not push build out."
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p tmp
|
|
git show $TRAVIS_COMMIT~1:package.json > tmp/package.old.json
|
|
OLD_VERSION=$(readJsonProp "tmp/package.old.json" "version")
|
|
OLD_CODENAME=$(readJsonProp "tmp/package.old.json" "codename")
|
|
VERSION=$(readJsonProp "package.json" "version")
|
|
CODENAME=$(readJsonProp "package.json" "codename")
|
|
|
|
if [[ "$OLD_VERSION" != "$VERSION" ]]; then
|
|
IS_RELEASE=true
|
|
echo "#######################################"
|
|
echo "# Releasing v$VERSION \"$CODENAME\"! #"
|
|
echo "#######################################"
|
|
else
|
|
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
|
|
echo "-- We are not on branch master, instead we are on branch $TRAVIS_BRANCH. Aborting build."
|
|
exit 0
|
|
fi
|
|
echo "#####################################"
|
|
echo "# Pushing out a new nightly release #"
|
|
echo "#####################################"
|
|
|
|
./scripts/travis/bump-nightly-version.sh
|
|
VERSION=$(readJsonProp "package.json" "version")
|
|
CODENAME=$(readJsonProp "package.json" "codename")
|
|
fi
|
|
|
|
# Build files after we are sure our version is correct
|
|
gulp build --release=true
|
|
|
|
if [[ $IS_RELEASE == "true" ]]; then
|
|
|
|
./scripts/travis/release-new-version.sh \
|
|
--codename=$CODENAME \
|
|
--version=$VERSION
|
|
|
|
./scripts/seed/publish.sh \
|
|
--version="$VERSION"
|
|
|
|
# Version name used on the CDN/docs: nightly or the version
|
|
VERSION_NAME=$VERSION
|
|
|
|
./scripts/site/publish.sh --action="clone"
|
|
./scripts/site/publish.sh --action="updateConfig"
|
|
./scripts/seed/publish.sh --version="$VERSION"
|
|
else
|
|
./scripts/site/publish.sh --action="clone"
|
|
|
|
VERSION_NAME="nightly"
|
|
fi
|
|
|
|
./scripts/site/publish.sh \
|
|
--action="docs" \
|
|
--version-name="$VERSION_NAME"
|
|
|
|
./scripts/cdn/publish.sh \
|
|
--version=$VERSION \
|
|
--version-name="$VERSION_NAME"
|
|
|
|
./scripts/bower/publish.sh \
|
|
--version="$VERSION" \
|
|
--codename="$CODENAME"
|
|
|
|
|
|
if [[ "$IS_RELEASE" == "true" ]]; then
|
|
echo "################################################"
|
|
echo "# Complete! v$VERSION \"$CODENAME\" published! #"
|
|
echo "################################################"
|
|
else
|
|
echo "##########################"
|
|
echo "# Running cloud tests... #"
|
|
echo "##########################"
|
|
|
|
# Do sauce unit tests and e2e tests with all browsers (takes longer)
|
|
gulp cloudtest
|
|
|
|
echo "##########################################"
|
|
echo "# Complete! v$VERSION nightly published! #"
|
|
echo "##########################################"
|
|
fi
|
|
}
|
|
|
|
source $(dirname $0)/../utils.inc
|
|
|