Skip to content

Commit

Permalink
Merge pull request #457 from jinlinGuan/golang-1.23
Browse files Browse the repository at this point in the history
ci: add support for golang 1.23
  • Loading branch information
cloudxxx8 authored Oct 3, 2024
2 parents b5a5e52 + 81ac4da commit 0b81fa1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/test/groovy/edgeXBuildGoParallelSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public class EdgeXBuildGoParallelSpec extends JenkinsPipelineSpecification {
'SILO': 'sandbox'
]
edgeXBuildGoParallel.getBinding().setVariable('env', environmentVariables)
getPipelineMock('edgex.getGoLangBaseImage').call(_) >> 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.21-alpine'
getPipelineMock('edgex.getGoLangBaseImage').call(_) >> 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.23-alpine'
expect:
edgeXBuildGoParallel.toEnvironment(config) == expectedResult
where:
Expand All @@ -231,7 +231,7 @@ public class EdgeXBuildGoParallelSpec extends JenkinsPipelineSpecification {
USE_SEMVER: true,
TEST_SCRIPT: 'make test',
BUILD_SCRIPT: 'make build',
GO_VERSION: '1.21',
GO_VERSION: '1.23',
USE_ALPINE: true,
DOCKER_FILE_GLOB: 'cmd/**/Dockerfile',
DOCKER_IMAGE_NAME_PREFIX: '',
Expand Down
4 changes: 2 additions & 2 deletions vars/edgeXBuildGoApp.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.jenkinsci.plugins.workflow.libs.Library
semver | optional | bool | Specify if semantic versioning will be used to version your project. **Note** edgeX utilizes [git-semver](https://github.com/edgexfoundry/git-semver) for semantic versioning.<br /><br />**Default**: `true`
testScript | optional | str | The command the build will use to test your project. **Note** the specified test script will execute in the project's CI build container.<br /><br />**Default**: `make test`
buildScript | optional | str | The command the build will use to build your project.<br /><br />**Default**: `make build`
goVersion | optional | str | The version of Go to use for building the project's CI build image. **Note** this parameter is used in conjuction with the `useAlpineBase` parameter to determine the base for the project's CI build image.<br /><br />**Default**: `1.21`
goVersion | optional | str | The version of Go to use for building the project's CI build image. **Note** this parameter is used in conjuction with the `useAlpineBase` parameter to determine the base for the project's CI build image.<br /><br />**Default**: `1.23`
goProxy | optional | str | The proxy to use when downloading Go modules. The value of this parameter will be set in the `GOPROXY` environment variable to control the download source of Go modules.<br /><br />**Default**: `https://nexus3.edgexfoundry.org/repository/go-proxy/`
useAlpineBase | optional | bool | Specify if an Alpine-based `edgex-golang-base:${goVersion}-alpine` image will be used as the base for the project's CI build image. If true, the respective `edgex-golang-base` image should exist in the Nexus snapshot repository, if a matching image is not found in Nexus then an Alpine-based `go-lang:${goVersion}-alpine` DockerHub image will be used. If false, then a non-Alpine `go-lang:${goVersion}` DockerHub image will be used. **Note** this parameter is used in conjuction with the `goVersion` parameter to determine the base for the projects' CI build image.<br /><br />**Default**: `true`
dockerFilePath | optional | str | The path to the Dockerfile for your project.<br /><br />**Default**: `Dockerfile`
Expand Down Expand Up @@ -638,7 +638,7 @@ def toEnvironment(config) {
def _useSemver = edgex.defaultTrue(config.semver)
def _testScript = config.testScript ?: 'make test'
def _buildScript = config.buildScript ?: 'make build'
def _goVersion = config.goVersion ?: '1.21'
def _goVersion = config.goVersion ?: '1.23'
def _goProxy = config.goProxy ?: 'https://nexus3.edgexfoundry.org/repository/go-proxy/'
def _useAlpine = edgex.defaultTrue(config.useAlpineBase)

Expand Down
4 changes: 2 additions & 2 deletions vars/edgeXBuildGoParallel.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.jenkinsci.plugins.workflow.libs.Library
semver | optional | bool | Specify if semantic versioning will be used to version your project. **Note** edgeX utilizes [git-semver](https://github.com/edgexfoundry/git-semver) for semantic versioning.<br /><br />**Default**: `true`
testScript | optional | str | The command the build will use to test your project. **Note** the specified test script will execute in the project's CI build container.<br /><br />**Default**: `make test`
buildScript | optional | str | The command the build will use to build your project.<br /><br />**Default**: `make build`
goVersion | optional | str | The version of Go to use for building the project's CI build image. **Note** this parameter is used in conjuction with the `useAlpineBase` parameter to determine the base for the project's CI build image.<br /><br />**Default**: `1.21`
goVersion | optional | str | The version of Go to use for building the project's CI build image. **Note** this parameter is used in conjuction with the `useAlpineBase` parameter to determine the base for the project's CI build image.<br /><br />**Default**: `1.23`
goProxy | optional | str | The proxy to use when downloading Go modules. The value of this parameter will be set in the `GOPROXY` environment variable to control the download source of Go modules.<br /><br />**Default**: `https://nexus3.edgexfoundry.org/repository/go-proxy/`
useAlpineBase | optional | bool | Specify if an Alpine-based `edgex-golang-base:${goVersion}-alpine` image will be used as the base for the project's CI build image. If true, the respective `edgex-golang-base` image should exist in the Nexus snapshot repository, if a matching image is not found in Nexus then an Alpine-based `go-lang:${goVersion}-alpine` DockerHub image will be used. If false, then a non-Alpine `go-lang:${goVersion}` DockerHub image will be used. **Note** this parameter is used in conjuction with the `goVersion` parameter to determine the base for the projects' CI build image.<br /><br />**Default**: `true`
dockerFileGlobPath | optional | str | The pattern for finding Dockerfiles to build. **Note** Docker images will be named with the same name as the directory which the Dockerfile was found in with a `docker-` prefix and `-go` suffix. Example: `docker-<folder>-go`<br /><br />**Default**: `cmd/** /Dockerfile`
Expand Down Expand Up @@ -566,7 +566,7 @@ def toEnvironment(config) {
def _useSemver = edgex.defaultTrue(config.semver)
def _testScript = config.testScript ?: 'make test'
def _buildScript = config.buildScript ?: 'make build'
def _goVersion = config.goVersion ?: '1.21'
def _goVersion = config.goVersion ?: '1.23'
def _useAlpine = edgex.defaultTrue(config.useAlpineBase)

def _dockerFileGlob = config.dockerFileGlobPath ?: 'cmd/**/Dockerfile'
Expand Down
3 changes: 2 additions & 1 deletion vars/edgex.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ def getGoLangBaseImage(version, alpineBased, branchOverride = null) {
'1.17': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.17-alpine',
'1.18': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.18-alpine',
'1.20': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.20-alpine',
'1.21': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.21-alpine'
'1.21': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.21-alpine',
'1.23': 'nexus3.edgexfoundry.org:10003/edgex-devops/edgex-golang-base:1.23-alpine'
]

def goLTSImages = [
Expand Down

0 comments on commit 0b81fa1

Please sign in to comment.