Skip to content

Commit

Permalink
fix(doc): build doc was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Alexander Kopriwa committed Jun 26, 2018
1 parent aef373d commit babe53f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
51 changes: 29 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ stages:
- build
- test
- release
- deploy
# - deploy

jobs:
include:
Expand All @@ -53,7 +53,6 @@ jobs:
organization: $(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}')
script:
- npm run test
# - sonar-scanner -Dsonar.branch=${TRAVIS_BRANCH} -Dsonar.projectVersion=${SONAR_VERSION}
- sonar-scanner

# Job: Release
Expand All @@ -64,26 +63,6 @@ jobs:
skip_cleanup: true
script:
- npx semantic-release

# Job: Page
- stage: deploy
if: branch = master
node_js:
- 'lts/*'
script:
- npm install
# Replace variables
- npx rollup-umd-scripts doc variable PACKAGE_NAME=${PACKAGE_NAME}
- npx rollup-umd-scripts doc variable PACKAGE_PEERS="$(npx rollup-umd-scripts peer npm-install-cmd)"
- npx rollup-umd-scripts doc variable PACKAGE_VERSION=$(node -p "require('./package.json').version")
- npx rollup-umd-scripts doc variable NODE_VERSION=${NODE_VERSION}
- npx rollup-umd-scripts doc variable NPM_VERSION=${NPM_VERSION}
- npx rollup-umd-scripts doc variable CI_REPOSITORY_URL="https://github.com/${TRAVIS_REPO_SLUG}.git"
- npx rollup-umd-scripts doc variable CI_PROJECT_URL="https://github.com/${TRAVIS_REPO_SLUG}.git"
- npx rollup-umd-scripts doc variable CI_PROJECT_NAMESPACE=$(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}')
- npx rollup-umd-scripts doc variable CI_PROJECT_NAME=$(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $2}')
- npx rollup-umd-scripts doc variable IMG_SHIELD_PUBLISHING=$(npx rollup-umd-scripts publish status --badge)
- npm run styleguide:build
deploy:
- provider: pages
skip_cleanup: true
Expand All @@ -92,3 +71,31 @@ jobs:
local_dir: public/
on:
tags: true

# # Job: Page
# - stage: deploy
# if: branch = master
# node_js:
# - 'lts/*'
# script:
# - npm install
# # Replace variables
# - npx rollup-umd-scripts doc variable PACKAGE_NAME=${PACKAGE_NAME}
# - npx rollup-umd-scripts doc variable PACKAGE_PEERS="$(npx rollup-umd-scripts peer npm-install-cmd)"
# - npx rollup-umd-scripts doc variable PACKAGE_VERSION=$(node -p "require('./package.json').version")
# - npx rollup-umd-scripts doc variable NODE_VERSION=${NODE_VERSION}
# - npx rollup-umd-scripts doc variable NPM_VERSION=${NPM_VERSION}
# - npx rollup-umd-scripts doc variable CI_REPOSITORY_URL="https://github.com/${TRAVIS_REPO_SLUG}.git"
# - npx rollup-umd-scripts doc variable CI_PROJECT_URL="https://github.com/${TRAVIS_REPO_SLUG}.git"
# - npx rollup-umd-scripts doc variable CI_PROJECT_NAMESPACE=$(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}')
# - npx rollup-umd-scripts doc variable CI_PROJECT_NAME=$(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $2}')
# - npx rollup-umd-scripts doc variable IMG_SHIELD_PUBLISHING=$(npx rollup-umd-scripts publish status --badge)
# - npm run styleguide:build
# deploy:
# - provider: pages
# skip_cleanup: true
# github_token: $GH_TOKEN # Set in the settings page of your repository, as a secure variable
# keep_history: true
# local_dir: public/
# on:
# tags: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
},
{
"path": "@semantic-release/exec",
"cmd": "npx -p rollup-umd-scripts scripts-ci transitive publish ${nextRelease.version}"
"cmd": "./styleguide/prepare.sh ${nextRelease.version}"
}
]
},
Expand Down
25 changes: 18 additions & 7 deletions styleguide/prepare.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#!/usr/bin/env bash

npx @yeutech/rollup-umd-scripts doc variable \
version=$1
if [[ $version ]]; then
echo "Building documentation for tag $version"
git checkout refs/tags/$1
fi

npm install
npx rollup-umd-scripts doc variable \
PACKAGE_NAME=${PACKAGE_NAME} \
PACKAGE_PEERS="$(npx @yeutech/rollup-umd-scripts peer npm-install-cmd)" \
PACKAGE_PEERS="$(npx rollup-umd-scripts peer npm-install-cmd)" \
PACKAGE_VERSION=${PACKAGE_VERSION} \
NODE_VERSION=${NODE_VERSION} \
NPM_VERSION=${NPM_VERSION} \
CI_REPOSITORY_URL=${CI_REPOSITORY_URL} \
CI_PROJECT_URL=${CI_PROJECT_URL} \
CI_PROJECT_NAMESPACE=${CI_PROJECT_NAMESPACE} \
CI_PROJECT_NAME=${CI_PROJECT_NAME} \
IMG_SHIELD_PUBLISHING=$(npx @yeutech/rollup-umd-scripts publish status --badge)
CI_REPOSITORY_URL="https://github.com/${TRAVIS_REPO_SLUG}.git" \
CI_PROJECT_URL="https://github.com/${TRAVIS_REPO_SLUG}" \
CI_PROJECT_NAMESPACE=$(echo $TRAVIS_REPO_SLUG | awk -F / '{print $1}') \
CI_PROJECT_NAME=$(echo $TRAVIS_REPO_SLUG | awk -F / '{print $2}') \
IMG_SHIELD_PUBLISHING=$(npx rollup-umd-scripts publish status --badge)

npx rollup-umd-scripts doc add-section -n 'Code of conduct' -a 'FAQ' -c 'CODE_OF_CONDUCT.md' -f
npx rollup-umd-scripts doc add-section -n 'Changelog' -a 'Code of conduct' -c 'CHANGELOG.md' -f
npm run styleguide:build

0 comments on commit babe53f

Please # to comment.