-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow building lesson using GitLab Pages #521
base: gh-pages
Are you sure you want to change the base?
Conversation
With regards to the maintenance aspect that @maxim-belkin mentioned in carpentries/lesson-example#317, the contribution guidelines don't currently cover how to proceed beyond GitHub, so I'm not sure. The path of least effort would be to rely on end users that are interested in using this feature. If it breaks we would expect contributions to correct it. We could also add a comment to the file with additional information or a link to relevant documentation. Beyond this there are several, more elaborate, options:
|
I think expanding our CI capabilities is a good thing and it'd be great if we can make our template work with GitLab.
So, all in all, I'm +1 for adding bits and pieces for GitLab CI but we need to make sure it works and implement a way to test it when needed. |
For According to https://github.com/jekyll/github-metadata/blob/master/docs/site.github.md there's quite a bit of metadata in this variable. |
49ba964
to
bb8e812
Compare
Gemfile
Outdated
group :jekyll_plugins do | ||
gem 'github-pages' | ||
# Allows accessing ENV variables in CI environments | ||
gem 'jekyll-environment-variables' |
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.
I guess this gem is necessary on GitLab only. If so, could you please make it depend on whether it's executed in GitLab? You can do so by appending if ENV["SOME_GITLAB_VAR"]
to the end of the line.
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.
Apologies, only saw this comment after mine below.
Would it be ok to use the same approach to only load the first plugin if running in GitHub?
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.
To be precise, if ENV["GITHUB_ACTIONS"]
which according to GitHub Actions environment variables is only set when GitHub Actions is running a workflow.
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.
In fact, the jekyll-environment-variables
plugin might be useful in GitHub Actions too if wanting to access any of the env variables mentioned in the previous comment.
This plugin is very small so its impact should be minimal.
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.
Apologies, only saw this comment after mine below.
Would it be ok to use the same approach to only load the first plugin if running in GitHub?
Hum.. this won't work. Making both plugins conditional causes jekyll to not be installed at all.
Trying to revive this PR but running into some obstacles:
However, this plugin only seems to work if I disable Note that this was tested locally by using
With this I'm not sure how to proceed. It looks like the only option is to conditionally enable the Any suggestions on how to proceed? For reference, at the time of testing the two plugins were versions:
|
Looking into the Unfortunately, without disabling it and explicitly listing all the plugins that are necessary, I don't see how to make it possible to build elsewhere. 😖 EDIT 1: Some light at the end of the tunnel, seems like it's possible to bypass the plugin whitelist by setting EDIT 2: Doesn't seem to work. No |
Allows inclusion of gems that will be relevant in other CIs such as GitLab. See pull request carpentries#521 for additional context
Allows inclusion of gems that will be relevant in other CIs such as GitLab. See pull request carpentries#521 for additional context
To summarize:
I've pushed an alternative solution that makes the The list is now quite verbose and not all plugins may be necessary but I didn't want to do arbitrary decisions here. The only commented out are dependencies that would be specific to GitHub. |
Allows inclusion of gems that will be relevant in other CIs such as GitLab. See pull request carpentries#521 for additional context
In particular test that the github-pages plugin isn't interfering with reading environment variables
Testing is now included through a GitHub Actions workflow that runs |
Hi @unode, I had a closer look at the way you (propose to) use
I can confirm that I apologize that I don't have time to dig into this further. My general advice is to try to avoid hardcoding a lot of gem versions into the Gemfile. In my local tests I was able to build websites requiring |
@maxim-belkin thanks a lot for taking the time to review the PR and even more to test it. I'm not familiar enough with Ruby and Jekyll so I didn't quite understand the
I understood that disabling the whitelist would make the github-pages plugin more permissive. In your phrasing above I read it in the opposite direction, that is, disabling the whitelist would disallow any whitelisted plugin, effectively making it more restrictive, not less. This would be consistent with my tests but would contrast the quoted text above. I still think that DISABLE_WHITELIST, if working as described above, would be the preferred option, but I failed to achieve this so far. Regarding GitLab Pages, I'm happy to strip other dependencies from the Gemfile and keep only Finally, in what concerns the GitHub Action workflow test. The current workflow uses In the Jekyll example in GitLab Pages docs they use a bare Still on which docker image to use, the Jekyll template repository provided by GitLab uses the |
This commit adds a
.gitlab-ci.yml
file that allows building the lesson on GitLab and deploying to GitLab Pages.GitLab is an alternative to GitHub that supports "on-premise" installation, making it a popular choice for many organizations.
Originally submitted at: carpentries/lesson-example#317