Merge pull request #22 from Human-Connection/travis-ci-build

Travis ci build
This commit is contained in:
Grzegorz Leoniec 2018-11-30 09:54:31 +01:00 committed by GitHub
commit 3760ffad59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 7 deletions

31
.travis.yml Normal file
View File

@ -0,0 +1,31 @@
language: node_js
node_js:
- "10"
services:
- docker
cache:
yarn: true
directories:
- node_modules
install:
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT -t humanconnection/nitro-backend .
script:
# TODO: re-add when testing is setup properly
# - docker run humanconnection/nitro-backend yarn run db:seed
after_success:
# - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
# - chmod +x send.sh
# - ./send.sh success $WEBHOOK_URL
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker tag humanconnection/nitro-backend humanconnection/nitro-backend:latest;
docker push humanconnection/nitro-backend:latest;
fi
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL

View File

@ -1,18 +1,19 @@
FROM node:10-alpine
LABEL Description="Server part of the social network Human Connection" Vendor="Human-Connection gGmbH" Version="0.0.1" Maintainer="Human-Connection gGmbH (developer@human-connection.org)"
LABEL Description="Backend of the Social Network Human-Connection.org" Vendor="Human Connection gGmbH" Version="0.0.1" Maintainer="Human Connection gGmbH (developer@human-connection.org)"
# expose the app port
# Expose the app port
EXPOSE 4000
ARG WORKDIR=/backend
ARG WORKDIR=/nitro-backend
RUN mkdir -p $WORKDIR
WORKDIR $WORKDIR
# Install the Application Dependencies
COPY package.json .
COPY yarn.lock .
RUN yarn install --production=false --frozen-lockfile --non-interactive
COPY . .
COPY .env.template .env
CMD ["yarn", "run", "start"]

View File

@ -2,7 +2,7 @@ version: "3.7"
services:
backend:
image: humanconnection/backend:latest
image: humanconnection/nitro-backend:latest
build: .
networks:
- hc-network

View File

@ -31,7 +31,7 @@ spec:
value: "false"
- name: NEO4J_URI
value: bolt://neo4j:7687
image: humanconnection/backend:latest
image: humanconnection/nitro-backend:latest
name: backend
ports:
- containerPort: 4000

View File

@ -4,7 +4,7 @@
"description": "GraphQL Backend for Human Connection",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Error: no test specified\" && exit 0",
"start": "./node_modules/.bin/nodemon --exec babel-node src/index.js",
"start:debug": "./node_modules/.bin/nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
"db:seed": "concurrently --kill-others --success first 'cross-env GRAPHQL_URI=http://localhost:4001 PERMISSIONS=disabled GRAPHQL_PORT=4001 yarn run start' 'wait-on tcp:4001 && cross-env GRAPHQL_URI=http://localhost:4001 ./node_modules/.bin/babel-node src/seed/seed-db.js'"