Skip to content

Commit 30c6006

Browse files
committed
Add build scripts for frontend and deploy a particular version
1 parent 67038aa commit 30c6006

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

ch11/kubernetes/frontend/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
spec:
2424
containers:
2525
- name: frontend-service
26-
image: thoughts_frontend:latest
26+
image: thoughts_frontend:v3.7
2727
imagePullPolicy: Never
2828
ports:
2929
- containerPort: 8000
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VERSION_SHA=8bee3a8b48638c1f184d084dace3015dd9953b5e
2+
VERSION_NAME=v3.7
3+
docker-compose build --build-arg VERSION_NAME=${VERSION_NAME} --build-arg VERSION_SHA=${VERSION_SHA}
4+
docker tag thoughts_frontend:latest thoughts_frontend:${VERSION_NAME}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VERSION_SHA=`git log --format=format:%H -n 1`
2+
VERSION_NAME=`git describe --tags`
3+
docker-compose build --build-arg VERSION_NAME=${VERSION_NAME} --build-arg VERSION_SHA=${VERSION_SHA}
4+
5+
# tag the resulting image with the version
6+
docker tag thoughts_server:latest thoughts_server:${VERSION_NAME}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Remember to tweak this parameters to point to your IP, as
22
# describred in Chapter 6: Implementing multiple services
3-
THOUGHTS_BACKEND_URL=http://10.0.10.5:8000
4-
USER_BACKEND_URL=http://10.0.10.5:8001
3+
THOUGHTS_BACKEND_URL=http://10.0.10.15:8000
4+
USER_BACKEND_URL=http://10.0.10.15:8001

0 commit comments

Comments
 (0)