Skip to content

Commit

Permalink
Merge pull request #51 from Azure/add-ci
Browse files Browse the repository at this point in the history
Implemented CI and added widget in readme
  • Loading branch information
JeffreyRichter committed Jul 12, 2018
2 parents f0a732e + 3db0e95 commit eaae161
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 28 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: go

language: python
python:
- 3.6
services:
- docker
script:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
- go test ./...
- make all
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.10

ENV GOPATH /go
ENV PATH ${GOPATH}/bin:$PATH
ENV ACCOUNT_NAME ${ACCOUNT_NAME}
ENV ACCOUNT_KEY ${ACCOUNT_KEY}
RUN go get -u github.com/golang/dep/cmd/dep
RUN go get -u github.com/golang/lint/golint
RUN go get -u github.com/mitchellh/gox



49 changes: 28 additions & 21 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PROJECT_NAME = azure-storage-blob-go
WORK_DIR = /go/src/github.com/Azure/${PROJECT_NAME}
GOX_ARCH = linux/amd64 windows/amd64 darwin/amd64

define with_docker
WORK_DIR=$(WORK_DIR) docker-compose run --rm $(PROJECT_NAME) $(1)
endef

login: setup ## get a shell into the container
WORK_DIR=$(WORK_DIR) docker-compose run --rm --entrypoint /bin/bash $(PROJECT_NAME)

docker-compose:
which docker-compose

docker-build: docker-compose
WORK_DIR=$(WORK_DIR) docker-compose build --force-rm

docker-clean: docker-compose
WORK_DIR=$(WORK_DIR) docker-compose down

dep: docker-build #
$(call with_docker,dep ensure -v)

setup: clean docker-build dep ## setup environment for development

test: setup ## run go tests
$(call with_docker,go test -race -short -cover -v ./2018-03-28/azblob)

build: setup ## build binaries for the project
$(call with_docker,gox -osarch="$(GOX_ARCH)" ./2018-03-28/azblob)

all: setup test build

clean: docker-clean ## clean environment and binaries
rm -rf bin

help: ## display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Azure Storage Blob SDK for Go
[![GoDoc Widget]][GoDoc]
[![GoDoc Widget]][GoDoc] [![Build Status][Travis Widget]][Travis]

The Microsoft Azure Storage SDK for Go allows you to build applications that takes advantage of Azure's scalable cloud storage.

Expand Down Expand Up @@ -44,4 +44,6 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

[GoDoc]: https://godoc.org/github.com/Azure/azure-storage-blob-go/2016-05-31/azblob
[GoDoc Widget]: https://godoc.org/github.com/Azure/azure-storage-blob-go/2016-05-31/azblob?status.svg
[GoDoc Widget]: https://godoc.org/github.com/Azure/azure-storage-blob-go/2016-05-31/azblob?status.svg
[Travis Widget]: https://travis-ci.org/Azure/azure-storage-blob-go.svg?branch=master
[Travis]: https://travis-ci.org/Azure/azure-storage-blob-go
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'
services:
azure-storage-blob-go:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:${WORK_DIR}
working_dir: ${WORK_DIR}
environment:
- ACCOUNT_NAME
- ACCOUNT_KEY
- SECONDARY_ACCOUNT_NAME
- SECONDARY_ACCOUNT_KEY
- PREMIUM_ACCOUNT_NAME
- PREMIUM_ACCOUNT_KEY
- BLOB_STORAGE_ACCOUNT_NAME
- BLOB_STORAGE_ACCOUNT_KEY

0 comments on commit eaae161

Please sign in to comment.