Why is build directory (almost always) empty building Android Project?

I can see that during the setup phase my project is checked out

Cloning into '/opt/atlassian/pipelines/agent/build'...
remote: Counting objects: 2724, done.
remote: Compressing objects: 0% (1/1725)
...
Resolving deltas: 100% (1198/1198), done.
Checking connectivity... done.

But when I 'ls -al' the directory my files don't exist.

Initially, I thought that it Never worked, but then, one time it built and everything was there...

Output at end of script

+ pwd
/opt/atlassian/pipelines/agent/build
+ ls -al
total 8
drwxr-xr-x 2 root root 4096 Oct 4 22:09 [0m[01;34m.[0m
drwxr-xr-x 3 root root 4096 Oct 4 22:09 [01;34m..[0m
+ ./gradlew assembleDebug
bash: ./gradlew: No such file or directory

Full yml

image: uber/android-build-environment:latest

pipelines:
branches:
master:
- step:
script:
- echo y | android update sdk --filter "build-tools-23.0.3" --no-ui -a # get the Android build tools
- echo y | android update sdk --filter "extra-android-m2repository" --no-ui -a # Get the Android Support Repo
- pwd
- ls -al
- ./gradlew assembleDebug

 

3 answers

I have the same problem now. It looks like sometimes the files get copied from the project and sometimes they don't.

@Galya Bogdanova, thanks for confirming this issue! 

@Galya Bogdanova

why this happens ?

Actually, here is my yml script (to build java project):-
# This is a sample build configuration for Gradle.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: qlik/gradle

pipelines:
default:
- step:
script:

- gradle clean
- gradle test
- gradle ear


and when i run build, it fails, on "gradle clean" comand., previously (almost 2 weeks before it was working perfect, same script) , but not now, I checked the first step (after we run build)
"Build setup", its log does not do any thing, previously it clones, and validate every thing, but now just following logs..

Build setup
+ umask 000+ git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/IT_Dev_Team/applicant_portal_pipline.git $BUILD_DIR && git reset --hard ae2cdfaf70caf5d68d17a3e5ac3679909871cf20 && git remote set-url origin https://x-token-auth:{access_token}@bitbucket.org/IT_Dev_Team/applicant_portal_pipline.gitCloning into '/opt/atlassian/pipelines/agent/build'...HEAD is now at ae2cdfa bitbucket-pipelines.yml edited online with Bitbucket+ chmod 777 $BUILD_DIR
"


Will you please help me out ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,368 views 9 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you