Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b95275f6 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch 'dev/fix-duplicate-results' into 'master'

Exclude duplicate build in entrypoint rsync

See merge request e/documentation/user!948
parents b03ca42d 150b150f
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -36,9 +36,6 @@ default:
    - docker build --pull -t "$CI_REGISTRY_IMAGE/jekyll:$IMAGE_TAG" -f Dockerfile.jekyll htdocs
    - docker push "$CI_REGISTRY_IMAGE/jekyll:$IMAGE_TAG"

    - docker build --pull -t "$CI_REGISTRY_IMAGE/nginx:$IMAGE_TAG" -f Dockerfile.nginx htdocs
    - docker push "$CI_REGISTRY_IMAGE/nginx:$IMAGE_TAG"

deep-build:branch:
  extends: .deep-build:docker
  rules:
@@ -79,16 +76,6 @@ jekyll_container_scanner:
  variables:
    DOCKER_IMAGE: $CI_REGISTRY_IMAGE/jekyll:$CI_COMMIT_REF_SLUG

nginx_container_scanner:
  extends: container_scanning
  variables:
    DOCKER_IMAGE: $CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_REF_SLUG

ubuntu_container_scanner:
  extends: container_scanning
  variables:
    DOCKER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu:$CI_COMMIT_REF_SLUG

# Deploy stage
.deploy:compose:
  stage: deploy
+10 −7
Original line number Diff line number Diff line
ARG IMAGE_TAG=master
FROM registry.gitlab.e.foundation:5000/e/documentation/user/jekyll:$IMAGE_TAG AS jekyll
FROM registry.gitlab.e.foundation/e/documentation/user/jekyll:$IMAGE_TAG AS jekyll

COPY . /tmp
RUN date > /tmp/build_date
RUN jekyll build -d /tmp/e_docs_website && rm /tmp/Gemfile*

FROM ubuntu:22.04 AS ubuntu
COPY --from=jekyll /tmp/e_docs_website/ /tmp/e_docs_website/
RUN apt-get update && apt-get install minify -y
RUN minify -r -o /tmp/e_docs_website/ /tmp/e_docs_website/
# Fixme: Minify is generating unexpected output, and not even working in prod currently
#FROM ubuntu:22.04 AS ubuntu
#COPY --from=jekyll /tmp/e_docs_website/ /tmp/e_docs_website/
#RUN apt-get update && apt-get install minify -y
#RUN minify -r -o /tmp/e_docs_website_minified/assets/ /tmp/e_docs_website/assets/

FROM registry.gitlab.e.foundation:5000/e/documentation/user/nginx:$IMAGE_TAG
COPY --chown=www-data:www-data --from=ubuntu /tmp/e_docs_website/ /tmp/e_docs_website/
FROM nginx:stable
COPY ./config/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./config/nginx/conf.d /etc/nginx/conf.d
COPY --chown=www-data:www-data --from=jekyll /tmp/e_docs_website/ /usr/share/nginx/html/

Dockerfile.nginx

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
FROM nginx:stable
LABEL maintainer="dev@murena.io"
RUN apt-get -y update
RUN apt-get -y install rsync

COPY ./config/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./config/nginx/conf.d /etc/nginx/conf.d

COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod +x entrypoint.sh

ENTRYPOINT [ "./entrypoint.sh" ]
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ docker run \
-p 4000:4000 \
-p 35729:35729 \
-it \
jekyll/jekyll:4.2.0 \
jekyll/jekyll:stable \
jekyll serve --profile --livereload
```

@@ -25,7 +25,7 @@ Note: the port 35729 is used for live reload
Or you could use:

```bash
docker run --rm --volume="$PWD/htdocs:/srv/jekyll" -p 4000:4000 -it jekyll/jekyll:4.2.0 jekyll serve
docker run --rm --volume="$PWD/htdocs:/srv/jekyll" -p 4000:4000 -it jekyll/jekyll:stable jekyll serve
```

## Full compose stack (search)

htdocs/entrypoint.sh

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
#!/bin/bash
rsync -rlDog --delete --exclude .gitignore /tmp/e_docs_website/ /usr/share/nginx/html/
nginx -g "daemon off;"
 No newline at end of file
+2 −2

File changed.

Contains only whitespace changes.

Loading