Add docker image for puppeteer script

This commit is contained in:
Tulir Asokan 2020-08-24 15:23:10 +03:00
parent 814c8cbdb3
commit 57a5ee8164
2 changed files with 21 additions and 0 deletions

View File

@ -9,3 +9,16 @@ build:
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- if [ $CI_COMMIT_BRANCH == "master" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest && docker push $CI_REGISTRY_IMAGE:latest; fi - if [ $CI_COMMIT_BRANCH == "master" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest && docker push $CI_REGISTRY_IMAGE:latest; fi
- if [ $CI_COMMIT_BRANCH != "master" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME && docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME; fi - if [ $CI_COMMIT_BRANCH != "master" ]; then docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME && docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME; fi
build puppeteer:
stage: build
image: docker:latest
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd puppet
- docker pull $CI_REGISTRY_IMAGE/puppeteer:latest || true
- docker build --pull --cache-from $CI_REGISTRY_IMAGE/puppeteer:latest --tag $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_SHA .
- docker push $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_SHA
- if [ $CI_COMMIT_BRANCH == "master" ]; then docker tag $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE/puppeteer:latest && docker push $CI_REGISTRY_IMAGE/puppeteer:latest; fi
- if [ $CI_COMMIT_BRANCH != "master" ]; then docker tag $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_REF_NAME && docker push $CI_REGISTRY_IMAGE/puppeteer:$CI_COMMIT_REF_NAME; fi

8
puppet/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM node:lts-alpine AS builder
WORKDIR /opt/mautrix-amp/puppet
COPY package.json yarn.lock ./
RUN yarn --production
COPY . /opt/mautrix-amp/puppet
CMD ["yarn", "start", "/data/config.json"]