-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial version of the manual creation of templates in the project #43
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to import these templates as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
repository_template.json
Outdated
}, | ||
"spec": { | ||
"repositoryType": "GitRepository", | ||
"endpoint": "https://github.com/RafaySystems/rafay-ai-templates", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
createtemplates.sh
Outdated
|
||
# console url | ||
BASE_URL="https://console.stage.rafay.dev" | ||
API_KEY="<APIKEY>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added values.yaml to pass the values
#"terraform/vcluster/101-caas" | ||
#"terraform/vmware/101-caas-vmware" | ||
#"terraform/waas/101-waas" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Initial version of the manual creation of templates in the project