Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .ci/build-platform.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
parameters:
platform: "macOS"
vmImage: "macOS-10.13"
STAGING_DIRECTORY: /Users/vsts/STAGING
STAGING_DIRECTORY_UNIX: /Users/vsts/STAGING
ESY__CACHE_INSTALL_PATH: /Users/vsts/.esy/3____________________________________________________________________/i
ESY__CACHE_SOURCE_TARBALL_PATH: /Users/vsts/.esy/source/i
STAGING_DIRECTORY: $(Build.StagingDirectory)
STAGING_DIRECTORY_UNIX: $(Build.StagingDirectory)

jobs:
- job: ${{ parameters.platform }}
Expand All @@ -15,12 +13,21 @@ jobs:
variables:
STAGING_DIRECTORY: ${{ parameters.STAGING_DIRECTORY }}
STAGING_DIRECTORY_UNIX: ${{ parameters.STAGING_DIRECTORY_UNIX }}
ESY__CACHE_INSTALL_PATH: ${{ parameters.ESY__CACHE_INSTALL_PATH }}
ESY__CACHE_SOURCE_TARBALL_PATH: ${{ parameters.ESY__CACHE_SOURCE_TARBALL_PATH }}

steps:
- bash: echo "$(System.PullRequest.TargetBranch) - $SYSTEM_PULLREQUEST_TARGETBRANCH"
displayName: "Print CI_CACHE_BRANCH_NAME variable"
# reate a variable
- bash: |
# Desired length of path with underscores
DESIRED_LEN="86"
HOME_ESY3="$HOME/.esy/3"
HOME_ESY3_LEN=${#HOME_ESY3}
NUM_UNDERS=$(echo "$(($DESIRED_LEN-$HOME_ESY3_LEN))")
UNDERS="$(seq -s_ ${NUM_UNDERS}|tr -d '[:digit:]')"
THE_ESY__CACHE_INSTALL_PATH=${HOME_ESY3}${UNDERS}/i
# This will be exposed as an env var ESY__CACHE_INSTALL_PATH, or an
# Azure var esy__cache_install_path
echo "##vso[task.setvariable variable=esy__cache_install_path]$THE_ESY__CACHE_INSTALL_PATH"
- bash: echo Publishing Build Cache From $(esy__cache_install_path)
displayName: 'Debugging ESY__CACHE_INSTALL_PATH var'
- bash: env
displayName: "Print environment"
- template: utils/use-node.yml
Expand Down
2 changes: 1 addition & 1 deletion .ci/utils/publish-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI'))
displayName: '[Cache][Publish] Create cache directory'

- bash: 'cd $(ESY__CACHE_INSTALL_PATH) && tar -czf $(STAGING_DIRECTORY_UNIX)/esy-cache.tar .'
- bash: cd $ESY__CACHE_INSTALL_PATH && tar -czf $(STAGING_DIRECTORY_UNIX)/esy-cache.tar .
workingDirectory: ''
condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI'))
displayName: '[Cache][Publish] Tar esy cache directory'
Expand Down
6 changes: 4 additions & 2 deletions .ci/utils/restore-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ steps:
echo "Build log for build that produced the cache: $LATEST_BUILD_PAGE"
echo "Build badge for build that produced the cache: $LATEST_BUILD_BADGE"
echo "Build artifact from build that produced the cache: $LATEST_ART_URL"
mkdir -p "$ESY__CACHE_INSTALL_PATH"
cd "${ESY__CACHE_INSTALL_PATH}" && tar -xf "${STAGING_DIRECTORY_UNIX}/cache-${AGENT_OS}-install/esy-cache.tar" -C .
echo "Restoring build cache into:"
echo $ESY__CACHE_INSTALL_PATH
mkdir -p $ESY__CACHE_INSTALL_PATH
cd $ESY__CACHE_INSTALL_PATH && tar -xf "${STAGING_DIRECTORY_UNIX}/cache-${AGENT_OS}-install/esy-cache.tar" -C .
fi
}
fetchArtifactURL
Expand Down