anaconda-project icon indicating copy to clipboard operation
anaconda-project copied to clipboard

[ENH] Escaping to shell for commands inside `anaconda-project.yml`

Open mattkram opened this issue 2 years ago • 0 comments

Background

anaconda-project can potentially serve as a replacement for simple Makefiles. However, make allows for arbitrary shell commands to be embedded within Makefile, which is often used for extracting information such as git tag and branch information.

Example

image := some-image-name
git_hash ?= $(shell git log -1 --pretty=format:%h)

.PHONY: build
build:
	docker build -f Dockerfile  -t $(image):$(git_hash)

Suggestion

Develop some mechanism to embed similar shell commands within anaconda-project.yml, similar to the following:

commands:
  build:
    unix: docker build -f Dockerfile -t $(image):$(shell git log -1 --pretty=format:%h

Potentially, instead of directly embedding within the commands section , this functionality could be moved into the variables section as a new variable type.

mattkram avatar Feb 08 '22 20:02 mattkram