Cache images in Bitbucker Pipelines

  android, bitbucket-pipelines

Bitbucket Pipelines pull the images every time that it start a pipeline. Since I start the tests on Bitbucket Pipelines at every pull requests, caching the images and avoid the long "Pulline images …" would save me a lot of time.

This is my bitbucket-pipelines.yml file:

image: uber/android-build-environment:latest

definitions:
  services:
    docker:
      memory: 7128

pipelines:
  pull-requests:
    '**':
      - step:
          size: 2x
          name: "Run tests"
          caches:
            - gradle
          script:
            - ./accept-licenses.sh
            - ./gradlew testStageDevDebugUnitTest
      - step:
          size: 2x
          name: "Run build"
          caches:
            - gradle
          script:
            - export GRADLE_OPTS='-Dorg.gradle.parallel=false -Dorg.gradle.daemon=false'
            - ./accept-licenses.sh
            - ./gradlew assembleStageRelease 

Source: Android Questions

LEAVE A COMMENT