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

wip: ruby provider #6

Closed
wants to merge 1 commit into from
Closed

wip: ruby provider #6

wants to merge 1 commit into from

Conversation

nbw
Copy link
Contributor

@nbw nbw commented Jan 30, 2025

It's not quite there yet and breaks on Ruby install.

  • use bundler to install gems
  • what's the best way to detect a start file?

Notes

  • Wish we used file scanners rather than reading the whole file
  • The ergonomics of writing a plan are a bit complicated. might be hard to others to follow/adopt

References

❯ go run cmd/cli/main.go plan examples/ruby-sinatra
Ruby Version: 3.2
{
  "baseImage": "debian:stable-slim",
  "steps": [
    {
      "name": "packages:mise",
      "commands": [
        {
          "name": "MISE_DATA_DIR",
          "value": "/mise"
        },
        {
          "name": "MISE_CONFIG_DIR",
          "value": "/mise"
        },
        {
          "name": "MISE_INSTALL_PATH",
          "value": "/usr/local/bin/mise"
        },
        {
          "name": "MISE_CACHE_DIR",
          "value": "/mise/cache"
        },
        {
          "path": "/mise/shims"
        },
        {
          "cmd": "sh -c 'apt-get update \u0026\u0026 apt-get install -y ca-certificates curl'",
          "caches": [
            "apt",
            "apt-lists"
          ],
          "customName": "install apt packages: ca-certificates curl"
        },
        {
          "cmd": "sh -c 'curl -fsSL https://mise.run | sh'",
          "caches": [
            "mise"
          ],
          "customName": "install mise"
        },
        {
          "path": "/etc/mise/config.toml",
          "name": "mise.toml",
          "customName": "create mise config"
        },
        {
          "cmd": "sh -c 'mise trust -a \u0026\u0026 mise install'",
          "caches": [
            "mise"
          ],
          "customName": "install mise packages: ruby"
        }
      ],
      "useSecrets": false,
      "outputs": [
        "/mise/shims",
        "/mise/installs",
        "/usr/local/bin/mise",
        "/etc/mise/config.toml",
        "/root/.local/state/mise"
      ],
      "assets": {
        "mise.toml": "[tools]\n  [tools.ruby]\n    version = \"3.2.6\"\n"
      }
    },
    {
      "name": "install",
      "dependsOn": [
        "packages:mise"
      ],
      "commands": [
        {
          "cmd": "gem update --system --no-document"
        },
        {
          "cmd": "gem install -N bundler"
        },
        {
          "src": "Gemfile",
          "dest": "Gemfile"
        },
        {
          "src": "Gemfile.lock",
          "dest": "Gemfile.lock"
        },
        {
          "cmd": "bundle install"
        }
      ]
    }
  ],
  "start": {
    "cmd": "ruby app.rb"
  },
  "caches": {
    "apt": {
      "directory": "/var/cache/apt",
      "type": "locked"
    },
    "apt-lists": {
      "directory": "/var/lib/apt/lists",
      "type": "locked"
    },
    "mise": {
      "directory": "/mise/cache",
      "type": "shared"
    }
  }
}

Copy link

railway-app bot commented Jan 30, 2025

🚅 Previously deployed to Railway in the railpack project. Environment has been deleted.

@nbw
Copy link
Contributor Author

nbw commented Feb 11, 2025

close for now until I have time to revisit it.

@nbw nbw closed this Feb 11, 2025
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.

1 participant