Initial version of the manual creation of templates in the project#43
Initial version of the manual creation of templates in the project#43
Conversation
createtemplates.sh
Outdated
|
|
||
| # console url | ||
| BASE_URL="https://console.stage.rafay.dev" | ||
| API_KEY="ra2.aca8acd81c49fa393364ab744574a6d5386ec7f6.46166dc1e95bc8c12670999c93d02d4285bd02b33f1a317a8d737701810dd7b7" |
There was a problem hiding this comment.
Remove this API KEY.
Pass as environment variable or take is as input.
| #"terraform/vcluster/101-caas" | ||
| #"terraform/vmware/101-caas-vmware" | ||
| #"terraform/waas/101-waas" | ||
| ) |
There was a problem hiding this comment.
Are we planning to import these templates as well?
repository_template.json
Outdated
| }, | ||
| "spec": { | ||
| "repositoryType": "GitRepository", | ||
| "endpoint": "https://github.com/RafaySystems/rafay-ai-templates", |
There was a problem hiding this comment.
Is this correct endpoint?
createtemplates.sh
Outdated
| #!/bin/bash | ||
|
|
||
| # console url | ||
| BASE_URL="https://console.stage.rafay.dev" |
There was a problem hiding this comment.
Pass as environment variable or take is as input.
| # POST request for HUB apis | ||
| function make_get_request_new { | ||
| local endpoint="$1" | ||
| curl -s -X GET -H "Accept */*" -H "X-API-KEY: ${API_KEY}" "${BASE_URL}/${endpoint}" |
There was a problem hiding this comment.
Should we do some error handling for all the API requests to make it easier to debug in case of failure?
createtemplates.sh
Outdated
| yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json | ||
|
|
||
| #echo "Creating configcontext" | ||
| #jq --arg repo_name "$REPO_NAME" '(.spec.repositoryOptions.name |= $repo_name) | del(.spec.agents, .spec.contexts)' $PWD/$folder/setup/templates/$fName.json > $PWD/$folder/setup/templates/$fName.json1 |
createtemplates.sh
Outdated
|
|
||
| yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json | ||
|
|
||
| #echo "Creating resource" |
There was a problem hiding this comment.
Remove these commented lines.
createtemplates.sh
Outdated
|
|
||
| yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json | ||
|
|
||
| #echo "Creating environment template" |
There was a problem hiding this comment.
Remove these commented lines.
| printf -- "\033[32m Info: Rafay spec file for %s - SUCCESS \033[0m\n" "$i"; | ||
| fi | ||
|
|
||
| yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json |
There was a problem hiding this comment.
This script requires few external tools, Can we add something like this here as well?
https://github.com/hardik-rafay/envmgr/blob/main/terraform/aws/101-caas-ecs/setup/setup.sh#L9
createtemplates.sh
Outdated
|
|
||
| # console url | ||
| BASE_URL="https://console.stage.rafay.dev" | ||
| API_KEY="<APIKEY>" |
There was a problem hiding this comment.
As the utility is purely dependent on the APIKey being given , would'nt it be better to get a confirmation from user who is running this, saying here is the org that templates will be boostrapped and on confirmation continue ?
rkd-rafay
left a comment
There was a problem hiding this comment.
Added values.yaml to pass the values
| #"terraform/vcluster/101-caas" | ||
| #"terraform/vmware/101-caas-vmware" | ||
| #"terraform/waas/101-waas" | ||
| ) |
| printf -- "\033[32m Info: Rafay spec file for %s - SUCCESS \033[0m\n" "$i"; | ||
| fi | ||
|
|
||
| yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json |
Initial version of the manual creation of templates in the project