From e3c1374b49d5be61db4981ca90670df8c8493050 Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Tue, 5 Dec 2023 13:09:56 +0300 Subject: [PATCH] Modifies snap install logic - adds golangci-lint - adds go --- Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c7cadbca..b01e7bfb 100644 --- a/Makefile +++ b/Makefile @@ -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"