Skip to content

Conversation

ryudoawaru
Copy link
Contributor

This PR makes it possible to support JRuby by setting RUBY_PLATFORM variable.

@@ -20,7 +20,7 @@ variables:
policy: pull

.ruby:
image: ruby:$RUBY_VERSION
image: ${RUBY_PLATFORM}:$RUBY_VERSION
Copy link
Owner

@elct9620 elct9620 Aug 18, 2024

Choose a reason for hiding this comment

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

Prefer to use rules to change it to constraint the value in ruby or jruby

job:
  # ...
  rules:
   - if: $RUBY_PLATFORM == "jruby"
      variables:
          RUBY_IMAGE: jruby

But it may constraint user to use rules

Maybe migrating to GitLab Components will be better for security
https://docs.gitlab.com/ee/ci/components/

Copy link
Owner

Choose a reason for hiding this comment

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

https://docs.gitlab.com/ee/ci/yaml/index.html#specinputs

The spec:inputs seems to work correctly for non-components.

GitLab Component only work for same GitLab server or use mirror (Premium or higher)

@elct9620
Copy link
Owner

It should work:

include:
  remote: https://github.com/elct9620/ruby-gitlab-ci/raw/main/rails.yml
  inputs:
    platform: jruby

However, the docker, javascript, sentry reuse common.yml therefore we have to add inputs for all in the current design.

include:
  - remote: https://github.com/elct9620/ruby-gitlab-ci/raw/main/rails.yml
    inputs:
      platform: jruby
  - remote: https://github.com/elct9620/ruby-gitlab-ci/raw/main/docker.yml
    inputs:
      platform: jruby

To resolve it, we have to remove common.yml dependency on it and make each component standalone.

@elct9620
Copy link
Owner

Due to the platform being designed for Ruby. We may rename it to ruby_platform and then add js_platform to support deno or other runtimes.

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.

2 participants