Skip to content

Commit

Permalink
Rename project to flagger
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Oct 7, 2018
1 parent 0848fb2 commit c3f4f0a
Show file tree
Hide file tree
Showing 90 changed files with 482 additions and 501 deletions.
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
builds:
- main: ./cmd/steerer
binary: steerer
ldflags: -s -w -X github.com/stefanprodan/steerer/pkg/version.REVISION={{.Commit}}
- main: ./cmd/flagger
binary: flagger
ldflags: -s -w -X github.com/stefanprodan/flagger/pkg/version.REVISION={{.Commit}}
goos:
- linux
goarch:
Expand Down
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ after_success:
- if [ -z "$DOCKER_USER" ]; then
echo "PR build, skipping Docker Hub push";
else
docker tag stefanprodan/steerer:latest stefanprodan/steerer:${TRAVIS_COMMIT};
docker tag stefanprodan/flagger:latest stefanprodan/flagger:${TRAVIS_COMMIT};
echo $DOCKER_PASS | docker login -u=$DOCKER_USER --password-stdin;
docker push stefanprodan/steerer:${TRAVIS_COMMIT};
docker push stefanprodan/flagger:${TRAVIS_COMMIT};
fi
- if [ -z "$TRAVIS_TAG" ]; then
echo "Not a release, skipping Docker Hub push";
else
docker tag stefanprodan/steerer:latest stefanprodan/steerer:$TRAVIS_TAG;
docker tag stefanprodan/flagger:latest stefanprodan/flagger:$TRAVIS_TAG;
echo $DOCKER_PASS | docker login -u=$DOCKER_USER --password-stdin;
docker push stefanprodan/steerer:latest;
docker push stefanprodan/steerer:$TRAVIS_TAG;
docker push stefanprodan/flagger:latest;
docker push stefanprodan/flagger:$TRAVIS_TAG;
fi

deploy:
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM golang:1.10

RUN mkdir -p /go/src/github.com/stefanprodan/steerer/
RUN mkdir -p /go/src/github.com/stefanprodan/flagger/

WORKDIR /go/src/github.com/stefanprodan/steerer
WORKDIR /go/src/github.com/stefanprodan/flagger

COPY . .

RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/steerer/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o steerer ./cmd/steerer/*
-X github.com/stefanprodan/flagger/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o flagger ./cmd/flagger/*

FROM alpine:3.8

Expand All @@ -19,11 +19,11 @@ RUN addgroup -S app \

WORKDIR /home/app

COPY --from=0 /go/src/github.com/stefanprodan/steerer/steerer .
COPY --from=0 /go/src/github.com/stefanprodan/flagger/flagger .

RUN chown -R app:app ./

USER app

ENTRYPOINT ["./steerer"]
ENTRYPOINT ["./flagger"]

32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ VERSION_MINOR:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4
PATCH:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"' | awk -F. '{print $$NF}')
SOURCE_DIRS = cmd pkg/apis pkg/controller pkg/server pkg/logging pkg/version
run:
go run cmd/steerer/* -kubeconfig=$$HOME/.kube/config -log-level=info -metrics-server=https://prometheus.istio.weavedx.com
go run cmd/flagger/* -kubeconfig=$$HOME/.kube/config -log-level=info -metrics-server=https://prometheus.istio.weavedx.com

build:
docker build -t stefanprodan/steerer:$(TAG) . -f Dockerfile
docker build -t stefanprodan/flagger:$(TAG) . -f Dockerfile

push:
docker push stefanprodan/steerer:$(TAG)
docker push stefanprodan/flagger:$(TAG)

fmt:
gofmt -l -s -w $(SOURCE_DIRS)
Expand All @@ -25,37 +25,37 @@ test: test-fmt test-codegen
go test ./...

helm-package:
cd charts/ && helm package steerer/ && helm package podinfo-steerer/ && helm package grafana/
cd charts/ && helm package flagger/ && helm package podinfo-flagger/ && helm package grafana/
mv charts/*.tgz docs/
helm repo index docs --url https://stefanprodan.github.io/steerer --merge ./docs/index.yaml
helm repo index docs --url https://stefanprodan.github.io/flagger --merge ./docs/index.yaml

helm-up:
helm upgrade --install steerer ./chart/steerer --namespace=istio-system
helm upgrade --install flagger ./charts/flagger --namespace=istio-system --set crd.create=false

version-set:
@next="$(TAG)" && \
current="$(VERSION)" && \
sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \
sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/steerer/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \
sed -i '' "s/flagger:$$current/flagger:$$next/g" artifacts/flagger/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/flagger/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/flagger/Chart.yaml && \
echo "Version $$next set in code, deployment and charts"

version-up:
@next="$(VERSION_MINOR).$$(($(PATCH) + 1))" && \
current="$(VERSION)" && \
sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \
sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/steerer/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \
sed -i '' "s/flagger:$$current/flagger:$$next/g" artifacts/flagger/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/flagger/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/flagger/Chart.yaml && \
echo "Version $$next set in code, deployment and chart"

dev-up: version-up
@echo "Starting build/push/deploy pipeline for $(VERSION)"
docker build -t stefanprodan/steerer:$(VERSION) . -f Dockerfile
docker push stefanprodan/steerer:$(VERSION)
kubectl apply -f ./artifacts/steerer/crd.yaml
helm upgrade --install steerer ./charts/steerer --namespace=istio-system --set crd.create=false
docker build -t stefanprodan/flagger:$(VERSION) . -f Dockerfile
docker push stefanprodan/flagger:$(VERSION)
kubectl apply -f ./artifacts/flagger/crd.yaml
helm upgrade --install flagger ./charts/flagger --namespace=istio-system --set crd.create=false

release:
git tag $(VERSION)
Expand Down
Loading

0 comments on commit c3f4f0a

Please sign in to comment.