Skip to content

Commit

Permalink
chore: get rid of build.sh and env.props
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Jun 23, 2024
1 parent 417e2cc commit a956d29
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 29 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
REGISTRY_ORG = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
stages {
stage('Prepare Docker') {
Expand Down Expand Up @@ -87,9 +87,9 @@ pipeline {
// This function is defined in the jenkins-infra/pipeline-library
infra.withDockerCredentials {
if (isUnix()) {
sh './build.sh -r $REMOTING_VERSION -b $BUILD_NUMBER -d publish'
sh 'make publish'
} else {
powershell '& ./build.ps1 -DisableEnvProps publish'
powershell '& ./build.ps1 publish'
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ prepare-test: bats check-reqs
git submodule update --init --recursive
mkdir -p target

publish:
@set -x; $(bake_base_cli) linux --push

## Define bats options based on environment
# common flags for all tests
bats_flags := ""
Expand Down
17 changes: 2 additions & 15 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Param(
# Windows flavor and windows version to build
[String] $ImageType = 'nanoserver-ltsc2019',
[String] $BuildNumber = '1',
# Set to true to disable env.props
[switch] $DisableEnvProps = $false,
# Print the build and publish command instead of executing them if set
[switch] $DryRun = $false,
# Output debug info for tests: 'empty' (no additional test output), 'debug' (test cmd & stderr outputed), 'verbose' (test cmd, stderr, stdout outputed)
Expand All @@ -35,17 +33,6 @@ if ($AgentType -ne '' -and $AgentType -in $AgentTypes) {
$AgentTypes = @($AgentType)
}

if (!$DisableEnvProps) {
Get-Content env.props | ForEach-Object {
$items = $_.Split('=')
if ($items.Length -eq 2) {
$name = $items[0].Trim()
$value = $items[1].Trim()
Set-Item -Path "env:$($name)" -Value $value
}
}
}

if (![String]::IsNullOrWhiteSpace($env:REMOTING_VERSION)) {
$RemotingVersion = $env:REMOTING_VERSION
}
Expand All @@ -59,8 +46,8 @@ if (![String]::IsNullOrWhiteSpace($env:IMAGE_TYPE)) {
}

$Organisation = 'jenkins4eval'
if (![String]::IsNullOrWhiteSpace($env:DOCKERHUB_ORGANISATION)) {
$Organisation = $env:DOCKERHUB_ORGANISATION
if (![String]::IsNullOrWhiteSpace($env:REGISTRY_ORG)) {
$Organisation = $env:REGISTRY_ORG
}

# Ensure constant env vars used in docker-bake.hcl are defined
Expand Down
1 change: 0 additions & 1 deletion env.props

This file was deleted.

10 changes: 0 additions & 10 deletions updatecli/updatecli.d/remoting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ targets:
replacepattern: >-
$$RemotingVersion${1}= '{{ source "lastVersion" }}',
scmid: default
setEnvProps:
name: Bump the Jenkins remoting version on the env.props file
kind: file
spec:
file: env.props
matchpattern: >-
REMOTING_VERSION=(.*)
replacepattern: >-
REMOTING_VERSION={{ source "lastVersion" }}
scmid: default

actions:
default:
Expand Down

0 comments on commit a956d29

Please sign in to comment.