Skip to content

Commit

Permalink
Merge pull request #15 from FINRAOS/update_deps
Browse files Browse the repository at this point in the history
Update deps, CI job and error handling
  • Loading branch information
kood1 authored Jan 7, 2021
2 parents 0accfc9 + f399774 commit 20a9361
Show file tree
Hide file tree
Showing 661 changed files with 457 additions and 506,976 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.11.4
- image: circleci/golang:latest
working_directory: /go/src/github.com/FINRAOS/yum-nginx-api
environment:
TEST_RESULTS: /tmp/test-results
Expand All @@ -13,7 +13,10 @@ jobs:
shell: /bin/bash
command: |
mkdir -p $TEST_RESULTS
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.34.1
go get -u golang.org/x/lint/golint
go get github.com/jstemmer/go-junit-report
make lint
make test | go-junit-report > ${TEST_RESULTS}/go-test-report.xml
- run:
shell: /bin/bash
Expand Down
164 changes: 0 additions & 164 deletions Gopkg.lock

This file was deleted.

23 changes: 0 additions & 23 deletions Gopkg.toml

This file was deleted.

15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@ PACKAGE_NAME:='yumapi'
BUILT_ON:=$(shell date)
COMMIT_HASH:=$(shell git log -n 1 --pretty=format:"%H")
PACKAGES:=$(shell go list ./... | grep -v /vendor/)
LDFLAGS:='-X "main.builtOn=$(BUILT_ON)" -X "main.commitHash=$(COMMIT_HASH)"'
LDFLAGS:='-s -w -X "main.builtOn=$(BUILT_ON)" -X "main.commitHash=$(COMMIT_HASH)"'

default: docker

test:
go test -cover -v $(PACKAGES)

update-deps:
go get -u ./...
go mod tidy

gofmt:
go fmt ./...

lint: gofmt
$(GOPATH)/bin/golint $(PACKAGES)
$(GOPATH)/bin/golangci-lint run

run: config
go run -ldflags $(LDFLAGS) `find . | grep -v 'test\|vendor\|repo' | grep \.go`

Expand All @@ -19,7 +30,7 @@ cc:

# Build on Linux
build:
CGO_ENABLED="1" go build -ldflags $(LDFLAGS) -o $(PACKAGE_NAME) .
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -a -o $(PACKAGE_NAME) .

clean:
rm -rf yumapi* coverage.out coverage-all.out repodata *.rpm *.sqlite
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
A GO API for managing yum repos and NGINX to serve them
=======

[![CircleCI](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master.svg?style=svg)](https://circleci.com/gh/FINRAOS/yum-nginx-api/tree/master)
[![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)

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

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.
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.

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)

Expand Down
25 changes: 25 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module github.com/FINRAOS/yum-nginx-api

go 1.15

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-ozzo/ozzo-routing v2.1.4+incompatible
github.com/golang/gddo v0.0.0-20201222204913-17b648fae295 // indirect
github.com/h2non/filetype v1.1.0
github.com/magiconair/properties v1.8.4 // indirect
github.com/mitchellh/mapstructure v1.4.0 // indirect
github.com/mutecomm/go-sqlcipher v0.0.0-20170920224653-f799951b4ab2
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
github.com/ulikunitz/xz v0.5.9
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 // indirect
golang.org/x/text v0.3.4 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 20a9361

Please sign in to comment.