Skip to content

Commit

Permalink
feat: add version to explorer-ui (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipHarald authored Dec 13, 2024
1 parent b8c1565 commit f81600e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions k8s/local/explorer-ui/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ build:
VITE_DISCORD_URL: "https://discord.gg/obscura-network"
VITE_X_URL: "https://x.com/Obscura_Network"
VITE_GITHUB_URL: "https://github.com/aztlan-labs/chicmoz"
VITE_VERSION_STRING: "{{.VERSION_STRING}}"
requires:
- image: chicmoz-base
alias: BASE
2 changes: 1 addition & 1 deletion scripts/production/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

skaffold run --filename "k8s/production/skaffold.production.light.yaml" --default-repo=registry.digitalocean.com/aztlan-containers
VERSION_STRING="$(scripts/set_version_string.sh) skaffold run --filename "k8s/production/skaffold.production.light.yaml" --default-repo=registry.digitalocean.com/aztlan-containers
9 changes: 9 additions & 0 deletions scripts/set_version_string.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
GIT_TAG=$(git describe --tags --abbrev=0)
GIT_COMMIT=$(git rev-parse --short HEAD)
if git diff --quiet; then
UNCOMMITTED_CHANGES=""
else
UNCOMMITTED_CHANGES="-DIRTY"
fi
echo "${GIT_TAG}-${GIT_COMMIT}${UNCOMMITTED_CHANGES}"
3 changes: 3 additions & 0 deletions services/explorer-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ ENV VITE_GITHUB_URL $VITE_GITHUB_URL
ARG VITE_X_URL
ENV VITE_X_URL $VITE_X_URL

ARG VITE_VERSION_STRING
ENV VITE_VERSION_STRING $VITE_VERSION_STRING

RUN yarn workspaces focus @chicmoz/explorer-ui

FROM deps as build
Expand Down
2 changes: 2 additions & 0 deletions services/explorer-ui/src/pages/dev.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { type FC } from "react";
import { VERSION_STRING } from "~/service/constants";

export const DevPage: FC = () => {
return (
<div className="flex flex-col items-center">
<h1>Dev Page</h1>
<div className="bg-white w-full rounded-lg shadow-md p-4 md:w-1/2">
<p>Aztec.js version : 0.67.0</p>
<p>Chicmoz version: {VERSION_STRING}</p>
</div>
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions services/explorer-ui/src/service/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ export const X_URL =
typeof import.meta.env.VITE_X_URL === "string"
? import.meta.env.VITE_X_URL
: "";

export const VERSION_STRING =
typeof import.meta.env.VITE_VERSION_STRING === "string"
? import.meta.env.VITE_VERSION_STRING
: "version undefined!";

0 comments on commit f81600e

Please sign in to comment.