forked from pasientskyhosting/pstr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.go
39 lines (36 loc) · 1.28 KB
/
deploy.go
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
package main
import (
"log"
"text/template"
)
func createDeploy(AppObj App) {
log.Printf("# Deployment for %s-%s-%s\n", application_name, AppObj.Name, build_id)
fp := CreateFH("deploy.yaml")
defer fp.Close()
values := &Deploytmpl{
Application_name: application_name,
Bamboo_deploy_release: bamboo_deploy_release,
Build_id: build_id,
Build_nr: bamboo_buildNumber,
CONSUL_APPLICATION: CONSUL_APPLICATION,
CONSUL_PASSWORD: CONSUL_PASSWORD,
CONSUL_URL: CONSUL_URL,
CONSUL_FULL_URL: CONSUL_FULL_URL,
CONSUL_USERNAME: CONSUL_USERNAME,
CONSUL_ENVIRONMENT: CONSUL_ENVIRONMENT,
Deploy: AppObj,
Deploy_name: application_name + "-" + AppObj.Name + "-" + build_id,
Git_repo: git_repo,
Namespace: deploy_namespace,
NEW_RELIC_LICENSE_KEY: NEW_RELIC_LICENSE_KEY,
NEW_RELIC_API_URL: NEW_RELIC_API_URL,
NEW_RELIC_API_KEY_PASSWORD: NEW_RELIC_API_KEY_PASSWORD,
Ssh_key: ssh_key,
}
t := template.Must(template.ParseFiles("templates/deploy.tmpl"))
err := t.Execute(fp, values)
if err != nil {
log.Fatalf("ERROR: template execution: %s", err)
}
fp.Close()
}