Skip to content
Snippets Groups Projects
Commit f5b69426 authored by Yannis Barlas's avatar Yannis Barlas
Browse files

Merge branch 'faster-ci' into 'master'

Faster ci

Closes #82

See merge request xpub!84
parents 666deeb6 1805e189
No related branches found
No related tags found
No related merge requests found
variables:
DOCKER_DRIVER: overlay
IMAGE_NAME: xpub
BASE_DOMAIN: gateway.xpub.semioticsquares.com
CONFIGURATION_REPOSITORY: https://gitlab.coko.foundation/pubsweet/infra.git
......@@ -14,15 +13,12 @@ stages:
build:
image: docker:latest
services:
- docker:dind
stage: build
script:
- docker version
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build --pull -t $DOCKERHUB_USERNAME/$IMAGE_NAME .
- docker tag $DOCKERHUB_USERNAME/$IMAGE_NAME $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA
- docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker push $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA
lint:
......
FROM node:8.9-alpine
MAINTAINER PubSweet Team <richard@coko.foundation>
FROM xpub/xpub:base
ENV HOME "/home/xpub"
RUN mkdir -p ${HOME}
# git required for yarn. Why isn't it included!?
# the rest is for compiling leveldown
RUN apk add --no-cache --virtual .gyp \
python \
curl \
make \
g++ \
git
RUN git config --global user.email "test@testing.com" && \
git config --global user.name "Fakey McFakerson"
WORKDIR ${HOME}
COPY package.json yarn.lock lerna.json .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
COPY package.json yarn.lock ./
COPY lerna.json .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
COPY packages packages
RUN [ "yarn", "config", "set", "workspaces-experimental", "true" ]
# We do a development install because react-styleguidist is a dev dependency
RUN [ "yarn", "install", "--frozen-lockfile" ]
RUN [ "npm", "rebuild", "bcrypt", "--build-from-source=bcrypt"]
# Remove cache and offline mirror
RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"]
ENV NODE_ENV "production"
# We are temporarily going to use the same image with different commands to deploy different apps in the monorepo. This is bad :(.
WORKDIR ${HOME}/packages/xpub-collabra
# TODO pass in username and password as build arguments
RUN [ "npx", "pubsweet", "build"]
## No xpub-ui to deploy yet
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment