Hello,
I have been writing my bitbucket-pipelines.yml which includes artifacts in order to pass the generated war file during the building process for the next step(deployment)
However, the war is compressed as tar.gz.
Can I just upload admin.war to artifacts as it is?
The uploaded file is named as "artifact_2dfe02f9-78ba-4a44-9a33-b5bb96decd64.tar.gz"
image: gradle:6.6.0
pipelines:
default:
- parallel:
- step:
name: Build and Test
caches:
- gradle
script:
- ./gradlew build
- ./gradlew war
- apt-get update -y
- apt-get install tree -y
- tree
- cp build-0.0.1.war ../../admin.war
- cd ../..
- pwd
- ls -al
artifacts:
- admin.war
- step:
name: Deploy to test
deployment: test
trigger: manual
script:
- pipe: atlassian/bitbucket-upload-file:0.3.2
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: 'admin.war'
Tree
├── admin.war
├── bitbucket-$BITBUCKET_USERNAME.yml├── build
│ ├── classes
│ │
│ ├── libs
│ │ ├── build-0.0.1.war
│ │ └── exploded
│ │ └── admin-0.0.1.war
ls -al
total 14664
drwxrwxrwx. 8 root root 4096 Oct 4 09:22 .
drwxr-xr-x. 8 root root 4096 Oct 4 09:21 ..
-rw-rw-rw-. 1 root root 14954308 Oct 4 09:22 admin.war
-rw-rw-rw-. 1 root root 1392 Oct 4 09:22 bitbucket-$BITBUCKET_USERNAME.yml
drwxrwxrwx. 6 root root 4096 Oct 4 09:22 build
-rw-rw-rw-. 1 root root 3844 Oct 4 09:22 build.gradle
drwxrwxrwx. 8 root root 4096 Oct 4 09:22 .git
-rw-rw-rw-. 1 root root 2619 Oct 4 09:22 .gitignore
drwxrwxrwx. 3 root root 4096 Oct 4 09:22 gradle
drwxrwxrwx. 6 root root 4096 Oct 4 09:22 .gradle
-rwxrwxrwx. 1 root root 5774 Oct 4 09:22 gradlew
-rw-rw-rw-. 1 root root 2763 Oct 4 09:22 gradlew.bat
-rw-rw-rw-. 1 root root 1849 Oct 4 09:22 pom.xml
drwxrwxrwx. 3 root root 4096 Oct 4 09:22 src
drwxrwxrwx. 7 root root 4096 Oct 4 09:22 WebContent
Deploy result
Status: Downloaded newer image for bitbucket$BITBUCKET_USERNAME/bitbucket-upload-file:0.3.2
INFO: Executing the pipe...
✖ File admin.war doesn't exist.
Thanks,
Hi @JJ지우근,
I believe that the file name you mentioned, artifact_2dfe02f9-78ba-4a44-9a33-b5bb96decd64.tar.gz, is the name of the file when you download the artifact from the Artifacts tab of the Pipelines build log, is that correct?
This doesn't have anything to do with the error you are seeing in the deployment step:File admin.war doesn't exist.
I think the culprit for this error may be the parallel keyword in your yaml file: parallel steps can only use artifacts produced by previous steps, not by steps in the same parallel set. If both of these steps belong to the same parallel set, then the 2nd one won't be able to use the artifacts generated by the first one.
Are these two steps the only ones in your yaml file? If so, can you remove the parallel keyword from the yaml file and run another build? The admin.war file should then be available for the second step, and the file should be uploaded in the Downloads section of the repo with the same name.
Kind regards,
Theodora
Thank you for the update and you are very welcome, I'm glad to have helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.