Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Tasks that run on the host #78

Open
ineffyble opened this issue Apr 13, 2019 · 4 comments
Open

Tasks that run on the host #78

ineffyble opened this issue Apr 13, 2019 · 4 comments
Labels
frozen Issue should not be marked as stale is:enhancement priority:low

Comments

@ineffyble
Copy link
Contributor

It would be great if you could define a task that executes on the host (not in a Docker container).

This is useful because:

  • It means you can use batect as your task runner for all tasks, even the ones that can't/shouldn't run in Docker
  • It means when you're setting up task workflows using dependencies, you can include these

A prime example: I want to run a bash script that build a Docker image for my Java app. The Dockerfile includes a COPY that takes my app.zip, which was built by Gradle, and extracts it into the image.

I want to use that bash script/task as a dependency of a task that then uses the new Docker image as part of a Terraform deployment.

This means my task flow goes:

  1. Compile the Java (done in a batect java-env)
  2. Run shell script to build and push the Docker image
  3. Run the Terraform (done in a terraform-env)
  4. More steps

Right now, 2. is done in a "docker-env" which actually doesn't contain much, and mounts the Docker socket from the host. Ideally it would be run directly on the host, but I can't do that and still have my end-to-end task workflow with batect.

@charleskorn
Copy link
Collaborator

This is something I've been thinking a bit about lately. Is your only use case for running a command locally building and pushing an image?

@ineffyble
Copy link
Contributor Author

I think there's other usecases. For example, installing a pre-commit hook for the repo.

The problem is that teams tend to try and use batect instead of a "go" script, but it's hard to do that when it has to run everything in Docker.

@charleskorn
Copy link
Collaborator

OK, makes sense. This isn't something I'm going to implement soon, but I will one day.

Out of interest, is there a reason why you can't mount the source directory into a container and set up the pre-commit hooks from there?

@stale
Copy link

stale bot commented Feb 28, 2021

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will automatically be closed if no further activity occurs in the next seven days to enable maintainers to focus on the most important issues.
If this issue is still affecting you, please comment below within the next seven days.
Thank you for your contributions.

@stale stale bot added the stale label Feb 28, 2021
@charleskorn charleskorn added the frozen Issue should not be marked as stale label Feb 28, 2021
@stale stale bot removed the stale label Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen Issue should not be marked as stale is:enhancement priority:low
Development

No branches or pull requests

2 participants