How to avoid archiving a file uploaded to Artifacts?
Asked by JJ???:

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](https://api.media.atlassian.com/file/sdfsdfsdfsdfsdf)"  
My bitbucket-pipelines.yml is as follows.  

```
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
```

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/163310i8D98DD7D0E0D6B77/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/163311iAAF15E8F42CF9116/image-size/large?v=v2&px=999 "image.png")

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,


Answers:
author: Theodora Boudale
body: Hi [@JJ???](/t5/user/viewprofilepage/user-id/4542902),

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

comments: author: JJ???
body: After removing the parallel keyword, I have been able to upload the file to downloads.

Thanks for your support.


author: Theodora Boudale
body: Thank you for the update and you are very welcome, I'm glad to have helped!


Tags: artefact

bitbucket-pipelines

gradle