Skip to content

Commit

Permalink
Initial Kubernetes support
Browse files Browse the repository at this point in the history
  • Loading branch information
David Currie authored and mezarin committed Oct 9, 2017
1 parent 3ad9875 commit 455158c
Show file tree
Hide file tree
Showing 17 changed files with 439 additions and 15 deletions.
44 changes: 44 additions & 0 deletions docker-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

MONGO_HOSTNAME="mongo"
MONGO_PORT=27017
DOMAIN="default.svc.cluster.local"

mvn -Dmaven.test.skip=true \
-Duser.mongo.hostname=$MONGO_HOSTNAME \
-Duser.mongo.port=$MONGO_PORT \
-Duser.http.port=9080 \
-Duser.https.port=9443 \
-Duser.hostname=user.$DOMAIN \
-Dgroup.mongo.hostname=$MONGO_HOSTNAME \
-Dgroup.mongo.port=$MONGO_PORT \
-Dgroup.http.port=9080 \
-Dgroup.https.port=9443 \
-Dgroup.hostname=group.$DOMAIN \
-Doccasion.mongo.hostname=$MONGO_HOSTNAME \
-Doccasion.mongo.port=$MONGO_PORT \
-Doccasion.http.port=9080 \
-Doccasion.https.port=9443 \
-Doccasion.hostname=occasion.$DOMAIN \
-Dnotification.http.port=9080 \
-Dnotification.https.port=9443 \
-Dnotification.hostname=notification.$DOMAIN \
-Dnotification_1_1.http.port=9080 \
-Dnotification_1_1.https.port=9443 \
-Dnotification_1_1.hostname=notification11.$DOMAIN \
-Dfrontend.http.port=9080 \
-Dfrontend.https.port=9443 \
-Dfrontend.hostname=frontend.$DOMAIN \
-Dauth.http.port=9080 \
-Dauth.https.port=9443 \
-Dauth.hostname=auth.$DOMAIN \
clean package install

NAMESPACE="acmegifts"
docker build -t $NAMESPACE/front-end-ui:latest front-end-ui
docker build -t $NAMESPACE/microservice-auth:latest microservice-auth
docker build -t $NAMESPACE/microservice-group:latest microservice-group
docker build -t $NAMESPACE/microservice-notification:latest microservice-notification
docker build -t $NAMESPACE/microservice-notification-v1-1:latest microservice-notification_v1_1
docker build -t $NAMESPACE/microservice-occasion:latest microservice-occasion
docker build -t $NAMESPACE/microservice-user:latest microservice-user
10 changes: 10 additions & 0 deletions docker-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

NAMESPACE="acmegifts"
docker push $NAMESPACE/front-end-ui:latest
docker push $NAMESPACE/microservice-auth:latest
docker push $NAMESPACE/microservice-group:latest
docker push $NAMESPACE/microservice-notification:latest
docker push $NAMESPACE/microservice-notification-v1-1:latest
docker push $NAMESPACE/microservice-occasion:latest
docker push $NAMESPACE/microservice-user:latest
3 changes: 3 additions & 0 deletions front-end-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM openliberty/open-liberty
COPY target/liberty/wlp/usr/servers/UIServer /config
RUN sed -i -e 's/httpEndpoint/httpEndpoint host="*"/g' /config/server.xml
4 changes: 2 additions & 2 deletions front-end-ui/src/app/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { Observable } from 'rxjs/Rx';
*/
@Injectable()
export class AuthService {
// Maven fills in these variables from the pom.xml
private url = 'https://${auth.hostname}:${auth.https.port}/auth/';

private url = '/service/auth/';

constructor(private http: HttpClient) {}

Expand Down
3 changes: 1 addition & 2 deletions front-end-ui/src/app/group/services/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { Observable } from 'rxjs/Rx';
export class GroupService {
private groups: Group[];

// Maven fills in these variables from the pom.xml
private groupsUrl = 'https://${group.hostname}:${group.https.port}/groups/';
private groupsUrl = '/service/groups/';

constructor(private http: HttpClient) {
if (sessionStorage.jwt == null) {
Expand Down
4 changes: 2 additions & 2 deletions front-end-ui/src/app/login/services/login.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { Observable } from 'rxjs/Rx';

@Injectable()
export class LoginService {
// Maven fills in these variables from the pom.xml
private url = 'https://${user.hostname}:${user.https.port}/logins/';

private url = '/service/logins/';

constructor(private http: HttpClient) { }

Expand Down
7 changes: 3 additions & 4 deletions front-end-ui/src/app/occasion/services/occasion.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ export class OccasionService {

private jwt: string = null;

// Maven fills in these variables from the pom.xml
groupUrl = 'https://${group.hostname}:${group.https.port}/groups/';
occasionUrl = 'https://${occasion.hostname}:${occasion.https.port}/occasions/';
userUrl = 'https://${user.hostname}:${user.https.port}/users/';
groupUrl = '/service/groups/';
occasionUrl = '/service/occasions/';
userUrl = '/service/users/';

createOccasion(occasion: Occasion): Observable<JSON> {
const payload = JSON.stringify(occasion);
Expand Down
5 changes: 2 additions & 3 deletions front-end-ui/src/app/user/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ import { Users } from '../users';
export class UserService {
private users: User[];

// Maven fills in these variables from the pom.xml
private userUrl = 'https://${user.hostname}:${user.https.port}/users/';
private userUrl2 = 'https://${user.hostname}:${user.https.port}/users';
private userUrl = '/service/users/';
private userUrl2 = '/service/users';

constructor(private http: HttpClient) {}

Expand Down
Loading

0 comments on commit 455158c

Please sign in to comment.