-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: containerize vagrant commands with podman
Added a function to wrap vagrant commands within a podman container Signed-off-by: Guillaume Abrioux <[email protected]>
- Loading branch information
Showing
3 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
vagrant(){ | ||
root_dir=$(realpath "${PWD}/Vagrantfile") | ||
podman run --rm \ | ||
-e LIBVIRT_DEFAULT_URI \ | ||
-e SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" \ | ||
-v /var/run/libvirt/:/var/run/libvirt/ \ | ||
-v ~/.vagrant.d:/.vagrant.d \ | ||
-v $(realpath "${PWD}"):${PWD} \ | ||
-v "${root_dir}:${root_dir}" \ | ||
-w "${PWD}" \ | ||
--network host \ | ||
--entrypoint vagrant \ | ||
--security-opt label=disable \ | ||
docker.io/vagrantlibvirt/vagrant-libvirt:latest \ | ||
$@ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters