Skip to content

Commit

Permalink
Deduce version from git whenever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Murazaki committed Jan 30, 2025
1 parent 84c57fd commit 5aedc53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set version
id: pixelfed_version
run: echo "PIXELFED_VERSION=$(git describe --tags | sed -En "s/v(.*)-glitch/\1+glitch/p")" >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -210,6 +217,7 @@ jobs:
build-args: |
PHP_VERSION=${{ matrix.php_version }}
PHP_BASE_TYPE=${{ matrix.php_base }}
PIXELFED_VERSION=${{ steps.pixelfed_version.outputs.PIXELFED_VERSION }}
cache-from: type=gha,scope=-${{ matrix.target_runtime }}-${{ matrix.php_base }}-${{ matrix.php_version }}-${{ matrix.debian_release }}
cache-to: type=gha,mode=max,scope=-${{ matrix.target_runtime }}-${{ matrix.php_base }}-${{ matrix.php_version }}-${{ matrix.debian_release }}

Expand Down
3 changes: 2 additions & 1 deletion config/pixelfed.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
| This value is the version of your Pixelfed instance.
|
*/
'version' => '0.12.4+glitch.1.9.0',
'git_version' => exec('git describe --tags | sed -En "s/v(.*)-glitch/\1+glitch/p"'),
'version' => env('PIXELFED_VERSION', !empty($git_version) ? $git_version : '0.12.4+glitch.1.9.0?'),

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ ARG RUNTIME_GID
ENV RUNTIME_UID=${RUNTIME_UID}
ENV RUNTIME_GID=${RUNTIME_GID}

ARG PIXELFED_VERSION

ENV PIXELFED_VERSION=${PIXELFED_VERSION}

ARG TARGETARCH
ARG TARGETOS
ARG GOMPLATE_VERSION
Expand Down
4 changes: 3 additions & 1 deletion docker/rootfs/shared/docker/entrypoint.d/02-check-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source "${ENTRYPOINT_ROOT}/helpers.sh"

entrypoint-set-script-name "$0"

: "${ENTRYPOINT_DOTTIE_STRICT:="false"}"

# Validating dot-env files for any issues
for file in "${dot_env_files[@]}"; do
if ! file-exists "${file}"; then
Expand All @@ -17,5 +19,5 @@ for file in "${dot_env_files[@]}"; do
# which do not (and should not) exists inside the container
#
# We disable fixer since its not interactive anyway
run-as-current-user dottie validate --file "${file}" --ignore-rule dir,file --exclude-prefix APP_KEY --no-fix || [ "$ENTRYPOINT_DOTTIE_STRICT" = false ]
run-as-current-user dottie validate --file "${file}" --ignore-rule dir,file --exclude-prefix APP_KEY --no-fix || [ "$ENTRYPOINT_DOTTIE_STRICT" = "false" ]
done

0 comments on commit 5aedc53

Please sign in to comment.