-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changes from 5 commits
bb4dba8
e322211
bff33e1
50329bd
f4d1ce4
6ac0e9d
fdbb5be
1f4865c
6da1c42
0d16a64
26e32f7
b17b070
368f415
545f930
012c0e0
93fb8c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}" | ||
fi | ||
fi | ||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/* | ||
|
There was a problem hiding this comment.
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)