File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
java/org/csanchez/jenkins/plugins/kubernetes/pipeline
resources/org/csanchez/jenkins/plugins/kubernetes/pipeline Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 203203 <artifactId >junit</artifactId >
204204 <scope >test</scope >
205205 </dependency >
206+ <dependency >
207+ <groupId >org.jenkins-ci.plugins</groupId >
208+ <artifactId >pipeline-maven</artifactId >
209+ <version >1362.vee39a_d4b_02b_1</version >
210+ <scope >test</scope >
211+ </dependency >
206212 <dependency >
207213 <groupId >org.jenkins-ci.plugins</groupId >
208214 <artifactId >scm-api</artifactId >
Original file line number Diff line number Diff line change @@ -115,4 +115,15 @@ public void envVarDollarSignEscaping() throws Exception {
115115 r .assertLogContains ("outside container: $string$with$dollars" , b );
116116 r .assertLogContains ("inside container: $string$with$dollars" , b );
117117 }
118+
119+ @ Test
120+ public void containerEnvironmentIsHonored () throws Exception {
121+ assertNotNull (createJobThenScheduleRun ());
122+ r .waitForCompletion (b );
123+ r .assertLogContains (
124+ "from Groovy: /opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" , b );
125+ r .assertLogContains ("inside container: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" , b );
126+ r .assertLogContains (
127+ "inside withMaven in container: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" , b );
128+ }
118129}
Original file line number Diff line number Diff line change 1+ podTemplate(yaml : '''
2+ spec:
3+ containers:
4+ - name: jnlp
5+ image: jenkins/inbound-agent:3192.v713e3b_039fb_e-1
6+ # PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
7+ - name: alpine
8+ image: alpine:3.19.0
9+ # PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10+ command:
11+ - sleep
12+ args:
13+ - infinity
14+ ''' ) {
15+ node(POD_LABEL ) {
16+ echo " from Groovy: ${ env.PATH} "
17+ sh ' echo "outside container: $PATH"'
18+ container(' alpine' ) {
19+ sh ' echo "inside container: $PATH"'
20+ withMaven(publisherStrategy : ' EXPLICIT' , traceability : false ) {
21+ sh ' echo "inside withMaven in container: $PATH"'
22+ }
23+ }
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments