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

CRW-537 reorganize dockerfile steps so we can override patch and post-patch steps, such that generated tarball includes patched theia sources #571

Merged
merged 2 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
nickboldt marked this conversation as resolved.
Show resolved Hide resolved
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