openshift-evangelists / workshopper

Workshop content rendering tool
63 stars 40 forks source link

[RFE] Accept env variables passed by oc cli #27

Closed samueltauil closed 6 years ago

samueltauil commented 7 years ago

I have a shared OCP cluster that I use to deliver workshops, I previously create 30 users user[0-30] and some lab instructions I would like to generate the commands in the asciidoc using the username instead of getting it from the yaml file, which I would need to change every time I would provision the labs for each user. e.g.

oc new-app osevg/workshopper -e CONTENT_URL_PREFIX="https://raw.githubusercontent.com/samueltauil/openshiftv3-workshop/master" -e WORKSHOPS_URLS="https://raw.githubusercontent.com/samueltauil/openshiftv3-workshop/master/_module_groups.yml" -e USERNAME="user23"

so i could use in my asciidoc the env var USERNAME instead of getting that from yaml _modules.yaml, that way I can do a for loop to increment the user number by the bash command.

jorgemoralespou commented 7 years ago

I think we discussed this before so that workshopper could also sign the user name to the user, set it in a cookie and then display the workshop instructions with the username replaced. This way you could create consecutive users or pre-create the users with some random usernames (in case of using htpasswd authz).

Of course, this would be much more work, but also much more valuable.

marekjelen commented 7 years ago

That actually should work, you can pass any variable through ENV and will have highest priority.

However, the variable has to be already defined in the definition, so that the system knows, that it should look for that name in ENV.