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

Commit

Permalink
#39 update to Theia 0.3.19, build another image from upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
  • Loading branch information
evidolob committed Feb 7, 2019
1 parent f49273b commit 76230eb
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 2 additions & 0 deletions build_and_push_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dockerfiles/theia
IMAGES_LIST=(
eclipse/che-theia-dev
eclipse/che-theia
eclipse/che-theia-master
)


Expand All @@ -30,6 +31,7 @@ for image_dir in "${DOCKER_FILES_LOCATIONS[@]}"
if [ "$image_dir" == "dockerfiles/theia" ]; then
THEIA_IMAGE_TAG="$(awk '/ARG THEIA_VERSION=/{print $NF}' dockerfiles/theia/Dockerfile | cut -d '=' -f2)-nightly"
bash $(pwd)/$image_dir/build.sh --build-arg:GITHUB_TOKEN=${GITHUB_TOKEN}
bash $(pwd)/$image_dir/build.sh --build-args:GITHUB_TOKEN=${GITHUB_TOKEN},THEIA_VERSION=master --name:theia-master
elif [ "$image_dir" == "dockerfiles/theia-dev" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:GITHUB_TOKEN=${GITHUB_TOKEN}
else
Expand Down
4 changes: 3 additions & 1 deletion dockerfiles/build.include
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ init() {
DOCKERFILE=""
BUILD_ARGS=""

PARENT_IMAGE=""

while [ $# -gt 0 ]; do
case $1 in
--*)
Expand Down Expand Up @@ -128,7 +130,7 @@ build() {
build_image() {
printf "${BOLD}Building Docker Image ${IMAGE_NAME} from $DIR directory with tag $TAG${NC}\n"
# Replace macros in Dockerfiles
cat ${DIR}/${DOCKERFILE} | sed s/\$\{BUILD_ORGANIZATION\}/${ORGANIZATION}/ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ > ${DIR}/.Dockerfile
cat ${DIR}/${DOCKERFILE} | sed s/\$\{BUILD_ORGANIZATION\}/${ORGANIZATION}/ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ | sed s/\$\{BUILD_PARENT_IMAGE\}/${PARENT_IMAGE}/ > ${DIR}/.Dockerfile
cd "${DIR}" && docker build -f ${DIR}/.Dockerfile -t ${IMAGE_NAME} ${BUILD_ARGS} .
rm ${DIR}/.Dockerfile
if [ $? -eq 0 ]; then
Expand Down
21 changes: 18 additions & 3 deletions dockerfiles/theia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKDIR ${HOME}
ARG GITHUB_TOKEN

# Define upstream version of theia to use
ARG THEIA_VERSION=0.3.18
ARG THEIA_VERSION=0.3.19

ENV NODE_OPTIONS="--max-old-space-size=4096"

Expand All @@ -39,8 +39,17 @@ RUN if [ ! -z "${GITHUB_TOKEN-}" ]; then \
fi \
fi

#invalidate cashe
ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/theia-ide/theia/git/refs/heads/master /tmp/master.json

# Clone theia
RUN git clone --branch v${THEIA_VERSION} --single-branch --depth 1 https://github.com/theia-ide/theia ${HOME}/theia-source-code
#RUN git clone --branch v${THEIA_VERSION} --single-branch --depth 1 https://github.com/theia-ide/theia ${HOME}/theia-source-code
RUN if [ $THEIA_VERSION == "master" ]; then \
echo "Cloning Theia master branch"; \
(git clone --branch master --single-branch --depth 1 https://github.com/theia-ide/theia ${HOME}/theia-source-code) ; \
else \
(git clone --branch v${THEIA_VERSION} --single-branch --depth 1 https://github.com/theia-ide/theia ${HOME}/theia-source-code); \
fi

# Add patches
ADD src/patches ${HOME}/patches
Expand All @@ -61,7 +70,13 @@ WORKDIR ${HOME}/theia-source-code

COPY che-theia/extensions.yml ${HOME}/extensions.yml

RUN che:theia init -c ${HOME}/extensions.yml
#RUN che:theia init -c ${HOME}/extensions.yml
RUN if [ ${THEIA_VERSION} == "master" ]; then \
echo "Working in dev mode"; \
(che:theia init -d -c ${HOME}/extensions.yml); \
else \
(che:theia init -c ${HOME}/extensions.yml);\
fi
RUN che:theia cdn --theia="${CDN_PREFIX}" --monaco="${MONACO_CDN_PREFIX}"

# Compile Theia
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/theia/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fi
build

if ! skip_tests; then
bash "${base_dir}"/e2e/build.sh "$@"
bash "${base_dir}"/e2e/build.sh "$PREFIX-$NAME" "$@"
fi

echo "Extracting artifacts for the CDN"
Expand Down
3 changes: 1 addition & 2 deletions dockerfiles/theia/e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-License-Identifier: EPL-2.0

# Use upstream image
FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia:${BUILD_TAG} as theia
FROM ${BUILD_ORGANIZATION}/${BUILD_PARENT_IMAGE}:${BUILD_TAG} as theia
FROM cypress/browsers:chrome67

USER root
Expand All @@ -26,4 +26,3 @@ ADD cypress /root/cypress/
COPY --from=theia /home/theia /home/theia
COPY --from=theia /entrypoint.sh /entrypoint.sh
RUN find /home/theia/ -name "binding.gyp" | xargs -i sh -c 'cd $(dirname {}) && node-gyp rebuild'

1 change: 1 addition & 0 deletions dockerfiles/theia/e2e/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ base_dir=$(cd "$(dirname "$0")"; pwd)
. "${base_dir}/../../build.include"

init --name:theia-e2e "$@"
PARENT_IMAGE="$1"
build
if ! skip_tests; then
bash "${base_dir}"/test.sh "$@"
Expand Down
12 changes: 1 addition & 11 deletions dockerfiles/theia/e2e/cypress/integration/theia/commands.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ context('Check Extensions are installed', () => {
'@theia/plugin-ext-vscode',
'@theia/java',
'@theia/typescript',
'che-theia-ssh-extension',
'@eclipse-che/che-theia-hosted-plugin-manager-extension',
'@eclipse-che/theia-remote-extension',
'github-extension',
'@eclipse-che/theia-remote',
'@eclipse-che/theia-activity-tracker',
'@eclipse-che/theia-task-extension',
'@eclipse-che/theia-terminal',
Expand All @@ -49,12 +47,4 @@ context('Check Extensions are installed', () => {

})

// Search that SSH extension is there with actions
it('Command Palette include SSH extension', () => {
cy.theiaCommandPaletteItems('SSH:').then((value) => {
expect(value).to.have.length(4);
expect(value).to.have.members([
'SSH: copy public key to clipboard...', 'SSH: create key pair...', 'SSH: delete key pair...', 'SSH: generate key pair...']);
})
});
})
15 changes: 3 additions & 12 deletions extensions/extensions.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
extensions:
- source: https://github.com/ws-skeleton/che-theia-remote-extension
checkoutTo: THEIA_0_3_18
- source: https://github.com/eclipse/che-theia-github-plugin
folders:
- github-extension
checkoutTo: 0.0.2
- source: https://github.com/eclipse/che-theia-ssh-plugin
folders:
- ssh-extension
checkoutTo: 0.0.2
- source: https://github.com/eclipse/che-theia-dashboard-extension
folders:
- theia-dashboard-extension
Expand All @@ -18,7 +8,7 @@ extensions:
- source: https://github.com/eclipse/che-theia-task-plugin
folders:
- che-theia-task-extension
checkoutTo: 0.3.17
checkoutTo: 0.3.19
- source: https://github.com/eclipse/che-theia-activity-tracker
folders:
- che-theia-activity-tracker
Expand All @@ -28,4 +18,5 @@ extensions:
- extensions/eclipse-che-theia-plugin
- extensions/eclipse-che-theia-plugin-ext
- extensions/eclipse-che-theia-terminal
checkoutTo: 0.0.3
- extensions/eclipse-che-theia-remote
checkoutTo: 0.0.4

0 comments on commit 76230eb

Please sign in to comment.