Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unable to run golangci-lint on bitbuckt CI

I have setup golangci-lint in my development enviroment with configuring makefile,

MakeFile

build: lint_provider
    go build -o ${BINARY}

lint_provider:
    golangci-lint run -c .golangci.yml

install: build
    mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}...
    mv ${BINARY} ~/terraform.d/plugins/....
   

bitbucket-pipelines.yml

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

pipelines:
  default:
    - step:
      image:
        hashicorp/terraform:latest
      script:
        - apk add go
        - apk add make
        - wget -0- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.44.2
        - make install
        - cd terraformprovider/examples/test
        - ./testall.sh

this pipelining failed with

+ make install
golangci-lint run -c .golangci.yml
make: golangci-lint: No such file or directory
make: *** [Makefile:12: lint_provider] Error 127

Makefile : 12 is
golangci-lint run -c .golangci.yml

the same setup is working with the development environment
in the development environment, golangci-lint installed with
brew install golangci-lint

how do I execute golangci-lint with bitbucket pipeline environment?

>Solution :

Looks like golangci-lint isnt installed succesfully or installed in the directory outside of the PATH

By default this installer uses ./bin directory, so you can try ./bin/golangci-lint run -c .golangci.yml, or you can use BINDIR variable to set installation path.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading