Skip to content

Commit

Permalink
fix: afterscript should be reusing the same container
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith committed Oct 1, 2024
1 parent 49ee889 commit 7d3b2f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ export class Job {

this.refreshLongRunningSilentTimeout(writeStreams);

if (imageName) {
if (imageName && !this._containerId) {
await this.pullImage(writeStreams, imageName);

let dockerCmd = `${this.argv.containerExecutable} create --interactive ${this.generateInjectSSHAgentOptions()} `;
Expand Down
3 changes: 3 additions & 0 deletions tests/test-cases/after-script/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ default:
- echo "Cleanup after test"

test-job:
image: busybox
script:
- echo "Test something"
- echo "cache" > /tmp/cache
after_script:
- rm /tmp/cache
- echo "Cleanup after test"

build-job:
Expand Down

0 comments on commit 7d3b2f6

Please sign in to comment.