Closed jraviotta closed 5 years ago
I was able to place my local .gitconfig
file in the container by specifying a bind mounted volume in the terminus container as such:
terminus:
image: quay.io/pantheon-public/build-tools-ci # https://github.com/savaslabs/terminus-docker
container_name: "${PROJECT_NAME}_terminus"
env_file:
- .env-private
command: |
sh -c "
mkdir -p /terminus/cache/tokens
terminus auth:login --machine-token=$$TERMINUS_TOKEN
tail -f /dev/null
"
volumes:
- terminus-data:/terminus/cache
- ${HOME}/.gitconfig:/root/.gitconfig:ro
Terminus wanted a password for git, so I also had to set ssh as the default in my local global .gitconfig with:
git config --global url.ssh://git@github.com/.insteadOf https://github.com/
This got me to the point of committing to pantheon where i was prompted to add the RSA key fingerprint to known hosts. Entering 'yes' led to codeserver.dev requesting drush.in's password. I'm not sure how to get around those prompts.
This looks like an interesting experiment, but this is not a supported use for this container. If you still have issues, try reaching out in the #composer-workflow channel of the Pantheon slack server.
I have successfully included the docker image from Quay in my docker4drupal app with the following docker-compose file that references valid variables in a .env file.
I can call terminus and initiate a build with the following command:
Terminus asks for password and agency then fails with:
I can override the error by setting
--email=<myemail>@provider.com
and the build proceeds until the git commit which fails with the same message.It appears that Terminus is looking for the active use by examining the global .gitconfig file. Since the container is running the process, no global git information is available. I have tried generating the file with
git config --global user.email xxxx
using the container's shell, but no file is created. Similarly, usinggit config user.email xxxx
in the container's shared volume has no effect. I do have a global config locally.Is it possible to pass the user information with an environment variable instead?