Skip to content

Commit

Permalink
Make devsetup/cifwm_prepare not fail when rerun
Browse files Browse the repository at this point in the history
Currently if one tries to rerun cifwm_prepare it fails
on git cloning attempt since the directory is already in place.

Example of failure:
> + make cifmw_prepare
> git clone https://github.com/openstack-k8s-operators/ci-framework ci-framework
> fatal: destination path 'ci-framework' already exists and is not an empty directory.
> make: *** [Makefile:180: cifmw_prepare] Error 128

As that is not expected from make target, make it so that
this target depends on the directory existing target,
which itself calls the git clone for its creation.
  • Loading branch information
queria committed Jun 28, 2023
1 parent 13da4b1 commit fd5f09f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion devsetup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ standalone_revert: ## Revert standalone snapshot
virsh --connect=qemu:///system snapshot-revert --domain edpm-compute-${EDPM_COMPUTE_SUFFIX} --snapshotname clean

.PHONY: cifmw_prepare
cifmw_prepare: ## Clone the ci-framework repository in the ci-framework directory. That location is ignored from git.
cifmw_prepare: ./ci-framework ## Clone or pull the ci-framework repository in the ci-framework directory. That location is ignored from git.
cd ci-framework && [[ -n "$$(git status --porcelain)" ]] || git pull --rebase

./ci-framework: ## Actual git-cloning if the cifmw directory does not exist yet (make calls this only if target path is not there)
git clone https://github.com/openstack-k8s-operators/ci-framework ci-framework

.PHONY: cifmw_cleanup
Expand Down

0 comments on commit fd5f09f

Please sign in to comment.