Skip to content

Commit

Permalink
Set DOCKER_HOST correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Nov 8, 2024
1 parent d55b811 commit 0ac201e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Maven Release
on:
push:
tags: [ 'webrepl-*' ]
pull_request:
branches: [ 'webrepl' ]

jobs:
release:
Expand Down Expand Up @@ -31,6 +33,7 @@ jobs:
- name: Set up Docker
uses: crazy-max/ghaction-setup-docker@26145a578dce008fee793528d031cd72c57d51af # v3.4.0
with:
set-host: true
daemon-config: |
{
"debug": true,
Expand All @@ -52,20 +55,16 @@ jobs:
distribution: ${{ matrix.jdk }}
java-version: ${{ matrix.java }}

- name: Set environmental variables
- name: Set release version
shell: bash
run: |
GITHUB_REF="${{ github.ref }}" &&
TAG_NAME="${GITHUB_REF#refs/tags/}" &&
# Use 'latest' instead of tag, if being run on a PR branch
if [[ $TAG_NAME == "refs/pull/"* ]]; then
echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${TAG_NAME#webrepl-}" >> $GITHUB_ENV
fi &&
# Set Docker host ENV so the docker-maven-plugin will find the correct Docker instance
DOCKER_HOST="$(ps aux | grep '[d]ockerd' | grep -o -- '--host=[^ ]*' | sed 's/--host=//')"
echo "DOCKER_HOST=${DOCKER_HOST}" >> $GITHUB_ENV
fi
- name: Set up Maven if needed
if: ${{ env.ACT }}
Expand Down

0 comments on commit 0ac201e

Please sign in to comment.