Giter Site home page Giter Site logo

pixiteapps / android-cloud-build Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 3.0 64 KB

Utilities to build Android apps using Google Cloud Build https://cloud.google.com/cloud-build/

License: Apache License 2.0

Dockerfile 3.44% JavaScript 40.56% Shell 56.00%

android-cloud-build's People

Contributors

dependabot[bot] avatar neilghosh avatar rharter avatar sghosh-sf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-cloud-build's Issues

`restore_cache` is unzipping the archive into directory with the name of `${key}`

Given KEY=myCache

Expected Behavior:

${BUCKET}/myCache.tgz would be extracted into ${SRC_DIR} without the myCache/ archive root directory.

Actual Behavior:

Unzipping the archive results in /workspace/myCache/.

I'm not sure why it's unpacked in /workspace rather than the root / because of the -C flag in the command here...but I'm not very familiar with tar ๐Ÿคทโ€โ™‚

tar xpzf "$CACHE_FILE" -C /

Question:

The cache is saved and subsequently downloaded successfully. How can I restore it into (in my case) GRADLE_USER_HOME=/workspace/.gradle?

PS: This is slick ๐Ÿ‘

Additional Information:

cloudbuild.yaml

steps:
  - name: 'gcr.io/$PROJECT_ID/restore_cache'
    id: restore_cache
    args:
      - '--bucket=gs://${PROJECT_ID}_build_cache'
      - '--key=gradle'
  - name: 'alpine:latest'
    entrypoint: 'sh'
    args:
      - '-c'
      - |
        echo Listing root / ...
        ls -l /
        echo Listing workspace/ ...
        ls -l /workspace
        echo Listing workspace/gradle/ ...
        ls -l /workspace/gradle

  - name: 'java:8'
    id: build
    entrypoint: "bash"
    args:
      - '-c'
      - './gradlew build'
    env:
      - 'GRADLE_USER_HOME=/workspace/.gradle'

  - name: 'gcr.io/$PROJECT_ID/save_cache'
    args:
      - '--bucket=gs://${PROJECT_ID}_build_cache'
      - '--key=gradle'
      - '--path=.gradle/wrapper'
      - '--path=.gradle/caches'

build log:

tep #0 - "restore_cache": Downloading cache file: gs://${PROJECT_ID}_build_cache/gradle.tgz...
Step #0 - "restore_cache": Restoring cache from file ./gradle.tgz...
Finished Step #0 - "restore_cache"

Step #1: Listing root / ...
Step #1: total 64
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 bin
Step #1: drwxr-xr-x 4 root root 4096 May 19 01:27 builder
Step #1: drwxr-xr-x 12 root root 3460 May 19 01:27 dev
Step #1: drwxr-xr-x 1 root root 4096 May 19 01:27 etc
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 home
Step #1: drwxr-xr-x 5 root root 4096 May 9 20:49 lib
Step #1: drwxr-xr-x 5 root root 4096 May 9 20:49 media
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 mnt
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 opt
Step #1: dr-xr-xr-x 115 root root 0 May 19 01:27 proc
Step #1: drwx------ 1 root root 4096 May 19 01:27 root
Step #1: drwxr-xr-x 1 root root 4096 May 19 01:27 run
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 sbin
Step #1: drwxr-xr-x 2 root root 4096 May 9 20:49 srv
Step #1: dr-xr-xr-x 13 root root 0 May 19 01:27 sys
Step #1: drwxrwxrwt 2 root root 4096 May 9 20:49 tmp
Step #1: drwxr-xr-x 7 root root 4096 May 9 20:49 usr
Step #1: drwxr-xr-x 11 root root 4096 May 9 20:49 var
Step #1: drwxr-xr-x 6 root root 4096 May 19 01:27 workspace

Step #1: Listing workspace/ ...
Step #1: total 301792

...

Step #1: -rw-rw-r-- 1 root root 3982 May 19 01:26 build.gradle
Step #1: -rw-rw-r-- 1 root root 3162 May 19 01:26 cloudbuild.yaml
Step #1: drwxrwxr-x 3 root root 4096 May 19 01:26 gradle
Step #1: -rw-rw-r-- 1 root root 49 May 19 01:26 gradle.properties
Step #1: -rw-r--r-- 1 root root 308966881 May 19 01:27 gradle.tgz
Step #1: -rwxrwxr-x 1 root root 5296 May 19 01:26 gradlew
Step #1: -rw-rw-r-- 1 root root 101 May 19 01:26 settings.gradle

Step #1: Listing workspace/gradle/ ...
Step #1: total 4
Step #1: drwxrwxr-x 2 root root 4096 May 19 01:26 wrapper
Finished Step #1

...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.