Skip to content

Commit

Permalink
chore(container): add the branch name to the container
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Mar 20, 2024
1 parent 4d9654d commit bee5098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
VER="$(git describe --tags 2>/dev/null)"
echo "version=${VER}" >> "$GITHUB_OUTPUT"
echo "branch=${REF}" >> "$GITHUB_OUTPUT"
echo 'tags<<EOF' >> "$GITHUB_OUTPUT"
if [[ "$REF" == "main" ]]; then
Expand All @@ -105,6 +106,7 @@ jobs:
platforms: linux/amd64
build-args: |
VERSION=${{ steps.info.outputs.version }}
BRANCH=${{ steps.info.outputs.branch }}
publish-image:
name: Publish Image
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ vendor/bundle

Procfile.local
VERSION
BRANCH

.rubocop-https*
.env*
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ruby:3.2.2-bullseye AS base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common dirmngr apt-transport-https \
software-properties-common dirmngr apt-transport-https \
&& (curl -sL https://deb.nodesource.com/setup_20.x | bash -) \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -43,8 +43,10 @@ COPY ./docker/wait-for.sh /docker-entrypoint.sh
COPY --chown=postal . .

# Export the version
ARG VERSION=unspecified
RUN echo $VERSION > VERSION
ARG VERSION=null
ARG BRANCH=null
RUN echo $VERSION > VERSION \
&& echo $BRANCH > BRANCH

# Set paths for when running in a container
ENV POSTAL_CONFIG_FILE_PATH=/config/postal.yml
Expand Down

0 comments on commit bee5098

Please sign in to comment.