Skip to content

Commit 9b8d1fe

Browse files
committed
Improve CI process.
1 parent 5028179 commit 9b8d1fe

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
all:
1+
DOCKER_IMAGE_NAME ?= archon-controller
2+
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
3+
4+
all: glide plugin
5+
6+
glide:
7+
glide install
8+
9+
plugin:
210
go build -buildmode=c-shared -o out_sls.so .
11+
cp out_sls.so docker-image/
312

413
clean:
514
rm -rf *.so *.h *~
15+
16+
docker:
17+
@echo ">> building docker image"
18+
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" docker-image

circle.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
machine:
2+
environment:
3+
DOCKER_IMAGE_NAME: kubeup/fluent-bit-aliyun
4+
USER: kubeup
5+
REPO: fluent-bit-aliyun
6+
pre:
7+
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci'
8+
- sudo chmod 0755 /usr/bin/docker
9+
- sudo curl -L 'https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2' | tar xvjf - --strip-components 3 -C $HOME/bin
10+
- sudo curl -L 'https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz' | tar xvzf - -C $HOME/bin
11+
- sudo mv $HOME/bin/linux-amd64/glide $HOME/bin/
12+
services:
13+
- docker
14+
15+
dependencies:
16+
pre:
17+
- docker info
18+
override:
19+
- mkdir -p $HOME/.go_workspace/src/github.com/kubeup
20+
- ln -sf $HOME/$CIRCLE_PROJECT_REPONAME $HOME/.go_workspace/src/github.com/kubeup/$CIRCLE_PROJECT_REPONAME
21+
- glide install
22+
- go build -buildmode=c-shared -o out_sls.so github.com/kubeup/fluent-bit-aliyun
23+
- cp out_sls.so docker-image/
24+
- |
25+
if [ -n "$CIRCLE_TAG" ]; then
26+
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
27+
else
28+
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
29+
fi
30+
post:
31+
- docker images
32+
33+
test:
34+
override:
35+
- go test github.com/kubeup/fluent-bit-aliyun
36+
37+
deployment:
38+
hub_branch:
39+
branch: master
40+
owner: kubeup
41+
commands:
42+
- docker login -e $DOCKER_EMAIL -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
43+
- docker push $DOCKER_IMAGE_NAME

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package: github.com/adieu/fluent-bit-aliyun
1+
package: github.com/kubeup/fluent-bit-aliyun
22
ignore:
33
- net/url
44
- net/rpc

0 commit comments

Comments
 (0)