Skip to content

Commit

Permalink
build: Work around OpenShift not including the .git directory
Browse files Browse the repository at this point in the history
See e.g. openshift/source-to-image#457

Thankfully, OpenShift *will* do a recursive clone, so we don't
need to handle that.

Closes: #27
  • Loading branch information
cgwalters committed Aug 30, 2018
1 parent aab80ea commit c43fa10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.fedoraproject.org/fedora:28
WORKDIR /root/src
COPY . /root/src
RUN ./build.sh
RUN ./build.sh
14 changes: 10 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ set -xeuo pipefail

srcdir=$(pwd)

# Init submodules
ls -al .git mantle
dnf -y install git
# Work around https://github.com/coreos/coreos-assembler/issues/27
if ! test -d .git; then
dnf -y install git
(git config --global user.email [email protected]
git init && git add . && git commit -a -m 'dummy commit'
git tag -m tag dummy-tag) >/dev/null
fi

if ! test -f mantle/README.md; then
git submodule update --init
echo "Run: git submodule update --init" 1>&2
exit 1
fi

# We want to run what builds we can as an unprivileged user;
Expand Down

0 comments on commit c43fa10

Please sign in to comment.