Skip to content

Initial version of the manual creation of templates in the project#43

Open
rkd-rafay wants to merge 4 commits into
mainfrom
origin/manualcatalog
Open

Initial version of the manual creation of templates in the project#43
rkd-rafay wants to merge 4 commits into
mainfrom
origin/manualcatalog

Conversation

@rkd-rafay
Copy link
Copy Markdown
Contributor

Initial version of the manual creation of templates in the project

Comment thread createtemplates.sh Outdated

# console url
BASE_URL="https://console.stage.rafay.dev"
API_KEY="ra2.aca8acd81c49fa393364ab744574a6d5386ec7f6.46166dc1e95bc8c12670999c93d02d4285bd02b33f1a317a8d737701810dd7b7"
Copy link
Copy Markdown
Contributor

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.

Comment thread createtemplates.sh
#"terraform/vcluster/101-caas"
#"terraform/vmware/101-caas-vmware"
#"terraform/waas/101-waas"
)
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment thread repository_template.json Outdated
},
"spec": {
"repositoryType": "GitRepository",
"endpoint": "https://github.com/RafaySystems/rafay-ai-templates",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct endpoint?

Comment thread createtemplates.sh Outdated
#!/bin/bash

# console url
BASE_URL="https://console.stage.rafay.dev"
Copy link
Copy Markdown
Contributor

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.

Comment thread createtemplates.sh
# 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}"
Copy link
Copy Markdown
Contributor

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?

Comment thread 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

Comment thread createtemplates.sh Outdated

yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json

#echo "Creating resource"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these commented lines.

Comment thread createtemplates.sh Outdated

yq -o=json $PWD/$folder/setup/templates/$fName.yaml.spec > $PWD/$folder/setup/templates/$fName.json

#echo "Creating environment template"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these commented lines.

Comment thread createtemplates.sh
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
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread createtemplates.sh Outdated

# console url
BASE_URL="https://console.stage.rafay.dev"
API_KEY="<APIKEY>"
Copy link
Copy Markdown

@swami-rafay swami-rafay Mar 12, 2024

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 ?

Copy link
Copy Markdown
Contributor Author

@rkd-rafay rkd-rafay left a 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

Comment thread createtemplates.sh
#"terraform/vcluster/101-caas"
#"terraform/vmware/101-caas-vmware"
#"terraform/waas/101-waas"
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment thread createtemplates.sh
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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants