Skip to content

Add the ability to clone a specific commit of the Unreal Engine #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions ue4docker/dockerfiles/ue4-source/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY ${SOURCE_LOCATION} /home/ue4/UnrealEngine
# The git repository that we will clone
ARG GIT_REPO=""

# The git branch/tag that we will checkout
# The git branch/tag/commit that we will checkout
ARG GIT_BRANCH=""

{% if credential_mode == "secrets" %}
Expand All @@ -38,7 +38,18 @@ RUN chmod +x /tmp/git-credential-helper-secrets.sh
ARG CHANGELIST
RUN --mount=type=secret,id=username,uid=1000,required \
--mount=type=secret,id=password,uid=1000,required \
CHANGELIST="$CHANGELIST" git clone --progress --depth=1 -b $GIT_BRANCH $GIT_REPO {{ clone_opts }} /home/ue4/UnrealEngine
CHANGELIST="$CHANGELIST" \
mkdir /home/ue4/UnrealEngine && \
cd /home/ue4/UnrealEngine && \
git init && \
{% if git_config %}
{% for key, value in git_config.items() %}
git config {{ key }} {{ value }} && \
{% endfor %}
{% endif %}
git remote add origin "$GIT_REPO" && \
git fetch --progress --depth 1 origin "$GIT_BRANCH" && \
git checkout FETCH_HEAD

{% else %}

Expand All @@ -56,7 +67,17 @@ ENV GIT_ASKPASS=/tmp/git-credential-helper-endpoint.sh
RUN chmod +x /tmp/git-credential-helper-endpoint.sh

# Clone the UE4 git repository using the endpoint-supplied credentials
RUN git clone --progress --depth=1 -b $GIT_BRANCH $GIT_REPO {{ clone_opts }} /home/ue4/UnrealEngine
RUN mkdir /home/ue4/UnrealEngine && \
cd /home/ue4/UnrealEngine && \
git init && \
{% if git_config %}
{% for key, value in git_config.items() %}
git config {{ key }} {{ value }} && \
{% endfor %}
{% endif %}
git remote add origin "$GIT_REPO" && \
git fetch --progress --depth 1 origin "$GIT_BRANCH" && \
git checkout FETCH_HEAD

{% endif %}

Expand Down
14 changes: 12 additions & 2 deletions ue4docker/dockerfiles/ue4-source/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY ${SOURCE_LOCATION} C:\UnrealEngine
# The git repository that we will clone
ARG GIT_REPO=""

# The git branch/tag that we will checkout
# The git branch/tag/commit that we will checkout
ARG GIT_BRANCH=""

# Retrieve the address for the host that will supply git credentials
Expand All @@ -40,7 +40,17 @@ ENV GIT_ASKPASS=C:\git-credential-helper.bat

# Clone the UE4 git repository using the host-supplied credentials
WORKDIR C:\
RUN git clone --progress --depth=1 -b %GIT_BRANCH% %GIT_REPO% {{ clone_opts }} C:\UnrealEngine
RUN mkdir C:\UnrealEngine && \
cd C:\UnrealEngine && \
git init && \
{% if git_config %}
{% for key, value in git_config.items() %}
git config {{ key }} {{ value }} && \
{% endfor %}
{% endif %}
git remote add origin %GIT_REPO% && \
git fetch --progress --depth 1 origin %GIT_BRANCH% && \
git checkout FETCH_HEAD

{% endif %}

Expand Down