Skip to content

Commit

Permalink
fixup! CHE-2977 "move the core Che Dockerfiles and Dockerfile.centos …
Browse files Browse the repository at this point in the history
…into /dockerfiles/che"

Change-Id: I28e31ee7e8852acb9c2850640c61977a8890a6df
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
  • Loading branch information
benoitf committed Dec 11, 2016
1 parent 78851c2 commit 85906b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 40 deletions.
2 changes: 1 addition & 1 deletion dockerfiles/che/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/reposit

EXPOSE 8000 8080
COPY entrypoint.sh /entrypoint.sh
ADD assembly /home/user/che
ENTRYPOINT ["/entrypoint.sh"]
ADD eclipse-che.tar.gz /home/user/
3 changes: 1 addition & 2 deletions dockerfiles/che/Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ RUN yum -y update && \
rm -rf /tmp/* /var/cache/yum

EXPOSE 8000 8080

COPY entrypoint.sh /entrypoint.sh
ADD assembly /home/user/che
ENTRYPOINT ["/entrypoint.sh"]
ADD eclipse-che.tar.gz /home/user/
20 changes: 7 additions & 13 deletions dockerfiles/che/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ if [ ! -d "${DIR}/../../assembly/assembly-main/target" ]; then
fi

# Use of folder
ASSEMBLY_DIR=$(echo ${DIR}/../../assembly/assembly-main/target/eclipse-che-*/eclipse-che-*)
LOCAL_ASSEMBLY=${DIR}/assembly
BUILD_ASSEMBLY_ZIP=$(echo ${DIR}/../../assembly/assembly-main/target/eclipse-che-*.tar.gz)
LOCAL_ASSEMBLY_ZIP=${DIR}/eclipse-che.tar.gz

if [ -d "${DIR}/assembly" ]; then
if [ ${ASSEMBLY_DIR} -nt ${DIR}/assembly ]; then
echo "There is new version of che-assembly, need to copy again"
rm -rf ${LOCAL_ASSEMBLY}
cp -r ${ASSEMBLY_DIR} ${LOCAL_ASSEMBLY}
else
echo "Copy of current assembly is up-to-date, skip copy."
fi
else
echo "Copying assembly file"
cp -r ${ASSEMBLY_DIR} ${LOCAL_ASSEMBLY}
if [ -f "${LOCAL_ASSEMBLY_ZIP}" ]; then
rm ${LOCAL_ASSEMBLY_ZIP}
fi

echo "Linking assembly ${BUILD_ASSEMBLY_ZIP} --> ${LOCAL_ASSEMBLY_ZIP}"
ln ${BUILD_ASSEMBLY_ZIP} ${LOCAL_ASSEMBLY_ZIP}

init
build
27 changes: 3 additions & 24 deletions dockerfiles/che/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,6 @@ Variables:
DEFAULT_CHE_DEBUG_SERVER=false
CHE_DEBUG_SERVER=${CHE_DEBUG_SERVER:-${DEFAULT_CHE_DEBUG_SERVER}}

DEFAULT_CHE_HOME=$(get_default_che_home)
export CHE_HOME=${CHE_HOME:-${DEFAULT_CHE_HOME}}

DEFAULT_CHE_DATA=$(get_default_che_data)
export CHE_DATA=${CHE_DATA:-${DEFAULT_CHE_DATA}}
}

get_default_che_home () {
# The base directory of Che
if [ -z "${CHE_HOME}" ]; then
echo "$(dirname "$(cd "$(dirname "${0}")" && pwd -P)")"
else
echo "/home/user/che"
fi
}

get_default_che_data () {
# The base directory of Che
if [ -z "${CHE_DATA}" ]; then
echo "/data"
fi
}

error () {
Expand Down Expand Up @@ -226,12 +205,12 @@ init() {
### Any variables with export is a value that native Tomcat che.sh startup script requires
export CHE_IP=${CHE_IP}

if [ -f "/assembly/bin/che.sh" ]; then
if [ -f "/assembly/conf/che.properties" ]; then
echo "Found custom assembly..."
export CHE_HOME="/assembly"
else
echo "Using embedded assembly..."
export CHE_HOME="/home/user/che"
export CHE_HOME=$(echo /home/user/eclipse-che-*)
fi

### Are we using the included assembly or did user provide their own?
Expand Down Expand Up @@ -302,7 +281,7 @@ init() {
}

get_che_data_from_host() {
DEFAULT_DATA_HOST_PATH=/home/user/che
DEFAULT_DATA_HOST_PATH=/data
CHE_SERVER_CONTAINER_ID=$(get_che_server_container_id)
# If `docker inspect` fails $DEFAULT_DATA_HOST_PATH is returned
echo $(docker inspect --format='{{(index .Volumes "/data")}}' $CHE_SERVER_CONTAINER_ID 2>/dev/null || echo $DEFAULT_DATA_HOST_PATH)
Expand Down

0 comments on commit 85906b1

Please sign in to comment.