Skip to content

Commit

Permalink
Integration test setup for uploading/processing
Browse files Browse the repository at this point in the history
This is a significant change to how the app is setup.

Config has been strictly refactored. Striving for all ENV in .env and
accessing all config through values set in config.js.

I suspect the build process had become unfocussed overtime so I've
attempted to somewhat start from scratch.

There is now a simpler Dockerfile and docker-compose setup and
LocalOAM has been removed. There is now no test-specific code in the
codebase.

Includes a single test that runs against the dockerised API, uploads
some imagery and waits for it to be processed.
  • Loading branch information
tombh committed Jun 9, 2017
1 parent 9010033 commit c9614e4
Show file tree
Hide file tree
Showing 50 changed files with 304 additions and 839 deletions.
8 changes: 0 additions & 8 deletions .build_scripts/deploy.conf

This file was deleted.

54 changes: 0 additions & 54 deletions .build_scripts/docker/run.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .build_scripts/docker/start.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .build_scripts/docker/test.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .build_scripts/post-deploy.sh

This file was deleted.

45 changes: 0 additions & 45 deletions .build_scripts/reset-db.js

This file was deleted.

30 changes: 0 additions & 30 deletions .build_scripts/upstart.conf

This file was deleted.

1 change: 1 addition & 0 deletions .dockerignore
@@ -1,3 +1,4 @@
Dockerfile
node_modules
newrelic_agent.log
npm-debug.log
Expand Down
40 changes: 38 additions & 2 deletions .env.sample
@@ -1,2 +1,38 @@
LOCALOAM_VOLUME=~/hotosm/data
HOST_PREFIX=http://localhost:4999
# Environment variables.
#
# * This is a canonical refrence. *All* ENV vars needed in *all*
# environments should be placed here.
# * A `.env` is a requirement of *all* environments, including tests.
# * Copy `.env.sample` to `.env` for it to be automatically sourced.
# * See /config.js for individual explanations of each variable.
# * Dont use "" quotes

# API
PORT=4000
HOST=0.0.0.0
COOKIE_PASSWORD=123abc
DB_URI=mongodb://localhost:27017/oam-api

# OAM-specific
# OAM_DEBUG=true|false should be used on the command line
OIN_REGISTER_URL=http://localhost:8080/catalog/fixtures/oin-buckets-testing.json
OIN_BUCKET=oin-hotosm-staging
UPLOAD_BUCKET=oam-uploader-staging-temp
# Run quickly like this only for non-production
CRON_TIME=* * * * *
GDRIVE_KEY=abc123
MAX_WORKERS=1
TILER_BASE_URL=http://tiles.openaerialmap.org

# Third party
NEW_RELIC_LICENSE_KEY=123abc
SENDGRID_API_KEY=123
SENDGRID_FROM=info@hotosm.org
AWS_ACCESS_KEY_ID=123
AWS_SECRET_ACCESS_KEY=abc
AWS_REGION=us-east-1

# To be deprecated
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
SECRET_TOKEN=insecuretoken
3 changes: 2 additions & 1 deletion .eslintrc
@@ -1,7 +1,8 @@
{
"extends": ["standard", "standard-react"],
"env": {
"es6": true
"es6": true,
"mocha": true
},
"rules": {
"semi": [2, "always"],
Expand Down
29 changes: 3 additions & 26 deletions Dockerfile
@@ -1,34 +1,11 @@
FROM quay.io/hotosm/oam-dynamic-tiler-tools
ENV NPM_CONFIG_LOGLEVEL warn

# Install app dependencies
ADD package.json /tmp/package.json
RUN cd /tmp && npm install

# Create app directory
RUN mkdir -p /usr/src/app && cp -a /tmp/node_modules /usr/src/app
WORKDIR /usr/src/app

# Bundle app source
ADD . /usr/src/app

# Go ahead and install nodemon for convenience while developing
RUN \
npm install -g nodemon \
&& rm -rf /root/.npm

# Set TMPDIR environment variable
ENV TMPDIR /tmp

RUN mkdir -p /app
COPY . /app

WORKDIR /app

RUN \
npm install \
&& rm -rf /root/.npm
RUN npm install

EXPOSE 4000

CMD [ "node", "index.js" ]

CMD ["./node_modules/.bin/nf", "start"]
1 change: 1 addition & 0 deletions Procfile
@@ -1 +1,2 @@
web: node index.js
worker: node catalog-worker.js

0 comments on commit c9614e4

Please sign in to comment.