Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
docker/jenkins-support at master · texaspark/docker · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
texaspark
docker
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
docker
/
jenkins-support
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
127 lines (124 loc) · 4.88 KB
master
Breadcrumbs
docker
/
jenkins-support
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
127 lines (124 loc) · 4.88 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!
/bin/bash -eu
#
compare if version1 < version2
versionLT
() {
local
v1
;
v1=
$(
echo
"
$1
"
|
cut -d
'
-
'
-f 1
)
local
q1
;
q1=
$(
echo
"
$1
"
|
cut -s -d
'
-
'
-f 2-
)
local
v2
;
v2=
$(
echo
"
$2
"
|
cut -d
'
-
'
-f 1
)
local
q2
;
q2=
$(
echo
"
$2
"
|
cut -s -d
'
-
'
-f 2-
)
if
[
"
$v1
"
=
"
$v2
"
]
;
then
if
[
"
$q1
"
=
"
$q2
"
]
;
then
return
1
else
if
[
-z
"
$q1
"
]
;
then
return
1
else
if
[
-z
"
$q2
"
]
;
then
return
0
else
[
"
$q1
"
=
"
$(
echo -e
"
$q1
\n
$q2
"
|
sort -V
|
head -n1
)
"
]
fi
fi
fi
else
[
"
$v1
"
=
"
$(
echo -e
"
$v1
\n
$v2
"
|
sort -V
|
head -n1
)
"
]
fi
}
#
returns a plugin version from a plugin archive
get_plugin_version
() {
local
archive
;
archive=
$1
local
version
;
version=
$(
unzip -p
"
$archive
"
META-INF/MANIFEST.MF
|
grep
"
^Plugin-Version:
"
|
sed -e
'
s#^Plugin-Version: ##
'
)
version=
${version
%%
[[:space:]]}
echo
"
$version
"
}
#
Copy files from /usr/share/jenkins/ref into $JENKINS_HOME
#
So the initial JENKINS-HOME is set with expected content.
#
Don't override, as this is just a reference setup, and use from UI
#
can then change this, upgrade plugins, etc.
copy_reference_file
() {
f=
"
${1
%/
}
"
b=
"
${f
%
.override}
"
rel=
"
${b
:
23}
"
version_marker=
"
${rel}
.version_from_image
"
dir=
$(
dirname
"
${b}
"
)
local
action
;
local
reason
;
local
container_version
;
local
image_version
;
local
marker_version
;
local
log
;
log=false
if
[[
${rel}
==
plugins/
*
.jpi ]]
;
then
container_version=
$(
get_plugin_version
"
$JENKINS_HOME
/
${rel}
"
)
image_version=
$(
get_plugin_version
"
${f}
"
)
if
[[
-e
$JENKINS_HOME
/
${version_marker}
]]
;
then
marker_version=
$(
cat
"
$JENKINS_HOME
/
${version_marker}
"
)
if
versionLT
"
$marker_version
"
"
$container_version
"
;
then
action=
"
SKIPPED
"
reason=
"
Installed version (
$container_version
) has been manually upgraded from initial version (
$marker_version
)
"
log=true
else
if
[[
"
$image_version
"
==
"
$container_version
"
]]
;
then
action=
"
SKIPPED
"
reason=
"
Version from image is the same as the installed version
$image_version
"
else
if
versionLT
"
$image_version
"
"
$container_version
"
;
then
action=
"
SKIPPED
"
log=true
reason=
"
Image version (
$image_version
) is older than installed version (
$container_version
)
"
else
action=
"
UPGRADED
"
log=true
reason=
"
Image version (
$image_version
) is newer than installed version (
$container_version
)
"
fi
fi
fi
else
if
[[
-n
"
$TRY_UPGRADE_IF_NO_MARKER
"
]]
;
then
if
[[
"
$image_version
"
==
"
$container_version
"
]]
;
then
action=
"
SKIPPED
"
reason=
"
Version from image is the same as the installed version
$image_version
(no marker found)
"
#
Add marker for next time
echo
"
$image_version
"
>
"
$JENKINS_HOME
/
${version_marker}
"
else
if
versionLT
"
$image_version
"
"
$container_version
"
;
then
action=
"
SKIPPED
"
log=true
reason=
"
Image version (
$image_version
) is older than installed version (
$container_version
) (no marker found)
"
else
action=
"
UPGRADED
"
log=true
reason=
"
Image version (
$image_version
) is newer than installed version (
$container_version
) (no marker found)
"
fi
fi
fi
fi
if
[[
!
-e
$JENKINS_HOME
/
${rel}
||
"
$action
"
==
"
UPGRADED
"
||
$f
=
*
.override ]]
;
then
action=
${action
:-
"
INSTALLED
"
}
log=true
mkdir -p
"
$JENKINS_HOME
/
${dir
:
23}
"
cp -r
"
${f}
"
"
$JENKINS_HOME
/
${rel}
"
;
#
pin plugins on initial copy
touch
"
$JENKINS_HOME
/
${rel}
.pinned
"
echo
"
$image_version
"
>
"
$JENKINS_HOME
/
${version_marker}
"
reason=
${reason
:-
$image_version
}
else
action=
${action
:-
"
SKIPPED
"
}
fi
else
if
[[
!
-e
$JENKINS_HOME
/
${rel}
||
$f
=
*
.override ]]
then
action=
"
INSTALLED
"
log=true
mkdir -p
"
$JENKINS_HOME
/
${dir
:
23}
"
cp -r
"
${f}
"
"
$JENKINS_HOME
/
${rel}
"
;
else
action=
"
SKIPPED
"
fi
fi
if
[[
-n
"
$VERBOSE
"
||
"
$log
"
==
"
true
"
]]
;
then
if
[
-z
"
$reason
"
]
;
then
echo
"
$action
$rel
"
>>
"
$COPY_REFERENCE_FILE_LOG
"
else
echo
"
$action
$rel
:
$reason
"
>>
"
$COPY_REFERENCE_FILE_LOG
"
fi
fi
}
You can’t perform that action at this time.