Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ctizen committed Apr 6, 2024
1 parent 1d0eef5 commit 9eb1985
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: Apply db migrations
run: make migrate

- name: Build all systems
run: make

- name: Run all tests
run: make e2e

Expand Down
8 changes: 4 additions & 4 deletions Fenrir/.env.docker
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
DB_URL=db:5432
MIMIR_URL=http://mimir
SIGRUN_URL=http://sigrun
SIGRUN_URL=http://sigrun:8080
HERMOD_URL=http://hermod
TYR_URL=http://tyr
TYR_URL=http://tyr:8080
FREY_URL=http://frey
FORSETI_URL=http://forseti
BRAGI_URL=http://bragi
FORSETI_URL=http://forseti:8080
BRAGI_URL=http://bragi:8080
GULLVEIG_URL=http://gullveig
SKIRNIR_URL=http://skirnir
27 changes: 0 additions & 27 deletions Fenrir/.github/workflows/playwright.yml

This file was deleted.

66 changes: 60 additions & 6 deletions Fenrir/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
FROM ghcr.io/mahjongpantheon/pantheon-frontend-common:latest
FROM ubuntu:22.04

ENV TIMEZONE Europe/Berlin
ENV PHP_MEMORY_LIMIT 512M
ENV LANG en_US.utf8
ENV YARN_CACHE_FOLDER /home/user/.yarn-cache
ENV COMPOSER_CACHE_DIR /home/user/.composer-cache

SHELL ["/bin/bash", "-c"]

RUN apt-get update && \
apt-get install -y tzdata && \
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
echo "${TIMEZONE}" > /etc/timezone \

# Install latest su-exec
RUN set -ex; \
\
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
\
fetch_deps='gcc libc-dev'; \
apt-get update; \
apt-get install -y --no-install-recommends $fetch_deps; \
gcc -Wall \
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
chown root:root /usr/local/bin/su-exec; \
chmod 0755 /usr/local/bin/su-exec; \
rm /usr/local/bin/su-exec.c; \
\
apt-get purge -y --auto-remove $fetch_deps

RUN apt-get install -y \
curl \
make \
procps \
net-tools \
findutils \
git \
nginx && \
(rm "/tmp/"* 2>/dev/null || true)

RUN curl -sL https://deb.nodesource.com/setup_20.x | bash ;\
apt-get update; \
apt-get install -y nodejs

RUN npm install -g yarn && chown -R root:root /usr/local/lib/node_modules/

# ------------ Local user init (for make & build tasks) --------
RUN useradd --user-group --system --create-home --no-log-init user

# Cleaning up
RUN mkdir /www && \
apt-get remove -y tzdata && \
rm -rf /var/lib/apt/lists/*

RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

ENV RUN_IN_DOCKER true

RUN echo "host_name fenrir" >> /etc/munin/munin-node.conf
RUN yarn global add @playwright/test
RUN HOME=/home/user su-exec user yarn run playwright install --with-deps

RUN ln -s /usr/lib/munin/plugins/processes /etc/munin/plugins/processes && \
ln -s /usr/lib/munin/plugins/proc_pri /etc/munin/plugins/proc_pri && \
ln -s /usr/lib/munin/plugins/threads /etc/munin/plugins/threads && \
ln -s /usr/lib/munin/plugins/vmstat /etc/munin/plugins/vmstat
RUN echo "host_name fenrir" >> /etc/munin/munin-node.conf

# copy entry point
COPY entrypoint.sh /entrypoint.sh
Expand Down
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,47 @@ prod_compile:
@echo "- ${YELLOW}Munin${NC} monitoring is exposed on port 4011"
@echo "- ${YELLOW}Skirnir${NC} is exposed on port 4015"

.PHONY: e2e_build_tyr
e2e_build_tyr: export NODE_ENV=development
e2e_build_tyr: # this is for automated builds, don't run it manually
cd Tyr && ${MAKE} docker_build && ${MAKE} docker_cleanup_prebuilts && ${MAKE} docker_prebuild

.PHONY: e2e_build_forseti
e2e_build_forseti: export NODE_ENV=development
e2e_build_forseti: # this is for automated builds, don't run it manually
cd Forseti && ${MAKE} docker_build && ${MAKE} docker_cleanup_prebuilts && ${MAKE} docker_prebuild

.PHONY: e2e_build_sigrun
e2e_build_sigrun: export NODE_ENV=development
e2e_build_sigrun: # this is for automated builds, don't run it manually
cd Sigrun && ${MAKE} docker_deps && ${MAKE} docker_build && ${MAKE} docker_cleanup_prebuilts && ${MAKE} docker_prebuild && ${MAKE} docker_e2e_deps

.PHONY: e2e_build_bragi
e2e_build_bragi: export NODE_ENV=development
e2e_build_bragi: # this is for automated builds, don't run it manually
cd Bragi && ${MAKE} docker_deps && ${MAKE} docker_build && ${MAKE} docker_cleanup_prebuilts && ${MAKE} docker_prebuild && ${MAKE} docker_e2e_deps

.PHONY: e2e_build_skirnir
e2e_build_skirnir: export NODE_ENV=development
e2e_build_skirnir: # this is for automated builds, don't run it manually
cd Skirnir && ${MAKE} docker_deps && ${MAKE} docker_build && ${MAKE} docker_prebuild && ${MAKE} docker_prod_deps && ${MAKE} docker_reload_pm2

.PHONY: e2e_compile
e2e_compile: export ENV_FILENAME=.env.development
e2e_compile:
@cp Env/.env.development Tyr/.env.development
@cp Env/.env.development Sigrun/.env.development
@cp Env/.env.development Forseti/.env.development
@cp Env/.env.development Bragi/.env.development
@cp Env/.env.development Skirnir/.env.development
${MAKE} deps
${MAKE} migrate
${MAKE} e2e_build_tyr
${MAKE} e2e_build_forseti
${MAKE} e2e_build_sigrun && cd Sigrun && ${MAKE} docker_reload_pm2
${MAKE} e2e_build_bragi && cd Bragi && ${MAKE} docker_reload_pm2
${MAKE} e2e_build_skirnir && cd Skirnir && ${MAKE} docker_reload_pm2

.PHONY: prod_start
prod_start: export ENV_FILENAME=.env.production
prod_start:
Expand Down
2 changes: 1 addition & 1 deletion Tyr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

export HOME=/home/user
cat /env/"$ENV_FILENAME" | grep -v '# ' | grep -v -e '^$' | awk '{ print "export " $1 }' > /etc/profile.d/external.sh
Expand Down

0 comments on commit 9eb1985

Please sign in to comment.