Skip to content

Commit 0783693

Browse files
authored
Merge pull request #10 from jancajthaml/feature/less-file-noise
Less noise files, better release lc
2 parents 56a709a + 07710e2 commit 0783693

File tree

10 files changed

+32
-96
lines changed

10 files changed

+32
-96
lines changed

.circleci/config.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ jobs:
44
test:
55
docker:
66
- image: circleci/golang:1.9
7-
7+
environment:
8+
- LANG: C.UTF-8
9+
810
working_directory: /go/src/jancajthaml
911
steps:
1012
- checkout
@@ -39,7 +41,9 @@ jobs:
3941

4042
deploy:
4143
docker:
42-
- image: docker:17.05.0-ce-git
44+
- image: docker:17.09.0-ce-git
45+
environment:
46+
- LANG: C.UTF-8
4347

4448
working_directory: /app
4549
steps:
@@ -54,18 +58,29 @@ jobs:
5458
command: |
5559
cp -r /go/src/github.com/jancajthaml/target /app/target
5660
docker build \
57-
--build-arg VERSION=$(cat VERSION) \
58-
--build-arg VCS_REF=${CIRCLE_SHA1} \
59-
--build-arg VCS_URL=$(git config --get remote.origin.url) \
60-
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
61+
--build-arg VERSION=$(git tag | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1) \
62+
--build-arg SOURCE=$(git config --get remote.origin.url) \
6163
-t bundle .
6264
6365
- deploy:
6466
name: Push image to DockerHUB
6567
command: |
66-
docker login -e ${DOCKER_EMAIL} -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
67-
docker tag bundle "jancajthaml/datadog_mock:${CIRCLE_SHA1}"
68-
docker push "jancajthaml/datadog_mock:${CIRCLE_SHA1}"
68+
docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
69+
70+
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
71+
VERSION=$(git tag | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1)
72+
else
73+
VERSION="snapshot.${CIRCLE_SHA1}"
74+
fi
75+
76+
docker tag bundle "jancajthaml/datadog_mock:${VERSION}"
77+
docker push "jancajthaml/datadog_mock:${VERSION}"
78+
79+
- deploy:
80+
name: Notifying microbadger to update badges
81+
command: |
82+
apk --no-cache add curl
83+
curl -X POST https://hooks.microbadger.com/images/jancajthaml/datadog_mock/${MICROBADGER_TOKEN}
6984
7085
workflows:
7186
version: 2

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

AUTHORS

Lines changed: 0 additions & 1 deletion
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

CONTRIBUTING

Lines changed: 0 additions & 4 deletions
This file was deleted.

Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@ FROM scratch
1616

1717
MAINTAINER Jan Cajthaml <[email protected]>
1818

19-
ARG BUILD_DATE
20-
ARG VCS_REF
2119
ARG VERSION
22-
LABEL org.label-schema.build-date=$BUILD_DATE \
23-
org.label-schema.name="datadog-mock" \
24-
org.label-schema.description="DataDog mock service Edit" \
25-
org.label-schema.vcs-ref=$VCS_REF \
26-
org.label-schema.vcs-url="https://github.com/jancajthaml/datadog-mock" \
27-
org.label-schema.vendor="Jan Cajthaml" \
28-
org.label-schema.version=$VERSION \
29-
org.label-schema.schema-version="1.0"
20+
ARG SOURCE
21+
22+
LABEL version=$VERSION
23+
LABEL description="DataDog mock server"
24+
LABEL source=$SOURCE
3025

3126
COPY target/datadog_mock /datadog_mock
3227

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
CORES := $$(getconf _NPROCESSORS_ONLN)
22

33
.PHONY: all
4-
all: install test authors run
4+
all: install test run
55

66
.PHONY: install
77
install: prepare-dev lint bundle
88

99
.PHONY: clean
1010
clean:
11-
@docker images | \
12-
grep -i "^datadog/dev" | \
13-
awk '{ print $$3 }' | \
11+
@docker images | grep -i "^datadog/dev" | awk '{ print $$3 }' | \
1412
xargs -P$(CORES) -I{} docker rmi -f {} 2> /dev/null || :
1513

1614
.PHONY: perf
@@ -46,7 +44,3 @@ bundle:
4644
.PHONY: run
4745
run:
4846
docker-compose run --rm --no-deps --service-ports artefact
49-
50-
.PHONY: authors
51-
authors:
52-
@git log --format='%aN <%aE>' | sort -fu > AUTHORS

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ datadog-mock is a golang statsd mock server listening on port 8125 and relaying
1010
Bootstrap environment with `make install test` then grab `./target/datadog_mock`
1111
or docker image `datadog/mock`.
1212

13-
## Usage ##
13+
## Testing ##
1414

1515
Run in docker with `make run` or `./target/datadog_mock` locally.
1616

17-
## Testing ##
18-
1917
When datadog/mock is running you can either test simple relay
2018
`./dev/event-producer.sh` or siege with `make perf`.
2119

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)