git_config settings doesn't applied
I have git_config option in git resource. And no one option seems to be applied.
How to reproduce
Assume the following pipeline config saved to git-config.yml:
resources:
- name: repo
type: git
icon: github
source:
uri: [email protected]:maestrow/concourse-examples.git
private_key: |
-----BEGIN OPENSSH PRIVATE KEY-----
-----END OPENSSH PRIVATE KEY-----
branch: master
git_config:
- name: user.name
value: conc
- name: user.email
value: [email protected]
- name: core.bigFileThreshold
value: 10m
jobs:
- name: git_config_job
plan:
- get: repo
trigger: true
- task: create-commit
config:
platform: linux
image_resource:
type: registry-image
source:
repository: gitea/gitea # use any image that has the git cli
inputs:
- name: repo
outputs:
- name: repo
run:
path: sh
args:
- -cx
# git config --global user.name conc
# git config --global user.email conc@local
- |
cd repo
whoami
cat ~/.gitconfig
cat .git/config
date > todays-date
git add ./todays-date
git commit -m "Update todays date"
- put: repo
params:
repository: repo
Set this pipeline: fly -t tutorial set-pipeline -p git_config -c git-config.yml.
Then trigger fly -t tutorial trigger-job -j git_config/git_config_job --watch.
Actual result
What we see in output:
running sh -cx cd repo
whoami
cat ~/.gitconfig
cat .git/config
date > todays-date
git add ./todays-date
git commit -m "Update todays date"
+ cd repo
+ whoami
root
+ cat /root/.gitconfig
cat: can't open '/root/.gitconfig': No such file or directory
+ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:maestrow/concourse-examples.git
fetch = +refs/heads/master:refs/remotes/origin/master
[branch "master"]
remote = origin
merge = refs/heads/master
+ date
+ git add ./todays-date
+ git commit -m 'Update todays date'
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
The most important part is /root/.gitconfig: No such file or directory.
Expected result
-
/root/.gitconfigfile exists. I expect that because all global git settings stores in this file. My use case shows that this file doesn't exists. And as a result git hasn't any global settings.
+1 We are experiencing this exact issue as well.
any solution for this?
I am facing the same issue described here.
I Have this resource:
resources:
- name: concourse-adapter
type: git
icon: git
source:
uri: https://seed.radicle.gr/z2woyw9Get9Q21VJzdbVz33b47xDb.git
git_config:
- name: safe.directory
value: /tmp/build/get
- name: remote.origin.fetch
value: "+refs/*:refs/remotes/origin/*"
- name: fetch.all
value: true
and in my task I have these commands:
run:
path: sh
args:
- -c
- |
cd concourse-adapter
ls -al ~/
ls -al /root
echo $(git config --list)
echo $(git config --list --global)
cat ~/.gitconfig
The output indicates that there is no global configuration - only the local :
total 20
drwx------ 2 root root 4096 Apr 9 05:58 .
drwxr-xr-x 1 root root 4096 Apr 19 05:00 ..
-rw-r--r-- 1 root root 571 Apr 10 2021 .bashrc
-rw-r--r-- 1 root root 161 Jul 9 2019 .profile
total 20
drwx------ 2 root root 4096 Apr 9 05:58 .
drwxr-xr-x 1 root root 4096 Apr 19 05:00 ..
-rw-r--r-- 1 root root 571 Apr 10 2021 .bashrc
-rw-r--r-- 1 root root 161 Jul 9 2019 .profile
core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.url=https://seed.radicle.gr/z2woyw9Get9Q21VJzdbVz33b47xDb.git remote.origin.fetch=+refs/heads/main:refs/remotes/origin/main branch.main.remote=origin branch.main.merge=refs/heads/main
fatal: unable to read config file '/root/.gitconfig': No such file or directory
cat: /root/.gitconfig: No such file or directory
Has anyone solved this issue somehow?
Maybe @nosdod could share the steps to set it up at it seems that it somehow worked at this issue: https://github.com/concourse/git-resource/issues/383
Can you provide the resource configuration that you set up the git_config ?