Skip to content

Commit

Permalink
Merge pull request #3 from l0rd/small-fixes
Browse files Browse the repository at this point in the history
Small fixes to templates, build script and deployment script
  • Loading branch information
l0rd committed Dec 5, 2016
2 parents 691476f + bfddfd5 commit 9e20e82
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion os-templates/che.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
{
"name": "${APPLICATION_NAME}",
"image": "${CHE_SERVER_DOCKER_IMAGE}",
"imagePullPolicy": "Always",
"imagePullPolicy": "IfNotPresent",
"privileged": true,
"livenessProbe": {
"tcpSocket": {
Expand Down
3 changes: 2 additions & 1 deletion os-templates/che_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
{
"port": 8000,
"targetPort": 8000,
"nodePort": 32306,
"protocol": "TCP",
"name": "tomcat-debug"
}
Expand Down Expand Up @@ -169,7 +170,7 @@
{
"name": "${APPLICATION_NAME}",
"image": "${CHE_SERVER_DOCKER_IMAGE}",
"imagePullPolicy": "Always",
"imagePullPolicy": "IfNotPresent",
"privileged": true,
"livenessProbe": {
"tcpSocket": {
Expand Down
15 changes: 5 additions & 10 deletions scripts/build_openshift_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ mvnche() {
}

cd plugins/plugin-docker
mvnche clean install
cd ../..

cd wsmaster/che-core-api-agent
mvnche clean install
cd ../che-core-api-workspace
mvnche clean install
mvnche install
cd ../..

cd assembly/assembly-wsmaster-war
mvnche clean install
mvnche install
cd ../..

cd assembly/assembly-main/
mvnche clean install
mvnche install
cd ../..

docker build -t ${CHE_IMAGE} .
cd ${CURRENT_DIR}
cd ${CURRENT_DIR}

18 changes: 11 additions & 7 deletions scripts/openche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ set_parameters() {
CHE_OPENSHIFT_ENDPOINT=${CHE_OPENSHIFT_ENDPOINT:-${DEFAULT_CHE_OPENSHIFT_ENDPOINT}}

CHE_TEMPLATE=${CHE_TEMPLATE:-${DEFAULT_CHE_TEMPLATE}}

CHE_APPLICATION_NAME=che-host
}

check_prerequisites() {
Expand Down Expand Up @@ -92,26 +94,28 @@ deploy() {
DOCKER0_IP=$(ip addr show docker0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
fi

oc new-app --template=eclipse-che --param=HOSTNAME_HTTP=${CHE_HOSTNAME} \
echo "calling oc new-app"
oc new-app --template=eclipse-che --param=APPLICATION_NAME=${CHE_APPLICATION_NAME} \
--param=HOSTNAME_HTTP=${CHE_HOSTNAME} \
--param=CHE_SERVER_DOCKER_IMAGE=${CHE_IMAGE} \
--param=DOCKER0_BRIDGE_IP=${DOCKER0_IP} \
--param=CHE_LOG_LEVEL=${CHE_LOG_LEVEL} \
--param=CHE_OPENSHIFT_ENDPOINT=${CHE_OPENSHIFT_ENDPOINT}
oc deploy che-host --latest

echo "OPENCHE: Waiting 5 seconds for the pod to start"
sleep 5
POD_ID=$(oc get pods | grep che-host | grep -v "\-deploy" | awk '{print $1}')
POD_ID=$(oc get pods | grep ${CHE_APPLICATION_NAME} | grep -v "\-deploy" | awk '{print $1}')
echo "Che pod starting (id $POD_ID)..."
}

## Uninstall everything
delete() {
echo "Deleting resources"
# POD_ID=$(oc get pods | grep che-host | awk '{print $1}')
# POD_ID=$(oc get pods | grep ${CHE_APPLICATION_NAME} | awk '{print $1}')
# oc delete pod/${POD_ID}
oc delete route/che-host || true
oc delete svc/che-host || true
oc delete dc/che-host || true
oc delete route/${CHE_APPLICATION_NAME} || true
oc delete svc/${CHE_APPLICATION_NAME} || true
oc delete dc/${CHE_APPLICATION_NAME} || true
}

parse_command_line () {
Expand Down

0 comments on commit 9e20e82

Please sign in to comment.