Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update goreleaser to v1.2.4 in build image #1168

Merged
merged 7 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ builds:
goos: *goos
goarch: *goarch
dockers:
- binaries:
- ids:
- controller
image_templates:
- 'ghcr.io/kanisterio/controller:{{ .Tag }}'
dockerfile: 'docker/controller/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/kanister-tools:{{ .Tag }}'
Expand All @@ -50,20 +50,20 @@ dockers:
- "--build-arg=kan_tools_version={{ .Tag }}"
extra_files:
- 'LICENSE'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/postgres-kanister-tools:{{ .Tag }}'
dockerfile: 'docker/postgres-kanister-tools/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/postgres-tools-9.6:{{ .Tag }}'
dockerfile: 'docker/postgres-tools-9.6/Dockerfile'
- image_templates:
- 'ghcr.io/kanisterio/postgresql:{{ .Tag }}'
dockerfile: 'docker/postgresql/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/es-sidecar:{{ .Tag }}'
Expand All @@ -72,7 +72,7 @@ dockers:
- "--build-arg=TOOLS_IMAGE=ghcr.io/kanisterio/kanister-tools:{{ .Tag }}"
extra_files:
- 'docker/kanister-elasticsearch/image/esdump-setup.sh'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/mysql-sidecar:{{ .Tag }}'
Expand All @@ -84,7 +84,7 @@ dockers:
dockerfile: 'docker/kanister-kubectl/Dockerfile'
build_flag_templates:
- "--build-arg=TOOLS_IMAGE=ghcr.io/kanisterio/kanister-tools:{{ .Tag }}"
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/mongo-sidecar:{{ .Tag }}'
Expand All @@ -94,22 +94,22 @@ dockers:
- 'docker/kanister-mongodb-replicaset/image/90forceyes'
- 'docker/kanister-mongodb-replicaset/image/config'
- 'docker/kanister-mongodb-replicaset/image/gbl_env.sh'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/mongodb:{{ .Tag }}'
dockerfile: 'docker/mongodb/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/cassandra:{{ .Tag }}'
dockerfile: 'docker/cassandra/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/couchbase-tools:{{ .Tag }}'
dockerfile: 'docker/couchbase-tools/Dockerfile'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/foundationdb:{{ .Tag }}'
Expand All @@ -120,7 +120,7 @@ dockers:
extra_files:
- 'docker/kafka-adobes3Connector/image/adobe-monitorsource.sh'
- 'docker/kafka-adobes3Connector/image/cleans3.py'
- binaries:
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/kafka-adobe-s3-sink-connector:{{ .Tag }}'
Expand All @@ -137,3 +137,5 @@ changelog:
exclude:
- '^docs:'
- '^test:'
archives:
- allow_different_binary_count: true
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ IMAGE_NAME := $(BIN)

IMAGE := $(REGISTRY)/$(IMAGE_NAME)

BUILD_IMAGE ?= ghcr.io/kanisterio/build:v0.0.14
BUILD_IMAGE ?= ghcr.io/kanisterio/build:v0.0.15

# tag 0.1.0 is, 0.0.1 (latest) + gh + aws + helm binary
DOCS_BUILD_IMAGE ?= ghcr.io/kanisterio/docker-sphinx:0.2.0
Expand Down Expand Up @@ -88,6 +88,12 @@ all-push: $(addprefix push-, $(ALL_ARCH))

build: bin/$(ARCH)/$(BIN)

build-controller:
@$(MAKE) run CMD='-c " \
goreleaser build --id $(BIN) --rm-dist --debug --snapshot \
&& cp dist/$(BIN)_linux_$(ARCH)/$(BIN) bin/$(ARCH)/$(BIN) \
"'

bin/$(ARCH)/$(BIN):
@echo "building: $@"
@$(MAKE) run CMD='-c " \
Expand Down Expand Up @@ -245,7 +251,7 @@ gorelease:
@$(MAKE) run CMD='-c "./build/gorelease.sh"'

release-snapshot:
@$(MAKE) run CMD='-c "GORELEASER_CURRENT_TAG=latest goreleaser --debug release --rm-dist --snapshot"'
@$(MAKE) run CMD='-c "GORELEASER_CURRENT_TAG=v9.99.9-dev goreleaser --debug release --rm-dist --snapshot"'

go-mod-download:
@$(MAKE) run CMD='-c "go mod download"'
Expand Down
2 changes: 1 addition & 1 deletion build/push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o nounset
IMAGE_REGISTRY="ghcr.io/kanisterio"
IMAGES=("mysql-sidecar" "kafka-adobe-s3-sink-connector" "postgres-kanister-tools" "postgresql" "postgres-tools-9.6" "cassandra" "kanister-kubectl-1.18" "mongo-sidecar" "mongodb" "es-sidecar" "controller" "kanister-tools" "couchbase-tools" "kafka-adobe-s3-source-connector" "foundationdb")

TAG=${1:-"latest"}
TAG=${1:-"v9.99.9-dev"}

for i in ${IMAGES[@]}; do
docker push $IMAGE_REGISTRY/$i:$TAG
Expand Down
2 changes: 1 addition & 1 deletion docker/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY --from=golang:1.16.8-alpine3.14 /usr/local/go/ /usr/local/go/

COPY --from=bitnami/kubectl:1.17 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/

COPY --from=goreleaser/goreleaser:v0.127.0 /bin/goreleaser /usr/local/bin/
COPY --from=goreleaser/goreleaser:v1.2.4 /usr/local/bin/goreleaser /usr/local/bin/

COPY --from=alpine/helm:3.1.0 /usr/bin/helm /usr/local/bin/

Expand Down
4 changes: 2 additions & 2 deletions pkg/app/bp.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func updateImageTags(bp *crv1alpha1.Blueprint) {
continue
}

// ghcr.io/kanisterio/tools:v0.xx.x => ghcr.io/kanisterio/tools:latest
phase.Args["image"] = fmt.Sprintf("%s:latest", strings.Split(imageStr, ":")[0])
// ghcr.io/kanisterio/tools:v0.xx.x => ghcr.io/kanisterio/tools:v9.99.9-dev
phase.Args["image"] = fmt.Sprintf("%s:v9.99.9-dev", strings.Split(imageStr, ":")[0])

// Change imagePullPolicy to Always using podOverride config
phase.Args["podOverride"] = crv1alpha1.JSONMap{
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/bp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ func validateImageTags(c *C, bp *crv1alpha1.Blueprint) {
if !ok {
continue
}
// Verify if the tag is "latest"
// Verify if the tag is "v9.99.9-dev"
c.Log(fmt.Sprintf("phase:%s, image:%s", phase.Name, image.(string)))
c.Assert(strings.Split(image.(string), ":")[1], Equals, "latest")
c.Assert(strings.Split(image.(string), ":")[1], Equals, "v9.99.9-dev")
c.Assert(phase.Args["podOverride"], DeepEquals, podOverride)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewCassandraInstance(name string) App {
Values: map[string]string{
"image.registry": "ghcr.io",
"image.repository": "kanisterio/cassandra",
"image.tag": "latest",
"image.tag": "v9.99.9-dev",
"image.pullPolicy": "Always",
"cluster.replicaCount": "1",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewMongoDB(name string) App {
"architecture": "replicaset",
"image.registry": "ghcr.io",
"image.repository": "kanisterio/mongodb",
"image.tag": "latest",
"image.tag": "v9.99.9-dev",
"image.pullPolicy": "Always",
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewPostgresDB(name string, subPath string) App {
Values: map[string]string{
"image.registry": "ghcr.io",
"image.repository": "kanisterio/postgresql",
"image.tag": "latest",
"image.tag": "v9.99.9-dev",
"image.pullPolicy": "Always",
"postgresqlPassword": "test@54321",
"postgresqlExtendedConf.archiveCommand": "envdir /bitnami/postgresql/data/env wal-e wal-push %p",
Expand Down
4 changes: 2 additions & 2 deletions pkg/kube/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type PodSuite struct {
const (
testSAName = "test-sa"
controllerSA = "controller-sa"
kanisterToolsImage = "ghcr.io/kanisterio/kanister-tools:latest"
kanisterToolsImage = "ghcr.io/kanisterio/kanister-tools:v9.99.9-dev"
)

var _ = Suite(&PodSuite{})
Expand Down Expand Up @@ -268,7 +268,7 @@ func (s *PodSuite) TestPodWithVolumes(c *C) {
pod, err := CreatePod(ctx, cli, &PodOptions{
Namespace: s.namespace,
GenerateName: "test-",
Image: "ghcr.io/kanisterio/kanister-tools:latest",
Image: "ghcr.io/kanisterio/kanister-tools:v9.99.9-dev",
Command: []string{"sh", "-c", "tail -f /dev/null"},
Volumes: vols,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func newTestPodTemplateSpec() v1.PodTemplateSpec {
Containers: []v1.Container{
v1.Container{
Name: "test-container",
Image: "ghcr.io/kanisterio/kanister-tools:latest",
Image: "ghcr.io/kanisterio/kanister-tools:v9.99.9-dev",
Command: []string{"tail"},
Args: []string{"-f", "/dev/null"},
},
Expand Down