Skip to content

Commit 7e4929e

Browse files
committedJan 15, 2025
chore: upgrade and cleanup
related to jenkins-x/jx#8670
1 parent 47d79e8 commit 7e4929e

File tree

12 files changed

+531
-2609
lines changed

12 files changed

+531
-2609
lines changed
 

‎.goreleaser.yml

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,63 @@
1+
version: 2
12
env:
23
- GO111MODULE=on
34
- CGO_ENABLED=0
45
before:
56
hooks:
67
- go mod download
7-
88
builds:
99
- id: jx-build-controller
1010
# Path to main.go file or main package.
1111
# Default is `.`.
1212
main: ./cmd/main.go
13-
1413
# Binary name.
1514
# Can be a path (e.g. `bin/app`) to wrap the binary in a directory.
1615
# Default is the name of the project directory.
1716
binary: jx-build-controller
18-
1917
# Custom ldflags templates.
2018
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
2119
ldflags:
2220
- -X "github.com/jenkins-x-plugins/jx-build-controller/pkg/version.Version={{.Env.VERSION}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Version={{.Env.VERSION}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Revision={{.Env.REV}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.Branch={{.Env.BRANCH}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.BuildDate={{.Env.BUILDDATE}}" -X "{{.Env.ROOTPACKAGE}}/pkg/version.GoVersion={{.Env.GOVERSION}}"
23-
2421
# GOOS list to build for.
2522
# For more info refer to: https://golang.org/doc/install/source#environment
2623
# Defaults are darwin and linux.
2724
goos:
2825
- windows
2926
- darwin
3027
- linux
31-
3228
# GOARCH to build for.
3329
# For more info refer to: https://golang.org/doc/install/source#environment
3430
# Defaults are 386 and amd64.
3531
goarch:
3632
- amd64
37-
- arm
3833
- arm64
39-
34+
ignore:
35+
- goos: windows
36+
goarch: arm64
4037
archives:
4138
- name_template: "jx-build-controller-{{ .Os }}-{{ .Arch }}"
4239
format_overrides:
4340
- goos: windows
4441
format: zip
45-
4642
checksum:
4743
# You can change the name of the checksums file.
4844
# Default is `jx-build-controller_{{ .Version }}_checksums.txt`.
4945
name_template: "jx-build-controller-checksums.txt"
50-
5146
# Algorithm to be used.
5247
# Accepted options are sha256, sha512, sha1, crc32, md5, sha224 and sha384.
5348
# Default is sha256.
5449
algorithm: sha256
55-
5650
changelog:
57-
# set it to true if you wish to skip the changelog generation
58-
skip: true
59-
51+
disable: true
6052
release:
6153
# If set to true, will not auto-publish the release.
6254
# Default is false.
6355
draft: false
64-
6556
# If set to auto, will mark the release as not ready for production
6657
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
6758
# If set to true, will mark the release as not ready for production.
6859
# Default is false.
6960
prerelease: false
70-
7161
# You can change the name of the GitHub release.
7262
# Default is `{{.Tag}}`
7363
name_template: "{{.Env.VERSION}}"
74-

‎Makefile

+2-13
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ ROOT_PACKAGE := github.com/$(ORG_REPO)
1717
# This does not reflect the go binary version which was used to build the jx binary, and also does not reflect the version in the catalog.
1818
# The sole purpose of this variable is to build a new binary if we ever need to build a new jx binary with a new go version with no code change.
1919
# If you notice that this version is not the same as the catalog version, please open a PR, the maintainers are happy to review it.
20-
DUMMY_GO_VERSION := 1.18.6
21-
22-
GO_VERSION := $(shell $(GO) version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/')
20+
DUMMY_GO_VERSION := 1.23.3
2321

2422
GO_DEPENDENCIES := $(call rwildcard,pkg/,*.go) $(call rwildcard,cmd/j,*.go)
2523

@@ -40,13 +38,7 @@ VERSION ?= $(shell echo "$$(git for-each-ref refs/tags/ --count=1 --sort=-versio
4038
#BUILD_TIME_CONFIG_FLAGS ?= ""
4139

4240
# Full build flags used when building binaries. Not used for test compilation/execution.
43-
BUILDFLAGS := -ldflags \
44-
" -X $(ROOT_PACKAGE)/pkg/version.Version=$(VERSION)\
45-
-X $(ROOT_PACKAGE)/pkg/version.Revision='$(REV)'\
46-
-X $(ROOT_PACKAGE)/pkg/version.Branch='$(BRANCH)'\
47-
-X $(ROOT_PACKAGE)/pkg/version.BuildDate='$(BUILD_DATE)'\
48-
-X $(ROOT_PACKAGE)/pkg/version.GoVersion='$(GO_VERSION)'\
49-
$(BUILD_TIME_CONFIG_FLAGS)"
41+
BUILDFLAGS := -ldflags "$(BUILD_TIME_CONFIG_FLAGS)"
5042

5143
# Some tests expect default values for version.*, so just use the config package values there.
5244
TEST_BUILDFLAGS := -ldflags "$(BUILD_TIME_CONFIG_FLAGS)"
@@ -140,9 +132,6 @@ release: clean linux test
140132

141133
release-all: release linux win darwin
142134

143-
.PHONY: goreleaser
144-
goreleaser:
145-
step-go-releaser --organisation=$(ORG) --revision=$(REV) --branch=$(BRANCH) --build-date=$(BUILD_DATE) --go-version=$(GO_VERSION) --root-package=$(ROOT_PACKAGE) --version=$(VERSION)
146135

147136
.PHONY: clean
148137
clean: ## Clean the generated artifacts

‎charts/jx-build-controller/Makefile

-10
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,3 @@ clean:
1919
rm -rf charts
2020
rm -rf ${NAME}*.tgz
2121

22-
release: clean
23-
sed -i -e "s/version:.*/version: $(VERSION)/" Chart.yaml
24-
sed -i -e "s/tag:.*/tag: $(VERSION)/" values.yaml
25-
26-
helm dependency build
27-
helm lint
28-
helm package .
29-
helm repo add jx $(CHART_REPO)
30-
helm gcs push ${NAME}*.tgz jx --public
31-
rm -rf ${NAME}*.tgz%

‎cmd/app/main-win.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build windows
12
// +build windows
23

34
package app

‎cmd/app/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
package app

‎cmd/docs/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

‎cmd/docs/md_docs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)