Skip to content

Commit

Permalink
Merge 25f4ea9 into 3fa28a3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixolay committed Nov 28, 2019
2 parents 3fa28a3 + 25f4ea9 commit 5109fa2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ VENDOR := "SKB Kontur"
URL := "https://github.com/moira-alert/moira"
LICENSE := "MIT"

services := "notifier" "api" "checker" "cli"

.PHONY: default
default: test build

Expand All @@ -39,7 +41,7 @@ test:

.PHONY: build
build:
for service in "filter" "notifier" "api" "checker" "cli" ; do \
for service in "filter" $(services) ; do \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-X main.MoiraVersion=${VERSION_RELEASE} -X main.GoVersion=${GO_VERSION} -X main.GitCommit=${GIT_HASH}" -o build/$$service github.com/moira-alert/moira/cmd/$$service ; \
done

Expand All @@ -49,7 +51,7 @@ clean:

.PHONY: tar
tar:
for service in "filter" "notifier" "api" "checker" "cli" ; do \
for service in "filter" $(services) ; do \
mkdir -p build/root/$$service/usr/bin ; \
mkdir -p build/root/$$service/etc/moira ; \
cp build/$$service build/root/$$service/usr/bin/moira-$$service ; \
Expand All @@ -66,7 +68,7 @@ tar:

.PHONY: rpm
rpm: tar
for service in "notifier" "api" "checker" "cli" ; do \
for service in $(services) ; do \
fpm -t rpm \
-s "tar" \
--description "Moira $$service" \
Expand Down Expand Up @@ -98,7 +100,7 @@ rpm: tar

.PHONY: deb
deb: tar
for service in "notifier" "api" "checker" "cli" ; do \
for service in $(services) ; do \
fpm -t deb \
-s "tar" \
--description "Moira $$service" \
Expand Down Expand Up @@ -133,21 +135,21 @@ packages: clean build tar rpm deb

.PHONY: docker_feature_images
docker_feature_images:
for service in "filter" "notifier" "api" "checker" ; do \
for service in "filter" $(services) ; do \
docker build --build-arg MoiraVersion=${VERSION_FEATURE} --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_COMMIT=${GIT_HASH} -f Dockerfile.$$service -t moira/$$service-${MARK_UNSTABLE}:${VERSION_FEATURE} . ; \
docker push moira/$$service-${MARK_UNSTABLE}:${VERSION_FEATURE} ; \
done

.PHONY: docker_nightly_images
docker_nightly_images:
for service in "filter" "notifier" "api" "checker" ; do \
for service in "filter" $(services) ; do \
docker build --build-arg MoiraVersion=${VERSION_NIGHTLY} --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_COMMIT=${GIT_HASH} -f Dockerfile.$$service -t moira/$$service-${MARK_NIGHTLY}:${VERSION_NIGHTLY} . ; \
docker push moira/$$service-${MARK_NIGHTLY}:${VERSION_NIGHTLY} ; \
done

.PHONY: docker_release_images
docker_release_images:
for service in "filter" "notifier" "api" "checker" ; do \
for service in "filter" $(services) ; do \
docker build --build-arg MoiraVersion=${VERSION_RELEASE} --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_COMMIT=${GIT_HASH} -f Dockerfile.$$service -t moira/$$service:${VERSION_RELEASE} -t moira/$$service:latest . ; \
docker push moira/$$service:${VERSION_RELEASE} ; \
docker push moira/$$service:latest ; \
Expand Down

0 comments on commit 5109fa2

Please sign in to comment.