Skip to content

Commit

Permalink
Merge branch 'beta' into 'main'
Browse files Browse the repository at this point in the history
Revert "Merge branch...

See merge request voltaire/govtool-outcomes-pillar!27
  • Loading branch information
Emmanuel-Tyty committed Feb 7, 2025
2 parents 03e7212 + 9abd178 commit 2fb8598
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ build_govtool:
echo "Building Dockerfile with tags $CI_APPLICATION_REPOSITORY/govtool:$CI_APPLICATION_TAG and $CI_APPLICATION_REPOSITORY/govtool:latest ..."
docker build --network host -f Dockerfile.govtool \
--build-arg CARDANO_NETWORK="$CARDANO_NETWORK" \
-t "$CI_APPLICATION_REPOSITORY/govtool:$CI_APPLICATION_TAG" \
-t "$CI_APPLICATION_REPOSITORY/govtool:latest" .
docker push "$CI_APPLICATION_REPOSITORY/govtool:$CI_APPLICATION_TAG"
Expand Down Expand Up @@ -196,3 +197,15 @@ outcomes_mainnet_backend:
name: mainnet
url: https://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
when: manual

outcomes_mainnet_govtool:
<<: *outcomes_govtool_deployment
stage: mainnet
rules:
- if: $CI_COMMIT_BRANCH == "beta" || $CI_COMMIT_BRANCH == "main"
environment:
name: mainnet
url: https://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
when: manual


22 changes: 21 additions & 1 deletion Dockerfile.govtool
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ FROM node:22-alpine AS base

RUN apk add --no-cache git bash

ARG CARDANO_NETWORK=preview

ENV CARDANO_NETWORK=${CARDANO_NETWORK}

WORKDIR /app

RUN git clone https://github.com/IntersectMBO/govtool.git /app
Expand All @@ -10,11 +14,27 @@ WORKDIR /app/govtool/frontend

RUN yarn install

COPY ./ui/dist /app/govtool/frontend/node_modules/@intersect.mbo/govtool-outcomes-pillar-ui/dist
COPY ./ui/dist /app/govtool/frontend/ui/dist

# Conditionally install the package or copy UI files
RUN if [ "$CARDANO_NETWORK" = "mainnet" ]; then \
echo "Installing latest @intersect.mbo/govtool-outcomes-pillar-ui via yarn..."; \
yarn cache clean; \
yarn add @intersect.mbo/govtool-outcomes-pillar-ui@latest; \
else \
echo "Copying UI files for non-mainnet environment..."; \
cp -r /app/govtool/frontend/ui/dist /app/govtool/frontend/node_modules/@intersect.mbo/govtool-outcomes-pillar-ui/dist; \
fi

# Copy environment variables and build the project
RUN cp .env.example .env

RUN if [ "$CARDANO_NETWORK" = "mainnet" ]; then \
sed -i 's/^VITE_NETWORK_FLAG=.*/VITE_NETWORK_FLAG=1/' .env; \
else \
sed -i 's/^VITE_NETWORK_FLAG=.*/VITE_NETWORK_FLAG=0/' .env; \
fi

RUN yarn build

# ---- Production Stage ----
Expand Down

0 comments on commit 2fb8598

Please sign in to comment.