Skip to content

Commit 20a9361

Browse files
authored
Merge pull request #15 from FINRAOS/update_deps
Update deps, CI job and error handling
2 parents 0accfc9 + f399774 commit 20a9361

File tree

661 files changed

+457
-506976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

661 files changed

+457
-506976
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/golang:1.11.4
5+
- image: circleci/golang:latest
66
working_directory: /go/src/github.com/FINRAOS/yum-nginx-api
77
environment:
88
TEST_RESULTS: /tmp/test-results
@@ -13,7 +13,10 @@ jobs:
1313
shell: /bin/bash
1414
command: |
1515
mkdir -p $TEST_RESULTS
16+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.34.1
17+
go get -u golang.org/x/lint/golint
1618
go get github.com/jstemmer/go-junit-report
19+
make lint
1720
make test | go-junit-report > ${TEST_RESULTS}/go-test-report.xml
1821
- run:
1922
shell: /bin/bash

Gopkg.lock

Lines changed: 0 additions & 164 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ PACKAGE_NAME:='yumapi'
22
BUILT_ON:=$(shell date)
33
COMMIT_HASH:=$(shell git log -n 1 --pretty=format:"%H")
44
PACKAGES:=$(shell go list ./... | grep -v /vendor/)
5-
LDFLAGS:='-X "main.builtOn=$(BUILT_ON)" -X "main.commitHash=$(COMMIT_HASH)"'
5+
LDFLAGS:='-s -w -X "main.builtOn=$(BUILT_ON)" -X "main.commitHash=$(COMMIT_HASH)"'
66

77
default: docker
88

99
test:
1010
go test -cover -v $(PACKAGES)
1111

12+
update-deps:
13+
go get -u ./...
14+
go mod tidy
15+
16+
gofmt:
17+
go fmt ./...
18+
19+
lint: gofmt
20+
$(GOPATH)/bin/golint $(PACKAGES)
21+
$(GOPATH)/bin/golangci-lint run
22+
1223
run: config
1324
go run -ldflags $(LDFLAGS) `find . | grep -v 'test\|vendor\|repo' | grep \.go`
1425

@@ -19,7 +30,7 @@ cc:
1930

2031
# Build on Linux
2132
build:
22-
CGO_ENABLED="1" go build -ldflags $(LDFLAGS) -o $(PACKAGE_NAME) .
33+
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -a -o $(PACKAGE_NAME) .
2334

2435
clean:
2536
rm -rf yumapi* coverage.out coverage-all.out repodata *.rpm *.sqlite

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
A GO API for managing yum repos and NGINX to serve them
44
=======
55

6-
[![CircleCI](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master.svg?style=svg)](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master)
6+
[![CircleCI](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master.svg?style=svg)](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master) [![Go Report Card](https://goreportcard.com/badge/github.com/FINRAOS/yum-nginx-api)](https://goreportcard.com/report/github.com/FINRAOS/yum-nginx-api)
77

88
[yum-nginx-api][1] is a go API for uploading RPMs to yum repositories and also configurations for running NGINX to serve them.
99

10-
It is a deployable solution with Docker or a single 16MB dynamically linked Linux binary. yum-nginx-api enables CI tools to be used for uploading RPMs and managing yum repositories.
10+
It is a deployable solution with Docker or a single 8MB statically linked Linux binary. yum-nginx-api enables CI tools to be used for uploading RPMs and managing yum repositories.
1111

1212
Included in this project is a go package `repojson` that can be used to read a repodata directory and return a JSON array of all packages in the primary.sqlite.(bz2|xz). For usage go to [RepoJSON](#repojson)
1313

go.mod

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module github.com/FINRAOS/yum-nginx-api
2+
3+
go 1.15
4+
5+
require (
6+
github.com/fsnotify/fsnotify v1.4.9 // indirect
7+
github.com/go-ozzo/ozzo-routing v2.1.4+incompatible
8+
github.com/golang/gddo v0.0.0-20201222204913-17b648fae295 // indirect
9+
github.com/h2non/filetype v1.1.0
10+
github.com/magiconair/properties v1.8.4 // indirect
11+
github.com/mitchellh/mapstructure v1.4.0 // indirect
12+
github.com/mutecomm/go-sqlcipher v0.0.0-20170920224653-f799951b4ab2
13+
github.com/pelletier/go-toml v1.8.1 // indirect
14+
github.com/spf13/afero v1.5.1 // indirect
15+
github.com/spf13/cast v1.3.1 // indirect
16+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
17+
github.com/spf13/pflag v1.0.5 // indirect
18+
github.com/spf13/viper v1.7.1
19+
github.com/ulikunitz/xz v0.5.9
20+
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
21+
golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 // indirect
22+
golang.org/x/text v0.3.4 // indirect
23+
gopkg.in/ini.v1 v1.62.0 // indirect
24+
gopkg.in/yaml.v2 v2.4.0 // indirect
25+
)

0 commit comments

Comments
 (0)