Skip to content

Commit

Permalink
build: add build of gapit image
Browse files Browse the repository at this point in the history
  • Loading branch information
sbgap committed Apr 23, 2024
1 parent 2fd9c92 commit 0e160dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/gapit_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
BUILD_NUMBER=$BUILD_NUMBER
VERSION=${{ github.ref_name }}
VCS_REF=${{ github.sha }}
34 changes: 9 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
FROM node:16-alpine as build-stage

ADD https://github.com/gapitio/alerta-webui/archive/refs/heads/gapit_notifications.tar.gz /tmp/webui.tar.gz
RUN apk add --no-cache git==2.40.1-r0
RUN tar zxvf /tmp/webui.tar.gz -C /tmp
WORKDIR /tmp/alerta-webui-gapit_notifications
RUN npm install && \
npm run build --fix && \
mv dist /web


FROM python:3.9-slim-buster as production-stage
WORKDIR /
COPY --from=build-stage /web /web


ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1

ARG BUILD_NUMBER
ARG BUILD_DATE
ARG RELEASE
ARG VCS_REF
ARG VERSION

ENV SERVER_VERSION=8.5.0
ENV SERVER_VERSION=1.5.0
ENV CLIENT_VERSION=8.5.0
ENV WEBUI_VERSION=8.5.0
ENV WEBUI_VERSION=1.5.0

ENV NGINX_WORKER_PROCESSES=1
ENV NGINX_WORKER_CONNECTIONS=1024
Expand Down Expand Up @@ -102,24 +91,19 @@ ENV PATH $PATH:/venv/bin
ADD https://github.com/gapitio/python-alerta-client/archive/refs/heads/gapit.tar.gz /tmp/client/client.tar.gz
RUN tar zxvf /tmp/client/client.tar.gz -C /tmp/client/ && \
/venv/bin/pip install /tmp/client/python-alerta-client-gapit/.
# RUN /venv/bin/pip install alerta==${CLIENT_VERSION}
# ADD https://github.com/gapitio/alerta/releases/download/v${SERVER_VERSION}}/alerta.tar.gz /tmp/backend/alerta.tar.gz
ADD https://github.com/gapitio/alerta/archive/refs/heads/gapit_notification.tar.gz /tmp/backend/alerta.tar.gz
ADD https://github.com/gapitio/alerta/releases/download//v${SERVER_VERSION}/alerta-api.tar.gz /tmp/backend/alerta.tar.gz
RUN tar zxvf /tmp/backend/alerta.tar.gz -C /tmp/backend && \
/venv/bin/pip install /tmp/backend/alerta-gapit_notification/.
find tmp/backend/dist -name "*-py2.py3-none-any.whl" | xargs -I{} /venv/bin/pip install {}
COPY install-plugins.sh /app/install-plugins.sh
COPY plugins.txt /app/plugins.txt
RUN /app/install-plugins.sh

ENV ALERTA_SVR_CONF_FILE /app/alertad.conf
ENV ALERTA_CONF_FILE /app/alerta.conf

# # ADD https://github.com/alerta/alerta-webui/releases/download/v${WEBUI_VERSION}/alerta-webui.tar.gz /tmp/webui.tar.gz
# ADD https://github.com/gapitio/alerta-webui/archive/refs/heads/gapit_notification.tar.gz /tmp/webui.tar.gz
# RUN tar zxvf /tmp/webui.tar.gz -C /tmp && \
# cd /tmp/alerta-webui-gapit_notification && \
# npm run build && \
# mv /tmp/alerta-webui-gapit_notification/dist /web
ADD https://github.com/gapitio/alerta-webui/releases/download/v${WEBUI_VERSION}/alerta-webui.tar.gz /tmp/webui.tar.gz
RUN tar zxvf /tmp/webui.tar.gz -C /tmp && \
mv /tmp/dist /web

ENV ALERTA_SVR_CONF_FILE /app/alertad.conf
ENV ALERTA_CONF_FILE /app/alerta.conf
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bcrypt==4.1.2
blinker==1.7.0
cryptography==42.0.5
Flask==3.0.2
Flask==3.0.3
Flask-Compress==1.14
Flask-Cors==4.0.0
mohawk==1.1.0
Expand All @@ -10,14 +10,14 @@ PyJWT==2.8.0
pymongo==4.4.1
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-http-client==3.2.1
pytz==2024.1
PyYAML==6.0.1
requests==2.31.0
requests_hawk==1.2.1
sentry-sdk[flask]==1.43.0
StrEnum==0.4.15
werkzeug==3.0.1
sendgrid==6.5.0
python-http-client==3.2.1
sentry-sdk[flask]==1.45.0
starkbank-ecdsa==1.0.0
StrEnum==0.4.15
twilio==7.0.0
werkzeug==3.0.2

0 comments on commit 0e160dc

Please sign in to comment.