forked from dustinvanbuskirk/example-voting-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
53 lines (41 loc) · 1.62 KB
/
codefresh.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
# Used for Initialization of example-voting-app pipelines
version: '1.0'
stages:
- "Prepare Kubernetes Cluster"
- "Deploy Codefresh Pipelines"
steps:
# Clone repository contents
main_clone:
title: Cloning main repository...
type: git-clone
repo: '${{GITHUB_ORG}}/example-voting-app'
git: github
# Set Kubernetes Name Here
SetKubernetesClusterVars:
image: alpine
stage: "Prepare Kubernetes Cluster"
commands:
- cf_export KUBERNETES_CLUSTER_NAME=${{KUBERNETES_CLUSTER_NAME}} KUBERNETES_NAMESPACE=${{KUBERNETES_NAMESPACE}}
# Create 'codefresh-demo' Kubernetes Namespace
CreateCodefreshDemoNamespace:
image: codefresh/cfstep-helm
stage: "Prepare Kubernetes Cluster"
commands:
- kubectl config use-context '${{KUBERNETES_CLUSTER_NAME}}'
- kubectl create namespace ${{KUBERNETES_NAMESPACE}}
# Create Image Pull Secret
CreateImagePullSecret:
image: codefresh/cli
stage: "Prepare Kubernetes Cluster"
commands:
- codefresh generate image-pull-secret --cluster '${{KUBERNETES_CLUSTER_NAME}}' --namespace ${{KUBERNETES_NAMESPACE}} --registry cfcr
# Replace CF_REPO_OWNER, KUBERNETES_CLUSTER_NAME and KUBERNETES_NAMESPACE in specs files and Deploy Pipelines
CreateCodefreshPipelines:
image: codefresh/cli
stage: "Deploy Codefresh Pipelines"
working_directory: ./.codefresh/specs
commands:
- sed -i 's/CF_REPO_OWNER/${{GITHUB_ORG}}/g' *
- sed -i 's/KUBERNETES_CLUSTER_NAME/${{KUBERNETES_CLUSTER_NAME}}/g' *
- sed -i 's/KUBERNETES_NAMESPACE/${{KUBERNETES_NAMESPACE}}/g' *
- find . -iname '*.yaml' -exec codefresh create -f {} \;