Skip to content

Can't create or push template directories containing folders prefixed with . #4369

Closed
@kconley-sq

Description

@kconley-sq

Trying to create or push a new version of an existing template is failing on our macOS laptops if we have a folder somewhere in our template directory whose name is prefixed with . and contains at least one file:

❯ coder templates create --verbose -d path/to/my/template/folder my-template-name
> Create and upload "path/to/my/template/folder"? (yes/no) 
✔ Queued [331ms]
✔ Cleaning Up [-65ms]
✘ Setting up [176ms]
create file "/tmp/provisionerdXXXXXXXXXX/subfolder/.hooks/pre-commit" (mode -rw-r--r--): open /tmp/provisionerdXXXXXXXXXX/subfolder/.hooks/pre-commit: no such file or directory
Run 'coder templates create --help' for usage.

The subfolder/.hooks/pre-commit file mentioned in the output above is a sh script that is used as a git pre-commit hook by a repo which is a git submodule within the path/to/my/template/folder template directory (subfolder/). We don't need it to be uploaded to our Coder server as part of publishing the template, but I'm not sure if there are any mechanisms we could use to make Coder ignore it.

Another case where we saw this is when the template directory was itself a git repo, and in that case the error seemed to be complaining about a file within the .git directory:

❯ coder template push my-template-name  
> Upload "path/to/my/template/folder"? (yes/no) yes
✔ Queued [476ms]
✔ Cleaning Up [-61ms]
✘ Setting up [238ms]
create file "/tmp/provisionerdXXXXXXXXXX/.git/COMMIT_EDITMSG" (mode -rw-r--r--): open /tmp/provisionerdXXXXXXXXXX/.git/COMMIT_EDITMSG: no such file or directory
Run 'coder templates push --help' for usage.

We're seeing this in both version 0.9.1 and 0.9.2 of the Coder CLI tool but did not see it in 0.8.1.

Could this be related to #3997?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions