• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

the default GitOps source repository for booting up Jenkins X


Commit MetaInfo

Révisione46f7aff732be2ac55e2f172436e32add6ecdf1b (tree)
l'heure2019-09-12 21:57:00
AuteurCai Cooper <caicooper82@gmai...>
CommiterCai Cooper

Message de Log

feat: script which upserts domains for testing

Signed-off-by: Cai Cooper <caicooper82@gmail.com>

Change Summary

Modification

--- /dev/null
+++ b/bdd/upsert_bdd_domains.sh
@@ -0,0 +1,61 @@
1+#!/usr/bin/env bash
2+
3+BDD_PROJECT="jenkins-x-bdd3"
4+PARENT_PROJECT="jenkins-x-rocks"
5+PREFIXES=("boot" "boot1" "boot2" "boot3" "boot4" "boot5" "boot6" "boot7" "boot8" "boot9" "boot10" "boot11" "boot12")
6+SUBDOMAIN="bdd.jenkins-x.rocks"
7+
8+function does_subdomain_exist()
9+{
10+ local domain=$1
11+ gcloud dns managed-zones --project=$BDD_PROJECT list --filter=$domain --format=json | jq length
12+}
13+
14+function get_domain_nameservers()
15+{
16+ local domain=$1
17+ local project=$2
18+ gcloud dns managed-zones --project=$project list --filter=$domain --format=json | jq .[].nameServers
19+}
20+
21+function get_recordset_nameservers()
22+{
23+ #TODO
24+ echo "TODO"
25+}
26+
27+function create_subdomain()
28+{
29+ local domain=$1
30+ gcloud dns managed-zones --project=$BDD_PROJECT create "${domain//\./-}" --dns-name "${domain}." --description="managed-zone for bdd tests"
31+}
32+
33+function create_recordset_ns_entry()
34+{
35+ #TODO
36+ echo "TODO"
37+}
38+
39+function create_managed_zone()
40+{
41+ #TODO
42+ echo "TODO"
43+}
44+
45+for prefix in "${PREFIXES[@]}"
46+do
47+ domain="${prefix}.${SUBDOMAIN}"
48+ exists=$(does_subdomain_exist "${domain}")
49+
50+ if [[ $exists -eq 0 ]]
51+ then
52+ echo "$domain doesn't exist"
53+ #create_subdomain "${domain}"
54+ else
55+ echo "$domain exists"
56+ child_nameservers="$(get_domain_nameservers "${domain}" "${BDD_PROJECT}")"
57+ parent_nameservers="$(get_recordset_nameservers "${domain}" "${PARENT_PROJECT}")"
58+ echo "${child_nameservers}"
59+ fi
60+done
61+