mirror of
				https://github.com/mxpv/podsync.git
				synced 2024-05-11 05:55:04 +00:00 
			
		
		
		
	Use Makefile
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -24,7 +24,7 @@ _testmain.go | ||||
| *.prof | ||||
|  | ||||
| .idea/ | ||||
|  | ||||
| bin/ | ||||
| node_modules/ | ||||
| dist/ | ||||
| venv/ | ||||
|   | ||||
							
								
								
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,13 +0,0 @@ | ||||
| FROM golang:1.11.2 AS backend_builder | ||||
| WORKDIR /podsync | ||||
| COPY . . | ||||
| ENV GOOS=linux | ||||
| ENV GOARCH=amd64 | ||||
| ENV CGO_ENABLED=0 | ||||
| RUN go build  -o server -v ./cmd/app | ||||
|  | ||||
| FROM alpine | ||||
| RUN apk --update --no-cache add ca-certificates | ||||
| WORKDIR /app/ | ||||
| COPY --from=backend_builder /podsync/server . | ||||
| ENTRYPOINT ["/app/server"] | ||||
							
								
								
									
										23
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| SUBDIRS := cmd/app cmd/nginx cmd/ytdl | ||||
| GOLANGCI := ./bin/golangci-lint | ||||
|  | ||||
| .PHONY: push | ||||
| push: | ||||
| 	for d in $(SUBDIRS); do $(MAKE) -C $$d push; done | ||||
|  | ||||
| $(GOLANGCI): | ||||
| 	curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ./bin v1.15.0 | ||||
| 	./bin/golangci-lint --version | ||||
|  | ||||
| .PHONY: lint | ||||
| lint: $(GOLANGCI) | ||||
| 	./bin/golangci-lint run | ||||
|  | ||||
| .PHONY: test | ||||
| test: | ||||
| 	go test -short ./... | ||||
|  | ||||
| .PHONY: up | ||||
| up: | ||||
| 	docker-compose pull | ||||
| 	docker-compose up -d | ||||
							
								
								
									
										4
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								build.sh
									
									
									
									
									
								
							| @@ -1,4 +0,0 @@ | ||||
| #!/usr/bin/env bash | ||||
|  | ||||
| docker build -t mxpv/podsync . | ||||
| docker push mxpv/podsync | ||||
| @@ -8,12 +8,7 @@ env: | ||||
|     VIMEO_TEST_API_KEY: "/CodeBuild/vimeoKey" | ||||
|  | ||||
| phases: | ||||
|   install: | ||||
|     commands: | ||||
|       - go version | ||||
|       - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /usr/local/bin v1.12.5 | ||||
|       - golangci-lint --version | ||||
|   build: | ||||
|     commands: | ||||
|       - go test -short ./... | ||||
|       - golangci-lint run | ||||
|       - make lint | ||||
|       - make test | ||||
|   | ||||
							
								
								
									
										1
									
								
								cmd/app/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cmd/app/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| server | ||||
							
								
								
									
										4
									
								
								cmd/app/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								cmd/app/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| FROM alpine | ||||
| RUN apk --update --no-cache add ca-certificates | ||||
| COPY ./server /server | ||||
| ENTRYPOINT ["/server"] | ||||
							
								
								
									
										14
									
								
								cmd/app/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								cmd/app/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| OUT := server | ||||
| SRC := $(wildcard *.go) | ||||
|  | ||||
| build: $(SRC) | ||||
| 	GOOS=linux go build -v -o $(OUT) | ||||
|  | ||||
| .PHONY: push | ||||
| push: build | ||||
| 	docker build -t mxpv/podsync . | ||||
| 	docker push mxpv/podsync | ||||
|  | ||||
| .PHONY: clean | ||||
| clean: | ||||
| 	- rm -f $(OUT) | ||||
							
								
								
									
										4
									
								
								cmd/nginx/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								cmd/nginx/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| .PHONY: push | ||||
| push: | ||||
| 	docker build -t mxpv/nginx -f Dockerfile ../../ | ||||
| 	docker push mxpv/nginx | ||||
							
								
								
									
										4
									
								
								cmd/ytdl/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								cmd/ytdl/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| .PHONY: push | ||||
| push: | ||||
| 	docker build -t mxpv/ytdl . | ||||
| 	docker push mxpv/ytdl | ||||
| @@ -1,4 +0,0 @@ | ||||
| #!/usr/bin/env bash | ||||
|  | ||||
| docker build -t mxpv/ytdl . | ||||
| docker push mxpv/ytdl | ||||
		Reference in New Issue
	
	Block a user