Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Fix Ubuntu incompatibility in run-jekyll.sh (#4319)
Browse files Browse the repository at this point in the history
* Fix Ubuntu incompatibility in run-jekyll.sh
* Fix npm publish tagging

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Aug 9, 2018
1 parent 4687ddc commit 5d1bd63
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
25 changes: 11 additions & 14 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ if [ "${BUILD_RELEASE}" = 'unstable' ]; then
npm run pkgstamp
fi

# Which (if any) tag to use for npm and docker publish
# Which tag to use for npm and docker publish
if [ "${BUILD_FOCUS}" = 'latest' ]; then
[ "${BUILD_RELEASE}" = 'stable' ] && TAG='latest' || TAG='unstable'
[ "${BUILD_RELEASE}" = 'stable' ] && NPM_TAG='latest' || NPM_TAG='unstable'
DOCKER_TAG="${NPM_TAG}"
else
TAG=''
[ "${BUILD_RELEASE}" = 'stable' ] && NPM_TAG='legacy' || NPM_TAG='legacy-unstable'
DOCKER_TAG=''
fi

# Hold onto the version number
Expand All @@ -113,13 +115,8 @@ done

# Only enter here if ignore array is not same length as the publish array
if [ "${#ALL_NPM_MODULES[@]}" -ne "${#IGNORE_NPM_MODULES[@]}" ]; then
if [ -z "${TAG}" ]; then
echo 'Publishing to npm without tag'
lerna exec --ignore '@('${IGNORE}')' -- npm publish 2>&1
else
echo "Publishing to npm with tag ${TAG}"
lerna exec --ignore '@('${IGNORE}')' -- npm publish --tag="${TAG}" 2>&1
fi
echo "Publishing to npm with tag ${NPM_TAG}"
lerna exec --ignore '@('${IGNORE}')' -- npm publish --tag="${NPM_TAG}" 2>&1
else
echo "All npm modules with tag ${VERSION} exist, skipping publish phase"
fi
Expand Down Expand Up @@ -155,14 +152,14 @@ for i in ${PUBLISH_DOCKER_IMAGES[@]}; do

# Build the image, and tag if required
docker build --build-arg VERSION=${VERSION} -t hyperledger/${i}:${VERSION} ${DIR}/packages/${i}/docker
if [ ! -z "${TAG}" ]; then
docker tag hyperledger/${i}:${VERSION} hyperledger/${i}:"${TAG}"
if [ ! -z "${DOCKER_TAG}" ]; then
docker tag "hyperledger/${i}:${VERSION}" "hyperledger/${i}:${DOCKER_TAG}"
fi

# Push the image, and tagged version if required
docker push hyperledger/${i}:${VERSION}
if [ ! -z "${TAG}" ]; then
docker push hyperledger/${i}:${TAG}
if [ ! -z "${DOCKER_TAG}" ]; then
docker push "hyperledger/${i}:${DOCKER_TAG}"
fi
done

Expand Down
6 changes: 3 additions & 3 deletions packages/composer-website/scripts/run-jekyll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"${SCRIPT_DIR}/setup-jekyll.sh"

# Write custom configuration for this build
JEKYLL_CONFIG="$(mktemp -t jekyll-config.yml)"
JEKYLL_CONFIG="$(mktemp)"
echo "basedir: /composer/${BUILD_LABEL}" >> "${JEKYLL_CONFIG}"
echo "status: ${BUILD_LABEL}" >> "${JEKYLL_CONFIG}"

# Run Jekyll command
cd "${DOCS_DIR}"
jekyll ${JEKYLL_COMMAND} --config "_config.yml,${JEKYLL_CONFIG}" ${@:4}
cd "${DOCS_DIR}" || exit 2
jekyll "${JEKYLL_COMMAND}" --config "_config.yml,${JEKYLL_CONFIG}" "${@:4}"

# Clean up custom configuration
rm -f "${JEKYLL_CONFIG}"

0 comments on commit 5d1bd63

Please sign in to comment.