File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
tests/test-cases/after-script Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -689,7 +689,7 @@ export class Job {
689
689
690
690
this . refreshLongRunningSilentTimeout ( writeStreams ) ;
691
691
692
- if ( imageName ) {
692
+ if ( imageName && ! this . _containerId ) {
693
693
await this . pullImage ( writeStreams , imageName ) ;
694
694
695
695
let dockerCmd = `${ this . argv . containerExecutable } create --interactive ${ this . generateInjectSSHAgentOptions ( ) } ` ;
@@ -829,6 +829,11 @@ export class Job {
829
829
830
830
if ( imageName ) {
831
831
cmd += "cd /gcl-builds \n" ;
832
+
833
+ if ( expanded [ "CI_JOB_STATUS" ] != "running" ) {
834
+ // Ensures the env `CI_JOB_STATUS` is passed to the after_script context
835
+ cmd += `export CI_JOB_STATUS=${ expanded [ "CI_JOB_STATUS" ] } \n` ;
836
+ }
832
837
}
833
838
cmd += this . generateScriptCommands ( scripts ) ;
834
839
Original file line number Diff line number Diff line change 1
1
---
2
2
default :
3
+ image : busybox
3
4
after_script :
4
5
- echo "Cleanup after test"
5
6
6
7
test-job :
7
8
script :
8
9
- echo "Test something"
10
+ - echo "cache" > /tmp/cache
9
11
after_script :
12
+ - rm /tmp/cache
10
13
- echo "Cleanup after test"
11
14
12
15
build-job :
You can’t perform that action at this time.
0 commit comments