-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
80 additions
and
27 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
dist: trusty | ||
language: node_js | ||
node_js: | ||
- '8' | ||
sudo: required | ||
before_install: | ||
- if [[ `npm -v` != 6* ]]; then npm i -g npm@6; fi | ||
install: | ||
- npm install | ||
- echo $COVERALLS_TOKEN >> .coveralls.yml | ||
script: | ||
- npm run lint | ||
- npm run test | ||
- npm run coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage | ||
language: node_js | ||
node_js: "8" | ||
|
||
jobs: | ||
include: | ||
- stage: Lint | ||
script: npm run lint | ||
- stage: Test | ||
- stage: Coverage | ||
script: npm run coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage | ||
- stage: Build and push Docker images | ||
install: skip | ||
script: skip | ||
services: | ||
- docker | ||
before_install: | ||
- docker build -t tomochain/tomomaster . | ||
deploy: | ||
provider: script | ||
script: bash docker_push.sh | ||
on: | ||
branch: master | ||
- stage: Trigger rebuild of infrastructure images | ||
sudo: false | ||
install: skip | ||
script: bash docker_rebuild.sh | ||
|
||
stages: | ||
- name: Build and push Docker images | ||
if: type != pull_request AND branch = master | ||
- name: Trigger rebuild of infrastructure images | ||
if: type != pull_request AND branch = master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
FROM node:8 | ||
FROM node:8-alpine | ||
|
||
WORKDIR /build | ||
LABEL maintainer="etienne@tomochain.com" | ||
|
||
RUN npm install -g pm2 | ||
COPY ./package.json /build | ||
COPY ./package-lock.json /build | ||
RUN npm install | ||
COPY ./ /build | ||
RUN npm run build && rm -rf /build/node_modules | ||
ENV HOST 0.0.0.0 | ||
|
||
RUN npm install --production | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN apk --no-cache --virtual deps add \ | ||
python \ | ||
make \ | ||
g++ \ | ||
bash \ | ||
git \ | ||
&& npm install -g pm2 truffle \ | ||
&& npm install \ | ||
&& truffle deploy \ | ||
&& npm run build \ | ||
&& rm -rf node_modules \ | ||
&& npm install --production \ | ||
&& apk del deps | ||
|
||
RUN chmod +x ./entrypoint.sh | ||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:8 | ||
|
||
WORKDIR /build | ||
|
||
RUN npm install -g pm2 | ||
COPY ./package.json /build | ||
COPY ./package-lock.json /build | ||
RUN npm install | ||
COPY ./ /build | ||
RUN npm run build && rm -rf /build/node_modules | ||
|
||
RUN npm install --production | ||
|
||
RUN chmod +x ./entrypoint.sh | ||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin | ||
docker tag tomochain/tomomaster tomochain/tomomaster:latest | ||
docker tag tomochain/tomomaster tomochain/tomomaster:$TRAVIS_BUILD_ID | ||
docker push tomochain/tomomaster:latest | ||
docker push tomochain/tomomaster:$TRAVIS_BUILD_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
curl -X POST $INFRA_IMAGE_REBUILD_HOOK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
|
||
echo "Generating Configuration File ..." | ||
cp /build/config/default.json /build/config/local.json | ||
cp ./config/default.json ./config/local.json | ||
|
||
pm2 start -x ./services/crawl.js | ||
pm2 start -x --no-daemon index.js |