Skip to content

Commit

Permalink
update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Iuvshin committed Aug 11, 2016
1 parent 4aa3f4e commit 8431141
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test-output/
*.exe
*.o
*.so
*.sh


# Packages #
############
Expand Down
17 changes: 17 additions & 0 deletions dockerfiles/che-file/build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Copyright (c) 2012-2016 Codenvy, S.A., Red Hat, Inc
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html

if [ "latest" = "$1" ]
then
TAG="latest"
else
TAG="nightly"
fi

DIR=$(cd "$(dirname "$0")"; cd ..; pwd)
echo "Building Docker Image from $DIR directory with tag $TAG"
cd $DIR && docker build -t codenvy/che-file:$TAG -f che-file/Dockerfile .
2 changes: 1 addition & 1 deletion dockerfiles/che-file/src/che.properties
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ org.everrest.asynchronous.cache.size=1024
# Path to asynchronous service
org.everrest.asynchronous.service.path=/async/

machine.ssh.connection_timeout_ms=3000
machine.ssh.connection_timeout_ms=10000
# The location of the Web Socket terminal used within the browser.
# This is copied into the machine and run from within it.
# Suffix helps differentiate archive for different architectures/OSes
Expand Down
79 changes: 79 additions & 0 deletions dockerfiles/che-mount/sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/sh
# Copyright (c) 2012-2016 Codenvy, S.A., Red Hat, Inc
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Tyler Jewell - Initial implementation
#
init_logging() {
BLUE='\033[1;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
}

init_global_variables() {

USAGE="
Usage:
docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse
-v <local-mount>/:/mnthost codenvy/che-mount <ip> <port>
<local-mount> Host directory to sync files, must end with a slash '/'
<ip> IP address of Che server
<port> Port of workspace SSH server - retrieve inside workspace
"
}

parse_command_line () {
if [ $# -eq 0 ]; then
usage
exit
fi
}

usage () {
printf "%s" "${USAGE}"
}

info() {
printf "${GREEN}INFO:${NC} %s\n" "${1}"
}

debug() {
printf "${BLUE}DEBUG:${NC} %s\n" "${1}"
}

error() {
printf "${RED}ERROR:${NC} %s\n" "${1}"
}

error_exit() {
echo "---------------------------------------"
error "!!!"
error "!!! ${1}"
error "!!!"
echo "---------------------------------------"
exit 1
}

# See: https://sipb.mit.edu/doc/safe-shell/
set -e
set -u

init_logging
init_global_variables
parse_command_line "$@"

sshfs user@$1:/projects /mntssh -p $2
unison /mntssh /mnthost -batch -fat -silent -auto -prefer=newer > /dev/null 2>&1

info "INFO: ECLIPSE CHE: Successfully mounted user@$1:/projects"

while :
do
unison /mntssh /mnthost -batch -fat -silent -auto -prefer=newer > /dev/null 2>&1
sleep 1
done
17 changes: 17 additions & 0 deletions dockerfiles/che-test/build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Copyright (c) 2012-2016 Codenvy, S.A., Red Hat, Inc
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html

if [ "latest" = "$1" ]
then
TAG="latest"
else
TAG="nightly"
fi

DIR=$(cd "$(dirname "$0")"; cd ..; pwd)
echo "Building Docker Image from $DIR directory with tag $TAG"
cd $DIR && docker build -t codenvy/che-test:$TAG -f che-test/Dockerfile .

0 comments on commit 8431141

Please sign in to comment.