fix: replace `npm install` by `npm ci` to get deterministic builds (#54)
* fix: replace `npm install` by `npm ci` to get deterministic builds * no need to upgrade npm in the Makefile, npm ci already existing in node 10 image * use postgresql version 10 in docker-compose for tests like the 'produplink' database currently used in production
This commit is contained in:
parent
746f37ce58
commit
3a9d66c648
|
@ -1,11 +1,14 @@
|
||||||
FROM node:9 as builder
|
FROM node:9 as builder
|
||||||
|
|
||||||
|
RUN npm install --global npm@5.7.0 && \
|
||||||
|
npm version
|
||||||
|
|
||||||
ARG APP_DIR=/srv/uplink
|
ARG APP_DIR=/srv/uplink
|
||||||
WORKDIR ${APP_DIR}
|
WORKDIR ${APP_DIR}
|
||||||
|
|
||||||
COPY package*json ${APP_DIR}/
|
COPY package*json ${APP_DIR}/
|
||||||
|
|
||||||
RUN npm install
|
RUN npm ci
|
||||||
|
|
||||||
# Doing a multi-stage build to reset some stuff for a smaller image
|
# Doing a multi-stage build to reset some stuff for a smaller image
|
||||||
FROM node:9-alpine
|
FROM node:9-alpine
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -30,7 +30,7 @@ version:
|
||||||
npm version
|
npm version
|
||||||
|
|
||||||
depends: version package.json package-lock.json ## Install node dependencies
|
depends: version package.json package-lock.json ## Install node dependencies
|
||||||
if [ ! -d node_modules ]; then npm install; fi;
|
if [ ! -d node_modules ]; then npm ci; fi;
|
||||||
|
|
||||||
build: depends ## Compile TypeScript
|
build: depends ## Compile TypeScript
|
||||||
$(TSC)
|
$(TSC)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:alpine
|
image: postgres:10-alpine
|
||||||
environment:
|
environment:
|
||||||
- 'POSTGRES_PASSWORD=jenkinsuplink'
|
- 'POSTGRES_PASSWORD=jenkinsuplink'
|
||||||
# Used for psql non-interactive scripting
|
# Used for psql non-interactive scripting
|
||||||
|
|
Loading…
Reference in New Issue