Skip to content

Commit

Permalink
Add site assets in to image and remove the need to mount persistent s…
Browse files Browse the repository at this point in the history
…torage.

Assets now stored in Google Storage and copied in to the workspace by the builder script. Docker file then copies these in to the image.

Remove no defunct sites from footer
  • Loading branch information
pjverity committed Sep 26, 2020
1 parent f73ec61 commit cafdce2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!Dockerfile
!target/
!assets/
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ EXPOSE 8080
ARG ARTIFACT_VERSION

ENV ARTIFACT reigate-mens-joggers-${ARTIFACT_VERSION}.war
ENV DATABASE_HOST=postgres DATABASE_NAME=rmj EXTERNAL_STATIC_ASSETS_PATH=/mnt/tomcat/sites/rmj
ENV DATABASE_HOST=postgres DATABASE_NAME=rmj EXTERNAL_STATIC_ASSETS_PATH=/usr/local/assets

WORKDIR /usr/local

COPY /target/${ARTIFACT} .
COPY assets/images/* /usr/local/assets/images/

RUN chown clubbedapp:clubbed ${ARTIFACT}

Expand Down
2 changes: 2 additions & 0 deletions cloudbuild-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
steps:
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'gs://artifacts.${PROJECT_ID}.appspot.com/site-assets/reigate-mens-joggers/*', './assets']
- name: 'gcr.io/cloud-builders/docker'
args: ['run', '-v', '/workspace:/usr/build', '-w', '/usr/build', 'maven:3.6.0-jdk-11-slim', 'mvn', 'clean', 'package']
- name: 'gcr.io/cloud-builders/docker'
Expand Down
2 changes: 2 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
steps:
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'gs://artifacts.${PROJECT_ID}.appspot.com/site-assets/reigate-mens-joggers/*', './assets']
- name: 'gcr.io/cloud-builders/docker'
args: ['run', '-v', '/workspace:/usr/build', '-w', '/usr/build', 'maven:3.6.0-jdk-11-slim', 'mvn', 'clean', 'package']
- name: 'gcr.io/cloud-builders/docker'
Expand Down
9 changes: 1 addition & 8 deletions deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ spec:
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /mnt/
name: tomcat-storage
ports:
- containerPort: 8080
protocol: TCP
Expand Down Expand Up @@ -59,8 +56,4 @@ spec:
valueFrom:
secretKeyRef:
name: flickr-key
key: api-key
volumes:
- name: tomcat-storage
persistentVolumeClaim:
claimName: tomcat-pv-claim
key: api-key
3 changes: 0 additions & 3 deletions src/main/webapp/WEB-INF/jsp/footer-common.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<ul class="list-unstyled">
<li><a href="http://www.caterhamladiesjoggers.co.uk">Caterham</a></li>
<li><a href="http://www.reigateladiesjoggers.co.uk">Reigate</a></li>
<li><a href="http://www.dorkingladiesjoggers.co.uk">Dorking</a></li>
<li><a href="http://www.horshamladiesjoggers.co.uk">Horsham</a></li>
<li><a href="http://www.oxtedladiesjoggers.co.uk">Oxted</a></li>
</ul>
<a href='/world/privacy-policy'>Our Privacy Policy</a>
</div>
Expand Down

0 comments on commit cafdce2

Please sign in to comment.