Skip to content
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

DEMO-18 Added a car image for each manufacturer #31

Merged
merged 1 commit into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app_server/src/main/java/com/supercars/Car.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class Car {
private float rating;

public String getPhoto() {
return photo;
// do this as a hack, there is only 1 car photo per manufacturer DEMO-18
return Integer.toString(getManufacturerId());
}

public void setPhoto(String photo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public List<Car> getCarsByManufacturer(int manufacturerId) {
car.setDescription(resultSet.getString("DESCRIPTION"));
car.setPrice(resultSet.getInt("PRICE"));
car.setPhoto(resultSet.getString("PHOTO"));
car.setManufacturerId(manufacturerId);
cars.add(car);
}
resultSet.close();
Expand Down
2 changes: 1 addition & 1 deletion app_server/src/main/webapp/angular/cars.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<table>
<tr class="grey" ng-repeat="car in cars">
<td>
<p><img src="images/manufacturers/{{manufacturer.logo}} "></p>
<p><img width="150" height="100" src="images/cars/{{car.photo}}.jpg "></p>
</td>
<td>
<p class="link" ng-click="carLink(car.carId)"/>{{car.model}}&nbsp;{{car.name}}&nbsp;{{car.summary}}</p>
Expand Down
Binary file removed app_server/src/main/webapp/angular/images/cars/0.gif
Binary file not shown.
Binary file removed app_server/src/main/webapp/angular/images/cars/0.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified app_server/src/main/webapp/angular/images/cars/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified app_server/src/main/webapp/angular/images/cars/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified app_server/src/main/webapp/angular/images/cars/4.jpg
Binary file modified app_server/src/main/webapp/angular/images/cars/5.jpg
Binary file modified app_server/src/main/webapp/angular/images/cars/6.jpg
Binary file modified app_server/src/main/webapp/angular/images/cars/7.jpg
Binary file modified app_server/src/main/webapp/angular/images/cars/8.jpg
Diff not rendered.
2 changes: 1 addition & 1 deletion kubernetes/cars_app-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
spec:
containers:
- name: app-server
image: tombatchelor/cars:2.4-leak
image: tombatchelor/cars:2.5-leak
imagePullPolicy: Always
ports:
- name: cars-app-port
Expand Down
82 changes: 1 addition & 81 deletions kubernetes/cars_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
spec:
containers:
- name: app-server
image: tombatchelor/cars:2.4-leak
image: tombatchelor/cars:2.5-leak
imagePullPolicy: Always
ports:
- name: cars-app-port
Expand Down Expand Up @@ -258,86 +258,6 @@ spec:
key: bucket.name
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 2leak
spec:
schedule: "0 0,4,8,12,16,20 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 2leak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 2_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 4leak
spec:
schedule: "0 1,5,9,13,17,21 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 4leak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 4_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 4noleak
spec:
schedule: "0 2,6,10,14,18,22 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 4noleak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 4_no_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 2noleak
spec:
schedule: "0 3,7,11,15,19,23 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 2noleak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 2_no_leak
restartPolicy: OnFailure
---
apiVersion: v1
kind: Service
metadata:
Expand Down
79 changes: 79 additions & 0 deletions kubernetes/cron_jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 2leak
spec:
schedule: "0 0,4,8,12,16,20 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 2leak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 2_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 4leak
spec:
schedule: "0 1,5,9,13,17,21 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 4leak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 4_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 4noleak
spec:
schedule: "0 2,6,10,14,18,22 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 4noleak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 4_no_leak
restartPolicy: OnFailure
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: 2noleak
spec:
schedule: "0 3,7,11,15,19,23 * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: marshaller
containers:
- name: 2noleak
imagePullPolicy: Always
image: tombatchelor/demo_marshaller:2.5
env:
- name: NEW_YAML
value: 2_no_leak
restartPolicy: OnFailure