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

Conversation

@michaelshobbs
Copy link
Member

rebuilds an app using the same functionality as a regular deploy and thus supports git submodules. comments welcome!

Copy link
Member

Choose a reason for hiding this comment

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

Why this removal?

Copy link
Member Author

Choose a reason for hiding this comment

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

When running locally from a directory that the dokku user didn't have access to, it would cause the deployment to fail because of pipefail. Additionally, it was unnecessary as it was being executed in a subshell anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the command be re-executed as the dokku user via the dokku command?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is and that seems to be the issue. Try adding that line back without the > /dev/null and running ps:rebuild <app> from ~root/dokku. It throws /var/lib/dokku/plugins/git/commands: line 16: popd: /root/dokku: Permission denied

Basically we pushd $TMP_WORK_DIR as the dokku user and that puts ~root/dokku on the stack. Then popd as dokku fails to cd back to ~root/dokku.

@vincentfretin
Copy link
Contributor

@michaelshobbs Did you look at the dokku-alt implementation?
https://github.com/dokku-alt/dokku-alt/blob/master/plugins/dokku-rebuild/commands
There is a lock implemented there with flock to not rebuild an app if it is currently building. This is interesting.

@michaelshobbs
Copy link
Member Author

@vincentfretin 👍 I'll take a look at implementing something similar

@michaelshobbs
Copy link
Member Author

Ugh. I really don't like that locked/unlocked case pattern....I want to noodle on this a bit. Any additional thoughts are surely welcomed.

@josegonzalez
Copy link
Member

Why don't you like the locking pattern?

@michaelshobbs
Copy link
Member Author

To clarify, I like flock. I don't like the way they have the function and function:locked pattern in their case statements all over the place. Just looks messy and then exposes all of that to the end user. However, I don't have a better idea at the moment.

I'm about to push up a functional implementation that uses a similar function/function:locked pattern but in a very limited scope. I wanted to try and put the locking in as little areas as possible to avoid unnecessary complexity.

Please bang on it and rip it to shreds if its crap.

@josegonzalez
Copy link
Member

👍 feel free to merge when ready :)

michaelshobbs added a commit that referenced this pull request Feb 3, 2015
implement rebuild command that reuses git_archive_all
@michaelshobbs michaelshobbs merged commit b48464a into master Feb 3, 2015
@michaelshobbs michaelshobbs deleted the mh-ps-rebuild branch February 3, 2015 22:56
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.

4 participants