Skip to content

Commit 6bfcd29

Browse files
author
Chris Park
committed
Updates
- examples Dockerfile updated to actually use the NPM rosette-api instead of the source - README updated with link to Release Notes - examples runAll.sh updated to place the required libraries in their correct locations - Jenkinsfile.examples updated to use the correct source mount
1 parent 8b72ed1 commit 6bfcd29

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Jenkinsfile.examples

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ node {
1616
}
1717
stage("Run Examples") {
1818
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) {
19-
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}"
19+
def examplesDir = ${SOURCEDIR} + '/examples'
20+
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${examplesDir}:/source ${TEST_CONTAINER}"
2021
}
2122
}
2223
slack(true)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,8 @@ See [examples](examples).
7676
## API Documentation
7777
See [documentation](http://rosette-api.github.io/nodejs)
7878

79+
## Release Notes
80+
See [wiki](https://github.com/rosette-api/nodejs/wiki/Release-Notes)
81+
7982
## Additional Information
8083
See [Rosette API site](https://developer.rosette.com/)

examples/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ RUN apt-get -y update && apt-get install -y git && apt-get install -y vim && apt
77
ENV API_KEY api_key
88

99
#set the working directory
10-
RUN mkdir /nodejs-dev
11-
WORKDIR /nodejs-dev
10+
RUN mkdir -p /nodejs-dev/examples
11+
WORKDIR /nodejs-dev/examples
1212
COPY runAll.sh runAll.sh
1313
RUN chmod 0755 runAll.sh
1414

examples/runAll.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function checkAPI() {
2121
if [ ! -z $match ]; then
2222
echo -e "\nInvalid Rosette API Key"
2323
exit 1
24-
fi
24+
fi
2525
}
2626

2727
# add the trailing slash of the alt_url if necessary
@@ -41,7 +41,7 @@ function validateURL() {
4141
if [ "${match}" = "" ]; then
4242
echo -e "\n${ping_url} server not responding\n"
4343
exit 1
44-
fi
44+
fi
4545
}
4646

4747
function runExample() {
@@ -93,19 +93,21 @@ cp -r -n /source/. .
9393
#Run the examples
9494
if [ ! -z ${API_KEY} ]; then
9595
checkAPI
96-
#Prerequisite
97-
cd ./examples
96+
npm install rosette-api
97+
cp -r node_modules/rosette-api/lib ../lib
98+
pushd ../lib
99+
npm install multipart-stream
100+
popd
98101
npm install argparse
99102
npm install temporary
100-
npm install multipart-stream
101103
if [ ! -z ${FILENAME} ]; then
102104
runExample ${FILENAME}
103105
else
104106
for file in *.js; do
105107
runExample ${file}
106108
done
107109
fi
108-
else
110+
else
109111
HELP
110112
fi
111113

0 commit comments

Comments
 (0)