github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/build/legacy.mk (about)

     1  # test-te used to just run the branch edition tests, but now runs whatever is available
     2  test-te: test-server
     3  
     4  # test-ee used to just run the enterprise edition tests, but now runs whatever is available
     5  test-ee: test-server
     6  
     7  ## Old target to run go vet. Now it just invokes golangci-lint.
     8  govet: golangci-lint
     9  
    10  gofmt: ## Runs gofmt against all packages. This is now subsumed by make golangci-lint.
    11  	@echo Running GOFMT
    12  
    13  	@for package in $(TE_PACKAGES) $(EE_PACKAGES); do \
    14  		 echo "Checking "$$package; \
    15  		 files=$$($(GO) list $(GOFLAGS) -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' $$package); \
    16  		 if [ "$$files" ]; then \
    17  			 gofmt_output=$$(gofmt -d -s $$files 2>&1); \
    18  			 if [ "$$gofmt_output" ]; then \
    19  				 echo "$$gofmt_output"; \
    20  				 echo "gofmt failure"; \
    21  				 exit 1; \
    22  			 fi; \
    23  		 fi; \
    24  	done
    25  	@echo "gofmt success"; \
    26  
    27  # check-licenses was used to check the license of the files, but now is done through mattermost-govet
    28  check-licenses: vet
    29  
    30  # clean old docker images
    31  clean-old-docker:
    32  	@echo Removing docker containers
    33  
    34  	@if [ $(shell docker ps -a --no-trunc --quiet --filter name=^/mattermost-mysql$$ | wc -l) -eq 1 ]; then \
    35  		echo removing mattermost-mysql; \
    36  		docker stop mattermost-mysql > /dev/null; \
    37  		docker rm -v mattermost-mysql > /dev/null; \
    38  	fi
    39  
    40  	@if [ $(shell docker ps -a --no-trunc --quiet --filter name=^/mattermost-mysql-unittest$$ | wc -l) -eq 1 ]; then \
    41  		echo removing mattermost-mysql-unittest; \
    42  		docker stop mattermost-mysql-unittest > /dev/null; \
    43  		docker rm -v mattermost-mysql-unittest > /dev/null; \
    44  	fi
    45  
    46  	@if [ $(shell docker ps -a --no-trunc --quiet --filter name=^/mattermost-postgres$$ | wc -l) -eq 1 ]; then \
    47  		echo removing mattermost-postgres; \
    48  		docker stop mattermost-postgres > /dev/null; \
    49  		docker rm -v mattermost-postgres > /dev/null; \
    50  	fi
    51  
    52  	@if [ $(shell docker ps -a --no-trunc --quiet --filter name=^/mattermost-postgres-unittest$$ | wc -l) -eq 1 ]; then \
    53  		echo removing mattermost-postgres-unittest; \
    54  		docker stop mattermost-postgres-unittest > /dev/null; \
    55  		docker rm -v mattermost-postgres-unittest > /dev/null; \
    56  	fi
    57  
    58  	@if [ $(shell docker ps -a | grep -ci mattermost-openldap) -eq 1 ]; then \
    59  		echo removing mattermost-openldap; \
    60  		docker stop mattermost-openldap > /dev/null; \
    61  		docker rm -v mattermost-openldap > /dev/null; \
    62  	fi
    63  
    64  	@if [ $(shell docker ps -a | grep -ci mattermost-inbucket) -eq 1 ]; then \
    65  		echo removing mattermost-inbucket; \
    66  		docker stop mattermost-inbucket > /dev/null; \
    67  		docker rm -v mattermost-inbucket > /dev/null; \
    68  	fi
    69  
    70  	@if [ $(shell docker ps -a | grep -ci mattermost-minio) -eq 1 ]; then \
    71  		echo removing mattermost-minio; \
    72  		docker stop mattermost-minio > /dev/null; \
    73  		docker rm -v mattermost-minio > /dev/null; \
    74  	fi
    75  
    76  	@if [ $(shell docker ps -a | grep -ci mattermost-elasticsearch) -eq 1 ]; then \
    77  		echo removing mattermost-elasticsearch; \
    78  		docker stop mattermost-elasticsearch > /dev/null; \
    79  		docker rm -v mattermost-elasticsearch > /dev/null; \
    80  	fi