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/xpub!84
parents 666deeb6 1805e189
No related branches found
No related tags found
No related merge requests found
variables: variables:
DOCKER_DRIVER: overlay
IMAGE_NAME: xpub IMAGE_NAME: xpub
BASE_DOMAIN: gateway.xpub.semioticsquares.com BASE_DOMAIN: gateway.xpub.semioticsquares.com
CONFIGURATION_REPOSITORY: https://gitlab.coko.foundation/pubsweet/infra.git CONFIGURATION_REPOSITORY: https://gitlab.coko.foundation/pubsweet/infra.git
...@@ -14,15 +13,12 @@ stages: ...@@ -14,15 +13,12 @@ stages:
build: build:
image: docker:latest image: docker:latest
services:
- docker:dind
stage: build stage: build
script: script:
- docker version - docker version
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device" - echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build --pull -t $DOCKERHUB_USERNAME/$IMAGE_NAME . - docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker tag $DOCKERHUB_USERNAME/$IMAGE_NAME $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA
- docker push $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA - docker push $DOCKERHUB_USERNAME/$IMAGE_NAME:$CI_COMMIT_SHA
lint: lint:
......
FROM node:8.9-alpine FROM xpub/xpub:base
MAINTAINER PubSweet Team <richard@coko.foundation>
ENV HOME "/home/xpub" COPY package.json yarn.lock ./
COPY lerna.json .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
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 packages packages COPY packages packages
RUN [ "yarn", "config", "set", "workspaces-experimental", "true" ] RUN [ "yarn", "config", "set", "workspaces-experimental", "true" ]
# We do a development install because react-styleguidist is a dev dependency # We do a development install because react-styleguidist is a dev dependency
RUN [ "yarn", "install", "--frozen-lockfile" ] 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" 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 :(. # 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 WORKDIR ${HOME}/packages/xpub-collabra
# TODO pass in username and password as build arguments
RUN [ "npx", "pubsweet", "build"] RUN [ "npx", "pubsweet", "build"]
## No xpub-ui to deploy yet ## 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