deploy #5
4 changed files with 24 additions and 7 deletions
20
.drone.yml
20
.drone.yml
|
@ -48,7 +48,7 @@ steps:
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: kleph/beer
|
repo: kleph/beer
|
||||||
tags: latest
|
tags: ${DRONE_COMMIT_SHA:0:8}
|
||||||
username:
|
username:
|
||||||
from_secret: dockerhub_username
|
from_secret: dockerhub_username
|
||||||
password:
|
password:
|
||||||
|
@ -71,11 +71,25 @@ steps:
|
||||||
from_secret: kubectl_cert
|
from_secret: kubectl_cert
|
||||||
kubernetes_token:
|
kubernetes_token:
|
||||||
from_secret: kubectl_token
|
from_secret: kubectl_token
|
||||||
|
environment:
|
||||||
|
IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8}
|
||||||
|
NAMESPACE: beer
|
||||||
commands:
|
commands:
|
||||||
|
- echo "== pre deploy status:"
|
||||||
- kubectl get pods --namespace=beer
|
- kubectl get pods --namespace=beer
|
||||||
- kubectl get deployments --namespace=beer
|
- kubectl get deployments --namespace=beer
|
||||||
- kubectl get svc --namespace=beer
|
- sed "s/__NAMESPACE__/$${NAMESPACE}/g" kube/beer-deployment.yaml > kube/beer-deployment-prod.yaml
|
||||||
- kubectl apply -f kube/beer-deployment.yaml --namespace=beer
|
- sed "s/__IMAGE_TAG__/$${IMAGE_TAG}/g" kube/beer-deployment-prod.yaml > kube/beer-deployment-prod2.yaml
|
||||||
|
- echo "applying"
|
||||||
|
- kubectl apply -f kube/beer-deployment-prod2.yaml --namespace=beer
|
||||||
|
- echo "== post deploy status:"
|
||||||
|
- kubectl get deployments --namespace=beer
|
||||||
|
- kubectl get pods --namespace=beer
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
|
|
@ -4,3 +4,6 @@ extends: default
|
||||||
rules:
|
rules:
|
||||||
indentation:
|
indentation:
|
||||||
indent-sequences: consistent
|
indent-sequences: consistent
|
||||||
|
line-length:
|
||||||
|
max: 120
|
||||||
|
level: warning
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: beer-deployment
|
name: beer-deployment
|
||||||
namespace: beer
|
namespace: __NAMESPACE__
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
@ -16,7 +16,7 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: beer
|
- name: beer
|
||||||
image: kleph/beer
|
image: kleph/beer:__IMAGE_TAG__
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5000
|
- containerPort: 5000
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: beer
|
name: __NAMESPACE__
|
||||||
labels:
|
labels:
|
||||||
name: beer
|
name: __NAMESPACE__
|
||||||
|
|
Loading…
Reference in a new issue