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

Tooling - Dynamic service commands enhancment #44

Open
phpsa opened this issue Jun 1, 2023 · 0 comments
Open

Tooling - Dynamic service commands enhancment #44

phpsa opened this issue Jun 1, 2023 · 0 comments

Comments

@phpsa
Copy link

phpsa commented Jun 1, 2023

basic idea:
using your example:

tooling:
  php-version:
    service: :service
    cmd: php -v
    options:
      service:
        default: appserver
        describe: Run php in different service

But switched to something more usefull like composer:

tooling:
  composer:
    service: :service
    cmd: php -v
    options:
      service:
        default: appserver
        describe: Run composer in different service

Issue is that i need to trigger the correct composer based on the service:
currently core code looks for the dir in the tool -- which does not help,
could the method in the lando tooling utils do something like:

exports.buildCommand = (app, command, service, user, env = {}, dir = undefined) => ({
  id: `${app.project}_${service}_1`,
  compose: app.compose,
  project: app.project,
  cmd: command,
  opts: {
    environment: getCliEnvironment(env),
    mode: 'attach',
    workdir: dir || getServicePath(service) || getContainerPath(app.root),
    user: (user === null) ? getUser(service, app.info) : user,
    services: _.compact([service]),
    hijack: false,
    autoRemove: true,
  },
});

Thereby reading the dir option on the service definition?

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