Skip to content

Commit

Permalink
Merge pull request #143 from dappnode/v0.1.17
Browse files Browse the repository at this point in the history
v0.1.17

Former-commit-id: 528d466
  • Loading branch information
eduadiez authored Dec 19, 2018
2 parents 3342ff8 + af35f78 commit b6815d3
Show file tree
Hide file tree
Showing 121 changed files with 5,055 additions and 1,129 deletions.
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/build/src/node_modules/
/build/src/tmp_dnp_repo/
/build/src/dnp_repo/
/build/src/DNCORE/
/build/src/cache/
/build/src/undefined/
/build/src/test_files/
/build/src/test_files/*
build/src/node_modules/
build/src/tmp_dnp_repo/
build/src/dnp_repo/
build/src/DNCORE/
build/src/cache/
build/src/undefined/
build/src/test_files/
build/src/test_files/*
build/src/dappmanagerdb.json
.DS_Store
.nyc_output
build_*
Expand Down
122 changes: 93 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,99 @@ language: node_js
dist: trusty
sudo: required

# Test envs will overwrite defaults
env:
- DAPPNODE=rocks
jobs:
include:
# In app tests
##############
- stage: test
env:
- IN_APP_TEST
node_js:
- "8.9.4"
cache:
directories:
- build/src/node_modules
install:
# This is a dockerized application, the node app is in /build/src
- cd ./build/src
- npm install
before_script:
- npm run lint
script:
- npm test -- --coverage # Include coverage when running tests
after_success: # Upload coverage reports
- COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coveralls

node_js:
- "8.9.4"
# integration tests
###################
- stage: test
env:
- INTEGRATION_TEST
node_js:
- "8.9.4"
services:
- docker
before_script:
- chmod +x test/before_install.sh
- chmod +x test/test_integration.sh
- test/before_install.sh
script:
- test/test_integration.sh

sudo: required

services:
- docker

before_install:
- chmod +x test/before_install.sh
- chmod +x test/test_integration.sh
- test/before_install.sh
# Test that it builds correctly
###############################
- stage: build test
services:
- docker
script:
- docker-compose -f "$(find . -maxdepth 1 -name "docker-compose*")" build

cache:
directories:
- build/src/node_modules
install:
# This is a dockerized application, the node app is in /build/src
- cd ./build/src
- npm install
before_script:
- npm run lint
script:
- npm run test
- cd ../..
- test/test_integration.sh
after_success:
- COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coverage
# Deploy stage, all code below is common between DAppNode packages
##################################################################
- stage: release
services:
- docker
script: skip
node_js: lts/*
before_deploy:
# Run the dappnodesdk
- travis_retry npm install -g @dappnode/dappnodesdk
- export TRAVIS_TAG=$(IPFS_PROVIDER=ipfs.infura.io IPFS_PROTO=https PROVIDER=wss://mainnet.infura.io/ws dappnodesdk next patch)
- echo "NEXT TRAVIS_TAG $TRAVIS_TAG"
- IPFS_PROVIDER=ipfs.infura.io IPFS_PROTO=https PROVIDER=wss://mainnet.infura.io/ws SILENT=true dappnodesdk publish patch
# Set up git user name
- git config --global user.email "[email protected]"
- git config --global user.name "dappnode"
# Correct origin to push new branch
- git remote rm origin
- git remote add origin https://user:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
# Check if the tag exists, if so delete it
- if [ $(git tag -l "$TRAVIS_TAG") ]; then export DELETE_TAG=true ; fi
- if [ $DELETE_TAG ]; then git push --delete origin $TRAVIS_TAG || echo "Error deleting tag from origin" ; fi
- if [ $DELETE_TAG ]; then git tag --delete $TRAVIS_TAG || echo "Error deleting tag locally" ; fi
# Tag this commit
- git tag $TRAVIS_TAG
# Return to master.
- git checkout master
deploy:
provider: releases
prerelease: true
overwrite: true
api_key: "$GITHUB_TOKEN"
file_glob: true
file: build_${TRAVIS_TAG}/*
skip_cleanup: true
name: "v$TRAVIS_TAG"
body: "# Changelog"
on:
branch: master
after_deploy:
echo "Successfully released"
# - export GIT_BRANCH="master"
# - bash github_release_script.sh
# - echo "FINAL AFTER RELEASE SCRIPT"
# - echo "$(Date)" > a.text
# - git add .
# - git commit -m "message"
# - git checkout -b "v0.1.15"
# - git push origin "v0.1.15"
8 changes: 7 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ RUN apk add --no-cache git python build-base bind-tools docker bash

WORKDIR /usr/src/app

# Install app dependencies to use docker's layer cache
ADD src/package*.json ./
RUN npm install --production

ADD src .
ADD entrypoint.sh .
ADD dns_updater.sh .

RUN npm install --production


# This results in a single layer image
FROM node:8.9.4-alpine
Expand Down Expand Up @@ -63,4 +67,6 @@ COPY ./dns_updater.sh /etc/periodic/1min/dns_updater
RUN chmod +x /etc/periodic/1min/dns_updater
RUN crontab -l | { cat; echo "* * * * * run-parts /etc/periodic/1min"; } | crontab -

ENV DB_PATH /usr/src/app/DNCORE/dappmanagerdb.json

ENTRYPOINT /usr/src/app/entrypoint.sh
7 changes: 4 additions & 3 deletions build/src/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"extends": ["eslint:recommended", "google"],
"parserOptions": {
"ecmaVersion": 2017,
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"env": {
"node": true,
"mocha": true
"mocha": true,
"es6": true
},
"rules": {
"brace-style": "off",
"no-tabs": "off",
"max-len": ["error", 100],
"max-len": ["error", 1000],
"require-jsdoc": [
"error",
{
Expand Down
Loading

0 comments on commit b6815d3

Please sign in to comment.