Skip to content

Commit f139f51

Browse files
committed
feat: Initial commit
0 parents  commit f139f51

File tree

94 files changed

+19866
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+19866
-0
lines changed

.cfignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git/
2+
node_modules/

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
node_modules/

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
WATSON_VISION_COMBINED_APIKEY=<COPY-YOUR-API-KEY-HERE>
2+
WATSON_VISION_COMBINED_URL=https://us-south.visual-recognition.watson.cloud.ibm.com

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/*
2+
public/*

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Automatically normalize line endings for all text-based files
2+
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3+
* text=auto
4+
5+
# For the following file types, normalize line endings to LF on
6+
# checkin and prevent conversion to CRLF when they are checked out
7+
# (this is required in order to prevent newline related issues like,
8+
# for example, after the build script is run)
9+
.* text eol=lf
10+
*.css text eol=lf
11+
*.html text eol=lf
12+
*.jade text eol=lf
13+
*.js text eol=lf
14+
*.json text eol=lf
15+
*.less text eol=lf
16+
*.scss text eol=lf
17+
*.md text eol=lf
18+
*.sh text eol=lf
19+
*.txt text eol=lf
20+
*.xml text eol=lf

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# misc
12+
.DS_Store
13+
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
.env

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
coverage
3+
build
4+
public

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: node_js
2+
sudo: required
3+
node_js: 12
4+
cache:
5+
directories:
6+
- node_modules
7+
env:
8+
global:
9+
- BX_APP=visual-recognition-code-pattern
10+
- BX_API=https://api.ng.bluemix.net
11+
- BX_ORGANIZATION=WatsonPlatformServices
12+
- BX_SPACE=demos
13+
script:
14+
- npm run build
15+
- npm run test
16+
before_deploy: npm install -g bx-blue-green
17+
deploy:
18+
- provider: script
19+
skip_cleanup: true
20+
script: bx-blue-green-travis
21+
on:
22+
branch: master
23+
repo: watson-developer-cloud/visual-recognition-code-pattern
24+
- provider: script
25+
skip_cleanup: true
26+
script: npx semantic-release

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM node:12-alpine AS base
2+
WORKDIR /app
3+
4+
FROM base as build
5+
COPY ./package*.js* /app/
6+
RUN npm set progress=false && \
7+
npm config set depth 0 && \
8+
npm install
9+
10+
COPY ./config /app/config
11+
COPY ./public /app/public
12+
COPY ./src /app/src
13+
COPY ./test /app/test
14+
COPY ./*.js /app/
15+
16+
RUN npm run build
17+
RUN npm run test:components
18+
19+
FROM base as release
20+
21+
COPY --from=build /app/build /app/build
22+
COPY --from=build /app/config /app/config
23+
COPY --from=build /app/*.js* /app/
24+
25+
RUN npm install --only=prod
26+
27+
EXPOSE 5000
28+
CMD ["npm", "start"]

Dockerfile-tools

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ibmcom/ibmnode
2+
3+
ADD . /app
4+
5+
ENV NODE_ENV production
6+
ENV PORT 5000
7+
8+
EXPOSE 5000
9+
10+
WORKDIR /app
11+
12+
RUN npm install
13+
CMD ["/bin/bash"]
14+
15+
ARG bx_dev_user=root
16+
ARG bx_dev_userid=1000
17+
18+
RUN BX_DEV_USER=$bx_dev_user
19+
RUN BX_DEV_USERID=$bx_dev_userid
20+
RUN if [ "$bx_dev_user" != root ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi

0 commit comments

Comments
 (0)