You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
The after-script section in the following custom pipeline is never triggered:
pipelines:
custom:
test-job:
- step:
name: Run Postman
image: alpine:3.15
script:
- apk add npm bash
- npm install -g newman
- echo "This runs"
after-script:
- echo "This doesn't run"
Although the following works:
pipelines:
custom:
test-job:
- step:
name: Run Postman
image: alpine:3.15
script:
- echo "This runs"
after-script:
- echo "This also runs"
This seems like a pipeline bug to me. Any ideas what might be causing this?
Hey @Konstantinos
Welcome to the community!
I tested and verified that this issue is only reproducible on the alpine image and other docker image works fine.
Further investigation, I found out that this was caused by the command
add npm bash
The root cause it's a little complex, but the simplified version is before we start the build, we will try to check if `/bin/bash` existed or not. If yes, we add a special redirection command in "~/.bashrc" to make the output redirect correctly.
However, because alpine does not have a `/bin/bash` build-in, we don't put that file in the image, and when the user installs bash in the build script, our after build script would find "/bin/bash" and execute after build script in bash context. It would miss the log because it doesn't have `~/.bashrc` in place, so it doesn't redirect properly.
There are two suggestion to fix it, which is:
I hope this helps.
Cheers,
Syahrul
Hi @Syahrul ,
Thanks a lot for the explanation. Is there a way to submit a bug report for this issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't classify this as a bug because it's expected behavior, and this is more towards a feature since the issue happens because the alpine image doesn't include `/bin/bash` in their image.
I would suggest you raise the feature with the alpine team here .
Cheers,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@SyahrulI still believe this is a bug due to the following reasons:
- The shell used on the image shouldn't interact in any way with the CI. The same jobs work fine on all other major CI solutions (github, gitlab, circleci). Bitbucket is the odd one out here.
- If this is expected behavior are there any docs? The job fails silently without an error message and the user isn't able to debug on their own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologize for the confusion. It makes more sense to have an error message on the build log.
I did check with our devs team and found out that we already have an existing bug report on this at:
I highly suggest you Vote and click This affects my team so that you'll receive an update whenever we have any in the future.
Cheers,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.