Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
CRW-537 if patches applied, tar up the results AFTER patching so we d…
Browse files Browse the repository at this point in the history
…on't have to repatch later.

move add+apply patch steps to new builder-patch-theia.dockerfile files; add builder-post-patch.dockerfile too
move tarball step from builder-clone-theia to builder-post-patch.dockerfile
add 'nothing to do on alpine' markers in empty files
add same comment in alpine and ubi8 versions of builder-clone-theia.dockerfile

Change-Id: I50c9380b5289d91f5ff7542c553c792572047c15
Signed-off-by: nickboldt <nboldt@redhat.com>
  • Loading branch information
nickboldt committed Dec 3, 2019
1 parent a0776aa commit b8bac6b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
15 changes: 3 additions & 12 deletions dockerfiles/theia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,15 @@ ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/${THEIA_GITHUB_RE
#{INCLUDE:docker/${BUILD_IMAGE_TARGET}/builder-clone-theia.dockerfile}
#{INCLUDE:docker/${BUILD_IMAGE_TARGET}/builder-post-clone.dockerfile}

# Add patches
ADD src/patches ${HOME}/patches

# Apply patches
RUN if [ -d "${HOME}/patches/${THEIA_VERSION}" ]; then \
echo "Applying patches for Theia version ${THEIA_VERSION}"; \
for file in $(find "${HOME}/patches/${THEIA_VERSION}" -name '*.patch'); do \
echo "Patching with ${file}"; \
cd ${HOME}/theia-source-code && patch -p1 < ${file}; \
done \
fi
# Patch theia
#{INCLUDE:docker/${BUILD_IMAGE_TARGET}/builder-patch-theia.dockerfile}
#{INCLUDE:docker/${BUILD_IMAGE_TARGET}/builder-post-patch.dockerfile}

# Generate che-theia
ARG CDN_PREFIX=""
ARG MONACO_CDN_PREFIX=""
WORKDIR ${HOME}/theia-source-code


# Add che-theia repository content
COPY asset-che-theia.tar.gz /tmp/asset-che-theia.tar.gz
RUN mkdir -p ${HOME}/theia-source-code/che-theia/ && tar xzf /tmp/asset-che-theia.tar.gz -C ${HOME}/theia-source-code/che-theia/ && rm /tmp/asset-che-theia.tar.gz
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Clone theia and keep source code in home
RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${THEIA_GITHUB_REPO} ${HOME}/theia-source-code
11 changes: 11 additions & 0 deletions dockerfiles/theia/docker/alpine/builder-patch-theia.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add patches
ADD src/patches ${HOME}/patches

# Apply patches
RUN if [ -d "${HOME}/patches/${THEIA_VERSION}" ]; then \
echo "Applying patches for Theia version ${THEIA_VERSION}"; \
for file in $(find "${HOME}/patches/${THEIA_VERSION}" -name '*.patch'); do \
echo "Patching with ${file}"; \
cd ${HOME}/theia-source-code && patch -p1 < ${file}; \
done \
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# nothing to do on alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# nothing to do on alpine
4 changes: 1 addition & 3 deletions dockerfiles/theia/docker/ubi8/builder-clone-theia.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# Clone theia and keep source code in home
RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${THEIA_GITHUB_REPO} ${HOME}/theia-source-code \
&& cd ${HOME} && tar zcf ${HOME}/theia-source-code.tgz theia-source-code

RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${THEIA_GITHUB_REPO} ${HOME}/theia-source-code
11 changes: 11 additions & 0 deletions dockerfiles/theia/docker/ubi8/builder-patch-theia.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add patches
ADD src/patches ${HOME}/patches

# Apply patches
RUN if [ -d "${HOME}/patches/${THEIA_VERSION}" ]; then \
echo "Applying patches for Theia version ${THEIA_VERSION}"; \
for file in $(find "${HOME}/patches/${THEIA_VERSION}" -name '*.patch'); do \
echo "Patching with ${file}"; \
cd ${HOME}/theia-source-code && patch -p1 < ${file}; \
done \
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUN cd ${HOME} && tar zcf ${HOME}/theia-source-code.tgz theia-source-code

0 comments on commit b8bac6b

Please sign in to comment.