Skip to content

Commit

Permalink
Merge pull request #171 from vfarcic/extension
Browse files Browse the repository at this point in the history
Extensions
  • Loading branch information
vfarcic authored Jan 26, 2020
2 parents c5c9113 + f6548ef commit 8829db1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ unittest:
CGO_ENABLED=$(CGO_ENABLED) $(GO) \
test --run UnitTest -v

functest:
CGO_ENABLED=$(CGO_ENABLED) $(GO) test -test.v --run FunctionalTest --cover

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)\/vfarcic\/$(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/go-demo-6/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Default values for Go projects.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
replicaCount: 3
image:
repository: draft
tag: dev
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)\/vfarcic\/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
4 changes: 2 additions & 2 deletions functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *FunctionalTestSuite) SetupTest() {
// Functional

func (s FunctionalTestSuite) Test_Hello_ReturnsStatus200() {
address := fmt.Sprintf("http://%s%s/hello", s.hostIp, s.servicePath)
address := fmt.Sprintf("%s%s/hello", s.hostIp, s.servicePath)
logPrintf("Sending a request to %s\n", address)
resp, err := http.Get(address)

Expand All @@ -40,7 +40,7 @@ func (s FunctionalTestSuite) Test_Hello_ReturnsStatus200() {
}

func (s FunctionalTestSuite) Test_Person_ReturnsStatus200() {
address := fmt.Sprintf("http://%s%s/person", s.hostIp, s.servicePath)
address := fmt.Sprintf("%s%s/person", s.hostIp, s.servicePath)
logPrintf("Sending a request to %s\n", address)
resp, err := http.Get(address)

Expand Down
6 changes: 6 additions & 0 deletions jenkins-x.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
buildPack: go
pipelineConfig:
pipelines:
pullRequest:
build:
preSteps:
- command: make unittest
4 changes: 2 additions & 2 deletions production_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (s ProductionTestSuite) Test_Hello_ReturnsStatus200() {
minutes := float64(0)
counter := 0
for time.Since(start).Minutes() < max {
address := fmt.Sprintf("http://%s/demo/hello", s.hostIp)
address := fmt.Sprintf("%s/demo/hello", s.hostIp)
resp, err := http.Get(address)
counter++
if err != nil {
Expand All @@ -57,7 +57,7 @@ func (s ProductionTestSuite) Test_Hello_ReturnsStatus200() {
time.Sleep(1 * time.Second)
}
} else {
address := fmt.Sprintf("http://%s/demo/hello", s.hostIp)
address := fmt.Sprintf("%s/demo/hello", s.hostIp)
resp, err := http.Get(address)

if err != nil {
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: vfarcic/go-demo-6
context: .
docker: {}
tagPolicy:
Expand Down

0 comments on commit 8829db1

Please sign in to comment.