这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@josegonzalez
Copy link
Member

@josegonzalez josegonzalez commented Jun 12, 2016

Problem

Whenever we call a dokku subshell, the DOKKU_APP_NAME arg persists. As the official remote client uses --app functionality, the following will break a bit:

dokku couchdb:link service-name # run locally from a dokku app

Why does it break? The above call is translated to the following:

dokku --app APP couchdb:link service-name

Which then will do weird stuff if you call a subshell (as we do for docker-options and config set) within the couchdb plugin:

# this is called
dokku config:set APP KEY=VALUE

# but since we have `DOKKU_APP_NAME` set, the `dokku` binary turns that into this:
dokku config:set APP APP KEY=VALUE

Solution

Rather than sometimes calling the dokku binary and sometimes not, I figure we should move to calling the sourced functions directly so that we standardize on one way of doing things.

The alternative would be to always set DOKKU_APP_NAME to an empty string when calling a dokku sub-shell, which we'll totally forget to do.

Implementation

  • removes the following CLI commands
    • dokku build
    • dokku receive
    • dokku release
    • dokku tar:build
    • dokku tar:build-locked
    • dokku git:build
    • dokku git:build-locked
  • implements a central locking function for use in both git and tar plugins
  • calls aforementioned locking function in receive-app trigger in given receiving plugin

Closes #2166

source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
Copy link
Member

Choose a reason for hiding this comment

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

Should a user be able to disable the proxy meta plugin?

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory they should be able to use whatever plugin implementation instead of this proxy one. Only the common and standard plugins are not overrideable.

Copy link
Member

Choose a reason for hiding this comment

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

This plugin isn't a proxy implementation. It's the interface plugin to call the configured proxy plugin.

@josegonzalez josegonzalez force-pushed the 2166-avoid-calling-dokku branch 2 times, most recently from fd9e84f to 484fd7a Compare June 13, 2016 01:15
@josegonzalez
Copy link
Member Author

I have a bit of work to do here to make sure I call everything properly, so don't merge this yet (even if tests start passing).

@michaelshobbs
Copy link
Member

If you're going to move some *_cmd() functions to a sourceable functions file, why not move them all? I'm unclear as to the reason we would want git/tar cmds sourceable.

@josegonzalez
Copy link
Member Author

The git/tar commands need to be sourceable because things outside of those plugins need to execute them.

@michaelshobbs
Copy link
Member

Example?

else
# shellcheck disable=SC2086
dokku git-build $APP $REV
git_build_cmd $cmd $APP $REV
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to execute the function.

Copy link
Member

Choose a reason for hiding this comment

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

Is there an analog in the tar plugin?

@pltchuong
Copy link
Contributor

I'd love to see this is fixed :)

@josegonzalez
Copy link
Member Author

I have some work to do but this will go out 0.6.x.

@michaelshobbs michaelshobbs force-pushed the 2166-avoid-calling-dokku branch 2 times, most recently from 683d6cc to a2f95c2 Compare June 17, 2016 23:16
@michaelshobbs michaelshobbs force-pushed the 2166-avoid-calling-dokku branch from a2f95c2 to fcefd4a Compare June 17, 2016 23:16
@michaelshobbs
Copy link
Member

Updated initial comment with implementation details. I think this is g2g assuming tests pass. I'll keep an eye on the test run.


- Description:
- Invoked by: `dokku build`
- Invoked by: `dokku_build`
Copy link
Member Author

Choose a reason for hiding this comment

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

We should probably say these are functions within dokku if anything. I would otherwise leave them as is.

@michaelshobbs michaelshobbs merged commit 9d4a288 into master Jun 18, 2016
@michaelshobbs michaelshobbs deleted the 2166-avoid-calling-dokku branch June 18, 2016 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants