Skip to content

Commit

Permalink
Modifies snap install logic
Browse files Browse the repository at this point in the history
- adds golangci-lint
- adds go
  • Loading branch information
anvial committed Dec 5, 2023
1 parent 5c6d02d commit e3c1374
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,25 @@ testmicrok8s:
## testmicrok8s: Run unit tests against microk8s
TF_ACC=1 TEST_CLOUD=microk8s go test ./... -v $(TESTARGS) -timeout 120m

PACKAGES=terraform golangci-lint go
# Function to check if Snap packages are installed
check-snap-package:
@for package in $(PACKAGES); do \
if snap list $$package >/dev/null 2>&1; then \
echo "Package $$package is already installed."; \
else \
echo "Package $$package is not installed."; \
sudo snap install $$package --classic; \
fi; \
done

.PHONY: install-snap-dependencies
install-snap-dependencies:
## install-snap-dependencies: Install snap dependencies for terraform-provider-juju
@echo "Installing snap dependencies"
ifneq ($(HAS_TERRAFORM),)
@echo "Refreshing terraform snap"
@sudo snap refresh terraform --classic
else
@echo "Installing terraform snap"
@sudo snap install terraform --classic
endif
install-snap-dependencies: check-snap-package
## install-snap-dependencies: Install all the snap dependencies

.PHONY: install-dependencies
install-dependencies: install-snap-dependencies
## install-dependencies: Install all the dependencies
@echo "Installing dependencies"



0 comments on commit e3c1374

Please sign in to comment.