forked from yekki/travel-agency-hotel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
72 lines (63 loc) · 2.09 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
box:
id: python:2.7
ports:
- "5000"
build:
steps:
- script:
name: install python library
code: |
pip install --install-option="--prefix=/pipeline/source/" flask
pip install --install-option="--prefix=/pipeline/source/" flask_cors
- script:
name: check
code: |
ls
push-to-releases:
steps:
# Push to OCI Registry
- internal/docker-push:
tag: $WERCKER_GIT_BRANCH-$WERCKER_GIT_COMMIT
ports: "5000"
cmd: python hotel.py
working-dir: /pipeline/source/
username: $OKE_USERNAME
password: $OKE_PASSWORD
repository: $OKE_REPOSITORY/$WERCKER_APPLICATION_NAME
registry: $OKE_REGISTRY
deploy-to-oke:
box:
id: alpine
cmd: /bin/sh
steps:
- bash-template
- script:
name: "Visualise Kubernetes config"
code: cat kubernetes-deployment.yml
- kubectl:
name: delete namespace
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: delete namespace $APP_HOTEL_NAMESPACE --ignore-not-found=true
- script:
name: wait to delete namespace
code: sleep 60
- kubectl:
name: create namespace
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: create namespace $APP_HOTEL_NAMESPACE
- kubectl:
name: create OCR secret
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: create secret docker-registry ocirsecret --docker-server=iad.ocir.io --docker-username=$OKE_USERNAME --docker-password=$OKE_PASSWORD --docker-email=${WERCKER_APPLICATION_OWNER_NAME}@mail.com --namespace=$APP_HOTEL_NAMESPACE
- kubectl:
name: create deplyoment
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: create -f $WERCKER_ROOT/kubernetes-deployment.yml --namespace=$APP_HOTEL_NAMESPACE