Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Che using different database path in different versions #8073

Merged
merged 16 commits into from
Jan 15, 2018
Merged
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
32 changes: 16 additions & 16 deletions dockerfiles/che/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ set_environment_variables () {
# CHE_DOCKER_IP is used internally by Che to set its IP address
if [[ -z "${CHE_DOCKER_IP}" ]]; then
if [[ -n "${CHE_IP}" ]]; then
export CHE_DOCKER_IP="${CHE_IP}"
export CHE_DOCKER_IP="${CHE_IP}"
Copy link
Contributor

@benoitf benoitf Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can skip this change from this PR's commit as it's unrelated (it's more a indent fix)

fi
fi

Expand Down Expand Up @@ -205,48 +205,48 @@ init() {

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

### We need to discover the host mount provided by the user for `/data`
export CHE_DATA="/data"
[ -z "$CHE_DATA" ] && export CHE_DATA="/data"
CHE_DATA_HOST=$(get_che_data_from_host)

CHE_USER=${CHE_USER:-root}
export CHE_USER=$CHE_USER
[ -z "$CHE_USER" ] && export CHE_USER=$CHE_USER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you changed that?

if [ "$CHE_USER" != "root" ]; then
if [ ! $(getent group docker) ]; then
echo "!!!"
echo "!!! Error: The docker group doesn't exist."
echo "!!!"
exit 1
fi
export CHE_USER_ID=${CHE_USER}
[ -z "$CHE_USER_ID" ] && export CHE_USER_ID=${CHE_USER}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you changed that?

sudo chown -R ${CHE_USER} ${CHE_DATA}
sudo chown -R ${CHE_USER} ${CHE_HOME}
sudo chown -R ${CHE_USER} ${CHE_LOGS_DIR}
fi

export CHE_DATABASE=/data/storage
export CHE_TEMPLATE_STORAGE=/data/templates
export CHE_WORKSPACE_AGENT_DEV=${CHE_DATA_HOST}/lib/ws-agent.tar.gz
export CHE_WORKSPACE_TERMINAL__LINUX__AMD64=${CHE_DATA_HOST}/lib/linux_amd64/terminal
export CHE_WORKSPACE_TERMINAL__LINUX__ARM7=${CHE_DATA_HOST}/lib/linux_arm7/terminal
export CHE_WORKSPACE_EXEC__LINUX__AMD64=${CHE_DATA_HOST}/lib/linux_amd64/exec
[ -z "$CHE_DATABASE" ] && export CHE_DATABASE=${CHE_DATA}/storage
[ -z "$CHE_TEMPLATE_STORAGE" ] && export CHE_TEMPLATE_STORAGE=${CHE_DATA}/templates
[ -z "$CHE_WORKSPACE_AGENT_DEV" ] && export CHE_WORKSPACE_AGENT_DEV=${CHE_DATA_HOST}/lib/ws-agent.tar.gz
[ -z "$CHE_WORKSPACE_TERMINAL__LINUX__AMD64" ] && export CHE_WORKSPACE_TERMINAL__LINUX__AMD64=${CHE_DATA_HOST}/lib/linux_amd64/terminal
[ -z "$CHE_WORKSPACE_TERMINAL__LINUX__ARM7" ] && export CHE_WORKSPACE_TERMINAL__LINUX__ARM7=${CHE_DATA_HOST}/lib/linux_arm7/terminal
[ -z "$CHE_WORKSPACE_EXEC__LINUX__AMD64" ] && export CHE_WORKSPACE_EXEC__LINUX__AMD64=${CHE_DATA_HOST}/lib/linux_amd64/exec

# CHE_DOCKER_IP_EXTERNAL must be set if you are in a VM.
HOSTNAME=${CHE_DOCKER_IP_EXTERNAL:-$(get_docker_external_hostname)}
if has_external_hostname; then
# Internal property used by Che to set hostname.
export CHE_DOCKER_IP_EXTERNAL=${HOSTNAME}
[ -z "$CHE_DOCKER_IP_EXTERNAL" ] && export CHE_DOCKER_IP_EXTERNAL=${HOSTNAME}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you changed that?

fi
### Necessary to allow the container to write projects to the folder
export CHE_WORKSPACE_STORAGE__MASTER__PATH=/data/workspaces
export CHE_WORKSPACE_STORAGE="${CHE_DATA_HOST}/workspaces"
export CHE_WORKSPACE_STORAGE_CREATE_FOLDERS=false
[ -z "$CHE_WORKSPACE_STORAGE__MASTER__PATH" ] && export CHE_WORKSPACE_STORAGE__MASTER__PATH=${CHE_DATA}/workspaces
[ -z "$CHE_WORKSPACE_STORAGE" ] && export CHE_WORKSPACE_STORAGE="${CHE_DATA_HOST}/workspaces"
[ -z "$CHE_WORKSPACE_STORAGE_CREATE_FOLDERS" ] && export CHE_WORKSPACE_STORAGE_CREATE_FOLDERS=false

# Move files from /lib to /lib-copy. This puts files onto the host.
rm -rf ${CHE_DATA}/lib/*
Expand Down