Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach version information to downloaded assets #49

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/foyle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# The main difference is that we don't install vscode in the container; i.e. we don't call the install-vscode.sh script.
FROM mcr.microsoft.com/devcontainers/typescript-node:18-bookworm as build

# Build Args need to be after the FROM stage otherwise they don't get passed through to the RUN statment
ARG VERSION=unknown
ARG DATE=unknown
ARG COMMIT=unknown

# Not sure why this is needed since its not in the dev container.
RUN apt-get update -y && \
apt-get install -y libxkbfile-dev
Expand All @@ -17,4 +22,6 @@ FROM scratch

COPY --from=build /foyle/package.json /foyle/package.json
COPY --from=build /foyle/package.nls.json /foyle/package.nls.json
# version.json gets builts in build.sh
COPY --from=build /foyle/version.json /foyle/version.json
COPY --from=build /foyle/dist /foyle/dist
11 changes: 10 additions & 1 deletion frontend/foyle/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
# This is useful for running in a container to build the fronted
set -ex
yarn
yarn package-web
yarn package-web

cat > version.json <<EOF
{
"version": "$VERSION",
"date": "$DATE",
"commit": "$COMMIT"
}
EOF

5 changes: 5 additions & 0 deletions frontend/vscode/web-assets/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Should we pin this
FROM us-west1-docker.pkg.dev/foyle-public/images/vscode as build

# Build Args need to be after the FROM stage otherwise they don't get passed through to the RUN statment
ARG VERSION=unknown
ARG DATE=unknown
ARG COMMIT=unknown

COPY /frontend/vscode/web-assets /workspace
RUN /workspace/build.sh

Expand Down
10 changes: 9 additions & 1 deletion frontend/vscode/web-assets/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ rm go1.21.5.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc

cd ${DIR}
/usr/local/go/bin/go run . --vscode=/vscode --out=/assets
/usr/local/go/bin/go run . --vscode=/vscode --out=/assets

cat > /assets/version.json <<EOF
{
"version": "$VERSION",
"date": "$DATE",
"commit": "$COMMIT"
}
EOF
Loading