Skip to content

Instantly share code, notes, and snippets.

@m1entus
Last active December 14, 2021 13:36
Show Gist options
  • Select an option

  • Save m1entus/dda3186fb4977ba83ebc9897680b72e3 to your computer and use it in GitHub Desktop.

Select an option

Save m1entus/dda3186fb4977ba83ebc9897680b72e3 to your computer and use it in GitHub Desktop.

Revisions

  1. m1entus revised this gist Dec 14, 2021. 1 changed file with 18 additions and 18 deletions.
    36 changes: 18 additions & 18 deletions medium_save_derived_data.yml
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,20 @@
    save_derived_data:
    steps:
    # This will create file with current commit SHA from develop branch
    # We need to store it to file just to be able to use it as a key inside `save_cache` command.
    # Because it is not possible to directly embed it inside {{ }}
    - run:
    name: Add current develop commit SHA environment variable
    command: |
    echo $(git show --format="%H" --no-patch) > /tmp/current_dev_commit_sha
    save_derived_data:
    steps:
    # This will create file with current commit SHA from develop branch
    # We need to store it to file just to be able to use it as a key inside `save_cache` command.
    # Because it is not possible to directly embed it inside {{ }}
    - run:
    name: Add current develop commit SHA environment variable
    command: |
    echo $(git show --format="%H" --no-patch) > /tmp/current_dev_commit_sha
    # tar up the derived data in the appropriate format that we used for untarring above.
    - run:
    name: Tar up derived data
    command: mkdir -p dd-tar-cache && tar cfPp dd-tar-cache/dd.tar --format posix ~/Library/Developer/Xcode/DerivedData/
    # tar up the derived data in the appropriate format that we used for untarring above.
    - run:
    name: Tar up derived data
    command: mkdir -p dd-tar-cache && tar cfPp dd-tar-cache/dd.tar --format posix ~/Library/Developer/Xcode/DerivedData/

    - save_cache:
    name: "Save cache [Derived Data]"
    key: v1-derived-data-cache-{{ checksum "/tmp/current_dev_commit_sha" }}
    paths:
    - dd-tar-cache
    - save_cache:
    name: "Save cache [Derived Data]"
    key: v1-derived-data-cache-{{ checksum "/tmp/current_dev_commit_sha" }}
    paths:
    - dd-tar-cache
  2. m1entus revised this gist Dec 14, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion medium_save_derived_data.yml
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    - run:
    name: Add current develop commit SHA environment variable
    command: |
    echo $(bash Scripts/current_commit_SHA.sh) > /tmp/current_dev_commit_sha
    echo $(git show --format="%H" --no-patch) > /tmp/current_dev_commit_sha
    # tar up the derived data in the appropriate format that we used for untarring above.
    - run:
  3. m1entus created this gist Dec 14, 2021.
    20 changes: 20 additions & 0 deletions medium_save_derived_data.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    save_derived_data:
    steps:
    # This will create file with current commit SHA from develop branch
    # We need to store it to file just to be able to use it as a key inside `save_cache` command.
    # Because it is not possible to directly embed it inside {{ }}
    - run:
    name: Add current develop commit SHA environment variable
    command: |
    echo $(bash Scripts/current_commit_SHA.sh) > /tmp/current_dev_commit_sha
    # tar up the derived data in the appropriate format that we used for untarring above.
    - run:
    name: Tar up derived data
    command: mkdir -p dd-tar-cache && tar cfPp dd-tar-cache/dd.tar --format posix ~/Library/Developer/Xcode/DerivedData/

    - save_cache:
    name: "Save cache [Derived Data]"
    key: v1-derived-data-cache-{{ checksum "/tmp/current_dev_commit_sha" }}
    paths:
    - dd-tar-cache