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

manual build and deploy process fails if git user.useConfigOnly option is set #53

Closed
ba66e77 opened this issue May 17, 2016 · 6 comments
Assignees
Labels
Bug Something isn't working

Comments

@ba66e77
Copy link
Contributor

ba66e77 commented May 17, 2016

When git's useConfigOnly option is set and the user.name and user.email is not set globally, running the process to create the build artifact and deploy it as defined in the deploy instructions fails with the error below.

project > deploy:artifact:commit:

fatal: user.useConfigOnly set but no name given fatal: user.useConfigOnly set but no name given

Setting the user config in the deploy directory does not successfully work around the problem since the deploy directory is wiped out each time as the first step in the deploy:artifact:prepare-dir step.

@ba66e77
Copy link
Contributor Author

ba66e77 commented May 18, 2016

As an attempt at a workaround, I tried the following process and while it worked to push code, the site is failing because the vendor directory is gitignored in the deploy directory, so isn't committed and pushed to the target repo.

  • ./bolt.sh deploy:artifact:build
  • added my user creds to git config of deploy dir
  • ./bolt.sh deploy:artifact:commit -Ddeploy.commitMsg="--commit message---"
  • ./bolt.sh deploy:artifact:push-all -Ddeploy.branch='--target branch name--'

@grasmash
Copy link
Contributor

Hm. This is a tricky problem.

We've found that it's best to wipe out the deploy directory prior to generating the artifact, since it's the only way to ensure a clean build.

I'm thinking the only two options are:

  1. Don't wipe out the deploy dir. This would allow your manually git config to persist, but the steps necessary feel ugly.
  2. Allow git username and email to be configurable by Bolt. This is a bit tough because it's local machine specific, and cannot be committed to the repo. We'd need to re-introduce a local.yml file. @danepowell @geerlingguy I feel like we had other reasons to consider re-introducing a local.yml. I like keeping the number of config files to a minimum, but I'm open to input!

@danepowell
Copy link
Contributor

danepowell commented May 20, 2016

Preserving the deploy/.git directory isn't a crazy idea. In fact it ties in nicely to #22. So both of these issues could probably be solved together.

I don't think I want to build in specific support for a git username and email, since it really seems like an edge case. Deploys are typically run from a CI tool, and I can't imagine a scenario where a dedicated CI tool needs to support multiple Git identities for deployments. Feel free to prove me wrong though.

@grasmash grasmash added the Bug Something isn't working label Aug 17, 2016
@danepowell
Copy link
Contributor

Well, #22 was solved differently, I agree with Matt that preserving the .git directory isn't the best solution to this.

My recommendation would be to support two new arguments (git.email and git.username or something) that deploy:commit uses. And these could be added to project.local.yml.

@ba66e77 is this still a requirement for you?

@ba66e77
Copy link
Contributor Author

ba66e77 commented Mar 30, 2017

Yes, it still is. I've swallowed my pride and removed the useConfigOnly option in order to work around it, but that causes its own set of issues. I'd dearly love if this could be supported somehow.

Setting the new arguments you mentioned in the project.local.yml certainly seems viable to me.

danepowell added a commit to danepowell/blt that referenced this issue Apr 5, 2017
danepowell added a commit to danepowell/blt that referenced this issue Apr 5, 2017
danepowell added a commit to danepowell/blt that referenced this issue Apr 5, 2017
@danepowell
Copy link
Contributor

@ba66e77 feel like testing #1323?

You can apply it as a patch to an existing project like so: https://patch-diff.githubusercontent.com/raw/acquia/blt/pull/1323.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants