Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 1cde072

Browse files
committed
chore(Makefile): Modernize dev/hack deployment
1 parent ea19e45 commit 1cde072

9 files changed

Lines changed: 86 additions & 145 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
manifests/deis-router-rc.tmp.yaml
2-
manifests/deis-router-deployment.tmp.yaml
31
rootfs/opt/router/sbin/router
42
rootfs/opt/router/sbin/router.*
53
vendor/

Makefile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,14 @@ clean: check-docker
6262
full-clean: check-docker
6363
docker images -q ${DEIS_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME} | xargs docker rmi -f
6464

65-
dev-release: docker-build docker-push set-image
66-
67-
set-image:
68-
sed "s#\(image:\) .*#\1 ${IMAGE}#" manifests/deis-${SHORT_NAME}-deployment.yaml > manifests/deis-${SHORT_NAME}-deployment.tmp.yaml
69-
70-
deploy: check-kubectl dev-release
71-
@kubectl describe deployment deis-${SHORT_NAME} --namespace=deis >/dev/null 2>&1; \
72-
if [ $$? -eq 0 ]; then \
73-
kubectl apply -f manifests/deis-${SHORT_NAME}-deployment.tmp.yaml; \
74-
else \
75-
kubectl create -f manifests/deis-${SHORT_NAME}-deployment.tmp.yaml; \
76-
fi
77-
78-
examples:
79-
kubectl create -f manifests/examples.yaml
65+
deploy: check-kubectl docker-build docker-push
66+
kubectl --namespace=deis patch deployment deis-${SHORT_NAME} \
67+
--type='json' \
68+
-p='[ \
69+
{"op": "replace", "path": "/spec/strategy", "value":{"type":"Recreate"}}, \
70+
{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"$(IMAGE)"}, \
71+
{"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value":"Always"} \
72+
]'
8073

8174
test: test-style test-unit test-functional
8275

charts/examples/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: examples
2+
home: https://github.com/deis/router
3+
version: <Will be populated by the ci before publishing the chart>
4+
description: Standalone examples for Deis Router.
5+
maintainers:
6+
- name: Deis Team
7+
email: engineering@deis.com
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: apache
5+
labels:
6+
app: apache
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: apache
12+
template:
13+
metadata:
14+
labels:
15+
app: apache
16+
spec:
17+
containers:
18+
- name: apache
19+
image: httpd
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: apache
5+
labels:
6+
router.deis.io/routable: "true"
7+
app: apache
8+
annotations:
9+
# Demonstrates a subdomain of the router's default domain as well as a fully-qualified domain name
10+
router.deis.io/domains: apache,httpd.example.com
11+
spec:
12+
ports:
13+
- port: 80
14+
protocol: TCP
15+
targetPort: 80
16+
selector:
17+
app: apache
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: nginx
5+
labels:
6+
app: nginx
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: nginx
12+
template:
13+
metadata:
14+
labels:
15+
app: nginx
16+
spec:
17+
containers:
18+
- name: nginx
19+
image: nginx
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx
5+
labels:
6+
router.deis.io/routable: "true"
7+
app: nginx
8+
annotations:
9+
router.deis.io/domains: nginx
10+
spec:
11+
ports:
12+
- port: 80
13+
protocol: TCP
14+
targetPort: 80
15+
selector:
16+
app: nginx

manifests/deis-router-deployment.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

manifests/examples.yaml

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)