Skip to content

Commit

Permalink
Working on ui deployment (#55)
Browse files Browse the repository at this point in the history
* tweaks for working with cluster

* removing local_dc, no worky

* work

* updating bower
  • Loading branch information
chrislovecnm authored Jun 28, 2016
1 parent da00cf4 commit bd943a5
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 12 deletions.
9 changes: 9 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Setup Process

## Get K8s 1.3 running locally
You need a beta or 1.3 GA. Use a tool like kube-solo or k8s vagrant from coreos.

## Local Registry
For development we run most of the dockers out of a local registry on k8s. We currently have issues with docker dependancies and the fact that a of the dockers are currenly in gce. We will correct that eventually. At this point you would need to change the ip addresses in the local build scripts, and the yaml files, which applicable.

TBD
2 changes: 1 addition & 1 deletion pet-race-devops/docker/cassandra-debian/build-local.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
VERSION=v1.0
REPO=10.100.179.231:5000
REPO=10.100.4.250:5000
DOCKER="${REPO}/cassandra:${VERSION}"

docker build -t ${DOCKER} .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
VERSION=v1.0
REPO=10.100.179.231:5000
REPO=10.100.4.250:5000
DOCKER="${REPO}/cassandra:${VERSION}"

docker build -t ${DOCKER} .
Expand Down
1 change: 1 addition & 0 deletions pet-race-devops/docker/pet-race-ui-dev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.war
18 changes: 18 additions & 0 deletions pet-race-devops/docker/pet-race-ui-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM gcr.io/aronchick-apollobit/google-debian-openjdk8:v1.0

ADD *.war /app.war
CMD ["/dumb-init", "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.war", "--spring.profiles.active=${SPRING_PROFILE:-prod}"]
62 changes: 62 additions & 0 deletions pet-race-devops/docker/pet-race-ui-dev/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
VERSION=v1.1

usage() {
echo "Usage: $0 [-p]" 1>&2;
echo " -p PROJECT_ID"
echo " -d will deploy to gcr.io"
echo " -r REPO_IP will overide gcr.io and deploy docker to local repo"
exit 1;
}

if [ $? != 0 ] ; then usage ; fi

while getopts "p:hdr:" o; do
case "${o}" in
p)
PROJECT_ID=${OPTARG}
;;
r)
REPO_URL=${OPTARG}
;;
d)
DEPLOY=true
;;
h)
usage
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "$PROJECT_ID" ]; then
usage
fi


REPO=gcr.io/$PROJECT_ID

if [ $REPO_URL ]; then
REPO=$REPO_URL/$PROJECT_ID
fi

DOCKER="${REPO}/${PWD##*/}:${VERSION}"

if [ ! -f app.war ]; then
echo "war not found for build"
exit 0
fi

docker build -t ${DOCKER} .

echo $DEPLOY
if [ "${DEPLOY}" ]; then

if [ -z $REPO_URL ]; then
gcloud docker push ${DOCKER}
else
docker push ${DOCKER}
fi
fi
2 changes: 1 addition & 1 deletion pet-race-devops/docker/pet-race-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
FROM gcr.io/aronchick-apollobit/google-debian-openjdk8:v1.0

ADD *.war /app.war
CMD ["/dumb-init", "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.war", "--spring.profiles.active=prod"]
CMD ["/dumb-init", "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/app.war", "--spring.profiles.active=${SPRING_PROFILE:-prod}"]
32 changes: 24 additions & 8 deletions pet-race-devops/docker/pet-race-ui/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,45 @@ VERSION=v1.1

usage() {
echo "Usage: $0 [-p]" 1>&2;
echo " -p PROJECT_ID -d"
echo " -p PROJECT_ID"
echo " -d will deploy to gcr.io"
echo " -r REPO_IP will overide gcr.io and deploy docker to local repo"
exit 1;
}

if [ $? != 0 ] ; then usage ; fi

while getopts "p:hd" o; do
while getopts "p:hdr:" o; do
case "${o}" in
p)
PROJECT_ID=${OPTARG}
;;
r)
REPO_URL=${OPTARG}
;;
d)
DEPLOY=true
;;
h)
usage
;;
usage
;;
*)
usage
;;
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "$PROJECT_ID" ]; then
usage
fi


REPO=gcr.io/$PROJECT_ID

if [ $REPO_URL ]; then
REPO=$REPO_URL/$PROJECT_ID
fi

DOCKER="${REPO}/${PWD##*/}:${VERSION}"

rm app.war
Expand All @@ -52,8 +63,13 @@ fi
docker build -t ${DOCKER} .

echo $DEPLOY
if [ "$DEPLOY" ]; then
gcloud docker push ${DOCKER}
if [ "${DEPLOY}" ]; then

if [ -z $REPO_URL ]; then
gcloud docker push ${DOCKER}
else
docker push ${DOCKER}
fi
fi

rm app.war
3 changes: 2 additions & 1 deletion pet-race-ui/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"sockjs-client": "1.0.3",
"stomp-websocket": "2.3.4",
"swagger-ui": "2.1.4",
"gentelella": "^1.3.0"
"gentelella": "^1.3.0",
"angular-nvd3": "^1.0.7"
},
"devDependencies": {
"angular-mocks": "1.5.2"
Expand Down

0 comments on commit bd943a5

Please sign in to comment.