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

Commit 5d1bd63

Browse files
Fix Ubuntu incompatibility in run-jekyll.sh (#4319)
* Fix Ubuntu incompatibility in run-jekyll.sh * Fix npm publish tagging Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 4687ddc commit 5d1bd63

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

.travis/deploy.sh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ if [ "${BUILD_RELEASE}" = 'unstable' ]; then
8989
npm run pkgstamp
9090
fi
9191

92-
# Which (if any) tag to use for npm and docker publish
92+
# Which tag to use for npm and docker publish
9393
if [ "${BUILD_FOCUS}" = 'latest' ]; then
94-
[ "${BUILD_RELEASE}" = 'stable' ] && TAG='latest' || TAG='unstable'
94+
[ "${BUILD_RELEASE}" = 'stable' ] && NPM_TAG='latest' || NPM_TAG='unstable'
95+
DOCKER_TAG="${NPM_TAG}"
9596
else
96-
TAG=''
97+
[ "${BUILD_RELEASE}" = 'stable' ] && NPM_TAG='legacy' || NPM_TAG='legacy-unstable'
98+
DOCKER_TAG=''
9799
fi
98100

99101
# Hold onto the version number
@@ -113,13 +115,8 @@ done
113115

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

156153
# Build the image, and tag if required
157154
docker build --build-arg VERSION=${VERSION} -t hyperledger/${i}:${VERSION} ${DIR}/packages/${i}/docker
158-
if [ ! -z "${TAG}" ]; then
159-
docker tag hyperledger/${i}:${VERSION} hyperledger/${i}:"${TAG}"
155+
if [ ! -z "${DOCKER_TAG}" ]; then
156+
docker tag "hyperledger/${i}:${VERSION}" "hyperledger/${i}:${DOCKER_TAG}"
160157
fi
161158

162159
# Push the image, and tagged version if required
163160
docker push hyperledger/${i}:${VERSION}
164-
if [ ! -z "${TAG}" ]; then
165-
docker push hyperledger/${i}:${TAG}
161+
if [ ! -z "${DOCKER_TAG}" ]; then
162+
docker push "hyperledger/${i}:${DOCKER_TAG}"
166163
fi
167164
done
168165

packages/composer-website/scripts/run-jekyll.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2727
"${SCRIPT_DIR}/setup-jekyll.sh"
2828

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

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

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

0 commit comments

Comments
 (0)