Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
refactor(oauth): combine oauth deps and package.json with auth
Browse files Browse the repository at this point in the history
Fixes #2748
  • Loading branch information
vladikoff committed Dec 13, 2018
1 parent 815a104 commit db8ed63
Show file tree
Hide file tree
Showing 17 changed files with 588 additions and 3,727 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Expand Up @@ -94,15 +94,11 @@ jobs:

- run:
name: Build deployment container image
command: cd fxa-oauth-server && docker build -f Dockerfile-build -t fxa-oauth-server:build .

- run:
name: Check npm install
command: cd fxa-oauth-server && docker run --rm -it fxa-oauth-server:build npm ls --production
command: docker build -f Dockerfile-oauth-build -t fxa-oauth-server:build .

- run:
name: Build test container image
command: cd fxa-oauth-server && docker build -f Dockerfile-test -t fxa-oauth-server:test .
command: docker build -f Dockerfile-oauth-test -t fxa-oauth-server:test .

- run:
name: Run MySQL
Expand All @@ -111,11 +107,11 @@ jobs:

- run:
name: Run Memory DB Tests
command: cd fxa-oauth-server && docker run fxa-oauth-server:test npm test
command: docker run fxa-oauth-server:test npm run test-oauth

- run:
name: Run MySQL DB Tests
command: cd fxa-oauth-server && docker run --net=host -p 3306:3306 -e DB="mysql" fxa-oauth-server:test npm test
command: docker run --net=host -p 3306:3306 -e DB="mysql" fxa-oauth-server:test npm run test-oauth

- run:
name: Push to Dockerhub
Expand Down
1 change: 0 additions & 1 deletion .dockerignore
@@ -1,2 +1 @@
.git
fxa-oauth-server
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -75,11 +75,11 @@ jobs:
node_js: 8
<<: *fxa-oauth-memory-test
install:
- cd fxa-oauth-server && npm ci && cd ..
script: cd fxa-oauth-server && npm test
- npm ci
script: npm run test-oauth
- stage:
node_js: 8
<<: *fxa-oauth-memory-test
install:
- cd fxa-oauth-server && npm ci && cd ..
script: cd fxa-oauth-server && npm test
- npm ci
script: npm run test-oauth
7 changes: 4 additions & 3 deletions fxa-oauth-server/Dockerfile-build → Dockerfile-oauth-build
Expand Up @@ -2,7 +2,7 @@ FROM node:8-alpine AS builder

RUN npm install -g npm@6 && rm -rf ~app/.npm /tmp/*

RUN apk add --no-cache git && \
RUN apk add --no-cache git linux-headers openssl && \
apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/community/ --no-cache --virtual .build-deps git python make g++

RUN addgroup -g 10001 app && \
Expand All @@ -18,7 +18,8 @@ USER app

COPY npm-shrinkwrap.json npm-shrinkwrap.json
COPY package.json package.json
COPY scripts/gen_keys.js scripts/gen_keys.js
COPY scripts/download_l10n.sh scripts/download_l10n.sh
COPY fxa-oauth-server/scripts/gen_keys.js fxa-oauth-server/scripts/gen_keys.js

RUN npm install --production && rm -rf ~app/.npm /tmp/*

Expand All @@ -30,7 +31,7 @@ FROM node:8-alpine

RUN npm install -g npm@6 && rm -rf ~app/.npm /tmp/*

RUN apk add --no-cache git
RUN apk add --no-cache git make gcc g++ linux-headers openssl python

RUN addgroup -g 10001 app && \
adduser -D -G app -h /app -u 10001 app
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile-oauth-test
@@ -0,0 +1,8 @@
FROM fxa-oauth-server:build

USER root
RUN rm -rf /app/node_modules
RUN rm -rf /app/fxa-content-server-l10n

USER app
RUN npm ci
1 change: 0 additions & 1 deletion fxa-oauth-server/.dockerignore

This file was deleted.

5 changes: 0 additions & 5 deletions fxa-oauth-server/Dockerfile-test

This file was deleted.

2 changes: 1 addition & 1 deletion fxa-oauth-server/lib/routes/root.js
Expand Up @@ -5,7 +5,7 @@
const exec = require('child_process').exec;
const path = require('path');

const version = require('../../package.json').version;
const version = require('../../../package.json').version;
var commitHash, source;

// See if config/version.json exists (part of rpm builds)
Expand Down

0 comments on commit db8ed63

Please sign in to comment.