Skip to content

Commit

Permalink
Merge pull request #174 from vfarcic/my-new-pr
Browse files Browse the repository at this point in the history
My PR
  • Loading branch information
vfarcic authored Feb 11, 2020
2 parents 1c034c4 + 22de5ca commit 0bdfe4b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ lint: vendor | $(PKGS) $(GOLINT) # ❷
test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \
done ; exit $$ret

unittest:
CGO_ENABLED=$(CGO_ENABLED) $(GO) \
test --run UnitTest -v

2 changes: 1 addition & 1 deletion charts/go-demo-6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ifeq ($(OS),Darwin)
sed -i "" -e "s/tag:.*/tag: $(VERSION)/" values.yaml
else ifeq ($(OS),Linux)
sed -i -e "s/version:.*/version: $(VERSION)/" Chart.yaml
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-26\/$(NAME)|" values.yaml
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-27\/$(NAME)|" values.yaml
sed -i -e "s/tag:.*/tag: $(VERSION)/" values.yaml
else
echo "platfrom $(OS) not supported to tag with"
Expand Down
2 changes: 1 addition & 1 deletion charts/preview/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ifeq ($(OS),Darwin)
else ifeq ($(OS),Linux)
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-26\/go-demo-6|" values.yaml
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/devops-27\/go-demo-6|" values.yaml
sed -i -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml
else
echo "platfrom $(OS) not supported to release from"
Expand Down
8 changes: 8 additions & 0 deletions charts/preview/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ preview:
tag:
pullPolicy: IfNotPresent
probePath: /demo/hello?health=true


db:
enabled: false

preview-db:
persistence:
enabled: false
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func HelloServer(w http.ResponseWriter, req *http.Request) {
delayNum, _ := strconv.Atoi(delay)
sleep(time.Duration(delayNum) * time.Millisecond)
}
io.WriteString(w, "hello, world!\n")
io.WriteString(w, "hello, PR!\n")
}

func RandomErrorServer(w http.ResponseWriter, req *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *MainTestSuite) Test_HelloServer_WritesHelloWorld() {

HelloServer(w, req)

w.AssertCalled(s.T(), "Write", []byte("hello, world!\n"))
w.AssertCalled(s.T(), "Write", []byte("hello, PR!\n"))
}

func (s *MainTestSuite) Test_HelloServer_Waits_WhenDelayIsPresent() {
Expand Down
2 changes: 1 addition & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v1beta2
kind: Config
build:
artifacts:
- image: devops-26/go-demo-6
- image: devops-27/go-demo-6
context: .
docker: {}
tagPolicy:
Expand Down
4 changes: 2 additions & 2 deletions watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# watch the go files and continously deploy the service
make linux
skaffold run -p dev
reflex -r "\.go$" -- bash -c 'make linux && skaffold run -p dev'
UUID=$(uuidgen) skaffold run -p dev
reflex -r "\.go$" -- bash -c 'make linux && make unittest && UUID=$(uuidgen) skaffold run -p dev'

0 comments on commit 0bdfe4b

Please sign in to comment.