Update element/Makefile, element/Dockerfile, .gitlab-ci.yml files

This commit is contained in:
Adrien le Maire 2021-05-04 09:34:02 +00:00
parent e909a33232
commit 8695a0eaa5
3 changed files with 32 additions and 4 deletions

View File

@ -7,16 +7,16 @@ variables:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
dev-minio: element:
stage: build stage: build
tags: tags:
- docker - docker
script: script:
- cd minio - cd element
- make nopush - make push
only: only:
variables: variables:
- $CI_COMMIT_REF_PROTECTED == "false" - $CI_COMMIT_REF_PROTECTED == "true"
changes: changes:
- minio/* - minio/*

8
element/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM nginx:alpine
COPY ./element /app
# Insert wasm type into Nginx mime.types file so they load correctly.
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types \
&& rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html

20
element/Makefile Normal file
View File

@ -0,0 +1,20 @@
NAMESPACE=alemairebe
IMAGE=element
VERSION=v1.7.26
push: get decompress build
get:
wget https://github.com/vector-im/element-web/releases/download/${VERSION}/element-${VERSION}.tar.gz
decompress:
tar -xf element-$(VERSION).tar.gz
mv element-$(VERSION) element
mv element/config.sample.json element/config.json
build:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm --push \
--cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--tag ${NAMESPACE}/${IMAGE}:$(VERSION) \
--tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) .