-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to go-git for a pure golang implementation (#5)
* Switch to go-git for a pure golang implementation After src-d/go-git#1081 was merged, the performance seems to be significantly better (usable). Even if a slight bit slower, this means theres no more CGO dependency making it much more portable. * Format cmd/brew.go Co-Authored-By: fixmie[bot] <44270338+fixmie[bot]@users.noreply.github.com>
- Loading branch information
Adam Kunicki
and
fixmie[bot]
authored
Jul 10, 2019
1 parent
8a2b0a1
commit e83d900
Showing
8 changed files
with
168 additions
and
149 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
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,54 +1,16 @@ | ||
image: golang:1.11 | ||
|
||
variables: | ||
GOFLAGS: -mod=readonly | ||
GOPATH: ${CI_PROJECT_DIR}/vendor/go | ||
PKG_CONFIG_PATH: ${CI_PROJECT_DIR}/libgit2/lib/pkgconfig | ||
|
||
.modcache: &modcache | ||
key: modcache | ||
paths: | ||
- vendor/go/pkg/mod/ | ||
- libgit2 | ||
|
||
before_script: | ||
- apt-get -qq update | ||
- apt-get install -y libssh2-1-dev cmake libssl-dev zlib1g-dev libcurl4-openssl-dev | ||
image: docker:stable | ||
services: | ||
- docker:dind | ||
|
||
stages: | ||
- dependencies | ||
- test | ||
- build | ||
- build | ||
|
||
dependencies: | ||
stage: dependencies | ||
before_script: | ||
- apt-get -qq update | ||
- apt-get install -y libssh2-1-dev cmake libssl-dev zlib1g-dev libcurl4-openssl-dev | ||
- wget https://github.com/libgit2/libgit2/archive/v0.27.8.tar.gz | ||
- tar xf v0.27.8.tar.gz | ||
- mkdir -p ${CI_PROJECT_DIR}/libgit2 | ||
- pushd libgit2-0.27.8 && mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/libgit2 && cmake --build . --target install && popd | ||
|
||
script: go mod download | ||
cache: *modcache | ||
|
||
test: | ||
stage: test | ||
image: golang:1.11 | ||
cache: | ||
<<: *modcache | ||
policy: pull | ||
script: go test ./... | ||
variables: | ||
GORELEASER_IMAGE: goreleaser/goreleaser:latest | ||
DOCKER_REGISTRY: https://index.docker.io/v1/ | ||
|
||
build: | ||
stage: build | ||
cache: | ||
<<: *modcache | ||
policy: pull | ||
script: go build | ||
artifacts: | ||
paths: | ||
- beer | ||
expire_in: 1 week | ||
|
||
script: | ||
- docker pull $GORELEASER_IMAGE | ||
- docker run --rm --privileged -v $PWD:/go/src/github.com/kunickiaj/beer -v /var/run/docker.sock:/var/run/docker.sock -w /go/src/github.com/kunickiaj/beer -e GITHUB_TOKEN -e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY $GORELEASER_IMAGE release --rm-dist |
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,31 @@ | ||
before: | ||
hooks: | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- id: dist | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
amd64: x86_64 | ||
dockers: | ||
- | ||
goos: linux | ||
goarch: amd64 | ||
binaries: | ||
- beer | ||
image_templates: | ||
- 'kunickiaj/beer:{{ .Tag }}' | ||
- 'kunickiaj/beer:latest' | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
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,6 @@ | ||
FROM scratch | ||
|
||
ADD beer /beer | ||
|
||
ENTRYPOINT [ "/beer" ] | ||
CMD [ "--help" ] |
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
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
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
Oops, something went wrong.