Skip to content
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

Calculate CONTENT_URL_PREFIX if not specified and 'content.url' not set in workshops file. #68

Open
GrahamDumpleton opened this issue Feb 25, 2019 · 1 comment

Comments

@GrahamDumpleton
Copy link

If CONTENT_URL_PREFIX is not being set, but WORKSHOPS_URL is, and content.url is not set in the workshop file, calculate what CONTENT_URL_PREFIX would be by using the directory of the URI that specifies the location of the workshop file.

Thus if _workshop.yml file is just:

---
id: "starter-lab"
name: "Starter Lab"

modules:
  activate:
  - lab1

and WORKSHOPS_URL was:

https://someserver/some/path/_workshop.yml

for content.url use:

https://someserver/some/path

Further, if content.url does exist, but includes a relative filename path, append that to the end of the calculated location. Thus if had:

--
id: "starter-lab"
name: "Starter Lab"

content:
    url: ..

modules:
  activate:
  - lab1

would use:

https://someserver/some/path/..

or when normalised:

https://someserver/some

This would make it easier to avoid situations like:

where even though in ocp-3.11 branch it has:

content:
  url: https://raw.githubusercontent.com/openshift-labs/starter-guides/ocp-3.9

which forces people to fix it by setting CONTENT_URL_PREFIX.

That is, it points at ocp-3.9 when should be ocp-3.11. It could instead use .. for content.url and wouldn't have to worry then about it ever needing to be updated.

Note, if it is mean't to work like this in any way I am not seeing it, and get errors when content.url is not set or when putting . as value.

@GrahamDumpleton
Copy link
Author

cc @jorgemoralespou

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

No branches or pull requests

1 participant