forked from pulumi/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_all_resource_docs.sh
executable file
·112 lines (104 loc) · 2.25 KB
/
gen_all_resource_docs.sh
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# A script to generate the schema-based resource docs for all of the providers for which we can generate
# a Pulumi schema.
# Pass true to the script as the first argument to indicate that you
# also this script to commit each provider's docs changes automatically.
GIT_COMMIT=${1:-}
# Adding a new repo to this list? Ensure that the repo's `Makefile` has a target called
# `generate_schema`.
REPOS=(
"aiven"
"akamai"
"alicloud"
"auth0"
"aws"
"aws-native"
"azure"
"azure-native"
"azuread"
"azuredevops"
"civo"
"cloudamqp"
"cloudflare"
"cloudinit"
"confluent"
"consul"
"datadog"
"digitalocean"
"dnsimple"
"docker"
"ec"
"eks"
"equinix-metal"
"fastly"
"f5bigip"
"gcp"
"google-native"
"github"
"gitlab"
"hcloud"
"kafka"
"kubernetes"
"keycloak"
"kong"
"libvirt"
"linode"
"mailgun"
"minio"
"mongodbatlas"
"mysql"
"newrelic"
"nomad"
"ns1"
"okta"
"onelogin"
"openstack"
"opsgenie"
"packet"
"pagerduty"
"postgresql"
"rabbitmq"
"rancher2"
"random"
"rke"
"signalfx"
"snowflake"
"splunk"
"spotinst"
"sumologic"
"tailscale"
"tls"
"vault"
"venafi"
"vsphere"
"wavefront"
"yandex"
)
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" = "master" ]; then
echo "Cannot generate docs while in the master branch. Please create a new branch and then try again."
exit 1
fi
for REPO in "${REPOS[@]}" ; do \
./scripts/gen_resource_docs.sh "${REPO}" true
./scripts/gen_package_metadata.sh "${REPO}"
if [ "${GIT_COMMIT:-}" == "true" ]; then
git add "./content/docs/reference/pkg/${REPO}/*"
git add "./content/docs/reference/pkg/${REPO}/**/*"
git commit -am "Generate resource docs for pulumi-${REPO}"
fi
done
if [ "${GIT_COMMIT:-}" == "true" ]; then
while true; do
read -r -p "Push commits to origin?" yn
case $yn in
[Yy]* )
echo "Pushing ${branch} to origin..."
git push origin "${branch}"
break
;;
[Nn]* ) echo "Exiting. You said No."; exit;;
* ) echo "Please answer yes or no.";;
esac
done
fi