Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from runfalk/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb committed Jun 14, 2021
2 parents 2366a4b + 86495cd commit 1ac7de7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ start_container() {

install_dependencies() {
# Copy gitlab-runner binary from the server into the container
podman cp --pause=false /usr/bin/gitlab-runner "$CONTAINER_ID":/usr/bin/gitlab-runner
if [ -x /usr/local/bin/gitlab-runner ]; then
podman cp --pause=false /usr/local/bin/gitlab-runner "$CONTAINER_ID":/usr/bin/gitlab-runner
else
podman cp --pause=false /usr/bin/gitlab-runner "$CONTAINER_ID":/usr/bin/gitlab-runner
fi

# Install bash in systems with APK (e.g., Alpine)
podman exec "$CONTAINER_ID" sh -c 'if ! type bash >/dev/null 2>&1 && type apk >/dev/null 2>&1 ; then echo "APK based distro without bash"; apk add bash; fi'
Expand All @@ -78,6 +82,13 @@ install_dependencies() {
podman exec "$CONTAINER_ID" /bin/bash -c 'if ! type git >/dev/null 2>&1 && type apk >/dev/null 2>&1 ; then echo "APK based distro without git"; apk add git; fi'
# Install git in systems with YUM (e.g., RHEL<=7)
podman exec "$CONTAINER_ID" /bin/bash -c 'if ! type git >/dev/null 2>&1 && type yum >/dev/null 2>&1 ; then echo "YUM based distro without git"; yum install --assumeyes git; fi'

# Install git-lfs in systems with APT (e.g., Debian)
podman exec "$CONTAINER_ID" /bin/bash -c 'if ! type git-lfs >/dev/null 2>&1 && type apt-get >/dev/null 2>&1 ; then echo "APT based distro without git-lfs"; apt-get update && apt-get install --no-install-recommends -y ca-certificates git-lfs; fi'
# Install git-lfs in systems with DNF (e.g., Fedora)
podman exec "$CONTAINER_ID" /bin/bash -c 'if ! type git-lfs >/dev/null 2>&1 && type dnf >/dev/null 2>&1 ; then echo "DNF based distro without git-lfs"; dnf install --setopt=install_weak_deps=False --assumeyes git-lfs; fi'
# Install git-lfs in systems with APK (e.g., Alpine)
podman exec "$CONTAINER_ID" /bin/bash -c 'if ! type git-lfs >/dev/null 2>&1 && type apk >/dev/null 2>&1 ; then echo "APK based distro without git-lfs"; apk add git-lfs; fi'
}

echo "Running in $CONTAINER_ID"
Expand Down

0 comments on commit 1ac7de7

Please sign in to comment.