Skip to content

Commit

Permalink
ci: get ids from user dynamically
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Waffen <[email protected]>
  • Loading branch information
rwaffen committed Sep 27, 2024
1 parent 076d225 commit c214204
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,18 @@ jobs:

- name: Test container
run: |
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile -T
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile lint
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile metadata_lint
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile strings:validate:reference
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile rubocop
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile syntax
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile spec
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:syntax
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:dependencies
# get ids from runner user
UID=$(id -u)
GID=$(id -g)
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile -T
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile lint
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile metadata_lint
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile strings:validate:reference
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile rubocop
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile syntax
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile spec
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:syntax
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:dependencies
build-ARM-container:
name: 'Build ARM CI container'
Expand Down Expand Up @@ -106,15 +109,18 @@ jobs:

- name: Test container
run: |
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile -T
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile lint
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile metadata_lint
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile strings:validate:reference
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile rubocop
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile syntax
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile spec
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:syntax
docker run --user 999:998 --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:dependencies
# get ids from runner user
UID=$(id -u)
GID=$(id -g)
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile -T
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile lint
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile metadata_lint
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile strings:validate:reference
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile rubocop
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile syntax
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile spec
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:syntax
docker run --user ${UID}:${GID} --rm -v $(pwd):/repo ci/voxbox:${{ matrix.rubygem_puppet }} -f /Rakefile r10k:dependencies
tests:
needs:
Expand Down

0 comments on commit c214204

Please sign in to comment.