-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from FINRAOS/go-rewrite
Go rewrite
- Loading branch information
Showing
810 changed files
with
467,708 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/golang:1.9.1 | ||
working_directory: /go/src/github.com/FINRAOS/yum-nginx-api | ||
steps: | ||
- setup_remote_docker | ||
- run: git clone https://github.com/FINRAOS/yum-nginx-api.git -b $CIRCLE_BRANCH . | ||
- run: | ||
shell: /bin/bash | ||
command: | | ||
cd yum-nginx-api | ||
make build | ||
make docker | ||
- run: | ||
shell: /bin/bash | ||
command: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
docker push finraos/yum-nginx-api:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,17 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# C extensions | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
# Test binary, build with `go test -c` | ||
*.test | ||
|
||
# PyBuilder | ||
target/ | ||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
nohup.out | ||
.vscode | ||
yumapi* | ||
repodata | ||
*.rpm | ||
*.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
FROM centos:7 | ||
MAINTAINER Tim Marcinowski <[email protected]> | ||
|
||
USER root | ||
|
||
RUN yum -y update | ||
RUN yum install -y epel-release gcc createrepo python-setuptools python-devel | ||
RUN yum install -y python-pip supervisor | ||
RUN pip install --upgrade pip | ||
ADD ./requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
RUN yum remove -y gcc && yum clean all | ||
ADD . /opt/yum-nginx-api | ||
ADD supervisor/yumapi.ini /etc/supervisord.d/yumapi.ini | ||
RUN yum install -y createrepo && yum clean all | ||
RUN mkdir -p /repo | ||
ADD ./yumapi.yaml / | ||
ADD ./yumapi / | ||
|
||
EXPOSE 8888 | ||
EXPOSE 8080 | ||
|
||
CMD ["supervisord", "-n", "-c", "/etc/supervisord.conf"] | ||
CMD ["/yumapi"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
|
||
|
||
[[constraint]] | ||
name = "github.com/go-ozzo/ozzo-routing" | ||
version = "2.1.3" | ||
|
||
[[constraint]] | ||
name = "github.com/h2non/filetype" | ||
version = "1.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
PACKAGE_NAME:='yumapi' | ||
BUILT_ON:=$(shell date) | ||
COMMIT_HASH:=$(shell git log -n 1 --pretty=format:"%H") | ||
PACKAGES:=$(shell go list ./... | sed -n '1!p' | grep -v /vendor/) | ||
LDFLAGS:='-X "main.builtOn=$(BUILT_ON)" -X "main.commitHash=$(COMMIT_HASH)"' | ||
|
||
default: docker | ||
|
||
test: | ||
echo "mode: count" > coverage-all.out | ||
$(foreach pkg,$(PACKAGES), \ | ||
go test -p=1 -cover -covermode=count -coverprofile=coverage.out ${pkg}; \ | ||
tail -n +2 coverage.out >> coverage-all.out;) | ||
|
||
cover: test | ||
go tool cover -html=coverage-all.out | ||
|
||
run: config | ||
go run -ldflags $(LDFLAGS) *.go | ||
|
||
# Cross-compile from OS X to Linux using xgo | ||
cc: | ||
xgo --targets=linux/amd64 -ldflags $(LDFLAGS) -out $(PACKAGE_NAME) . | ||
mv -f yumapi-* yumapi | ||
|
||
# Build on Linux | ||
build: | ||
CGO_ENABLED="1" go build -ldflags $(LDFLAGS) -o $(PACKAGE_NAME) . | ||
|
||
clean: | ||
rm -rf yumapi* coverage.out coverage-all.out repodata *.rpm *.sqlite | ||
|
||
config: | ||
printf "upload_dir: .\ndev_mode: true" > yumapi.yaml | ||
|
||
docker: | ||
printf "upload_dir: /repo\n" > yumapi.yaml | ||
docker build -t finraos/yum-nginx-api:latest . | ||
|
||
# Run just API without NGINX | ||
drun: | ||
docker run -d -p 8080:8080 --name yumapi finraos/yum-nginx-api | ||
|
||
compose: | ||
docker-compose up |
Oops, something went wrong.