Skip to content
Draft
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# orb.yml is "packed" from source, and not published directly from the repository.
orb.yml
.DS_Store
.DS_Store

# cloned cache
rhino-setup/
13 changes: 13 additions & 0 deletions src/commands/setup_rhino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ steps:
name: Setup wget
command: pip install wget

# https://support.circleci.com/hc/en-us/articles/115015426888-Clear-project-dependency-cache
- restore_cache:
name: Restore Rhino Install Cache
key: rhino-<<parameters.version>>-<<parameters.fullversion>>-{{ .Environment.CACHE_VERSION }}
paths:
- "./rhino-setup/"

- run:
name: Download Rhino
environment:
Expand All @@ -30,6 +37,12 @@ steps:
PARAM_CULTURE: <<parameters.culture>>
command: <<include(scripts/download.ps1)>>

- save_cache:
name: Cache Nuget Packages
key: rhino-<<parameters.version>>-<<parameters.fullversion>>-{{ .Environment.CACHE_VERSION }}
paths:
- "./rhino-setup/"

- run:
name: Setup Rhino
command: <<include(scripts/install.ps1)>>
4 changes: 4 additions & 0 deletions src/scripts/cache_check.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$no_rhino = (Get-ChildItem *.exe).Length -eq 0
$exit_code = if ($no_rhino) { 1 } else { 0 }
Write-Host $exit_code
exit $exit_code
21 changes: 17 additions & 4 deletions src/scripts/download.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
#!powershell.exe -ExecutionPolicy Bypass

Write-Host "This is powershell!"
Write-Host "VERS: $ENV:PARAM_VERSION"
Write-Host "FULL: $ENV:PARAM_FULLVERSION"
Write-Host "CULT: $ENV:PARAM_CULTURE"

Write-Host $ENV:PARAM_VERSION
Write-Host $ENV:PARAM_FULLVERSION
Write-Host $ENV:PARAM_CULTURE
$base_dir = (Get-Item(Get-Item $PSScriptRoot).Parent).Parent.FullName
$version_file = "rhino_$ENV:PARAM_VERSION`_$ENV:PARAM_FULLVERSION.exe"
$version_filepath = "$base_dir\rhino-setup\py\$version_file"

try
{
if (Test-Path $version_filepath)
{
Write-Host "Cache for $version_file was found, skipping download."
exit 0
}
} catch {}

Write-Host "No Cache found, Downloading!"

## https://github.com/mcneel/compute.rhino3d/blob/7.x/script/update-rhino.ps1
python rhino-setup/py/download-rhino.py -v $ENV:PARAM_VERSION -fv $ENV:PARAM_FULLVERSION -c $ENV:PARAM_CULTURE
7 changes: 6 additions & 1 deletion src/scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ Write-Host = $token.Length
python rhino-setup/py/install-rhino.py -l CORE -tk $token

# show the install(s)
Get-ChildItem 'C:\Program Files\Rhino *\System\*.exe'
$installs = Get-ChildItem 'C:\Program Files\Rhino *\System\*.exe'
if ($installs -eq 0)
{
Write-Host "No Rhino install found!"
exit 1
}

# Remove any download cache
Remove-Item *.exe