Skip to content

Commit cde9be8

Browse files
committed
entitlements tmpdir fixes
1 parent 42b7e70 commit cde9be8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/entitlements/util/gitrepo.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def initialize(repo:, sshkey:, logger: Entitlements.logger)
3838
@repo = repo
3939
@sshkey = sshkey
4040
@github = "[email protected]:"
41+
@tmpdir_prefix = ENV.fetch("ENTITLEMENTS_TMPDIR_PREFIX", "/data/entitlements_deploys")
4142
end
4243

4344
# Run "git add" on a file.
@@ -206,7 +207,7 @@ def open3_git_execute(dir, commandline, ssh = false)
206207
# else custom that might be going on in the environment. Turn off prompts for the SSH key for
207208
# github.com being trusted or not, only use the provided key as the identity, and ignore any
208209
# ~/.ssh/config file the user running this might have set up.
209-
tempdir = Dir.mktmpdir
210+
tempdir = Dir.mktmpdir(nil, @tmpdir_prefix)
210211
File.open(File.join(tempdir, "key"), "w") { |f| f.write(sshkey) }
211212
File.open(File.join(tempdir, "ssh"), "w") do |f|
212213
f.puts "#!/bin/sh"

0 commit comments

Comments
 (0)