Skip to content

Commit

Permalink
Merge pull request #564 from NREL/remove-hardcoded-install
Browse files Browse the repository at this point in the history
Remove hardcoded openstudio version and sha
  • Loading branch information
nllong authored May 12, 2020
2 parents 1ef3bb9 + 0f3395f commit 82e25f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
11 changes: 7 additions & 4 deletions ci/appveyor/setup.cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set PATH=C:\Program Files\Git\mingw64\bin;C:\projects\openstudio\bin;%PATH%
set GEM_HOME=C:\projects\openstudio-server\gems
set GEM_PATH=C:\projects\openstudio-server\gems;C:\projects\openstudio-server\gems\gems\bundler\gems
echo Downloading and Installing OpenStudio (develop branch, %OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%.%OPENSTUDIO_VERSION_SHA%)
REM install develop build
curl -SLO --insecure https://openstudio-builds.s3.amazonaws.com/3.0.0/OpenStudio-3.0.0%%2B1c9617fa4e-Windows.exe
OpenStudio-3.0.0%%2B1c9617fa4e-Windows.exe --script ci/appveyor/install-windows.qs
echo Downloading and Installing OpenStudio (develop branch, %OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%+%OPENSTUDIO_VERSION_SHA%)
REM install develop build
set OS_INSTALL_NAME=OpenStudio-%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%%%2B%OPENSTUDIO_VERSION_SHA%-Windows.exe
echo Install name is %OS_INSTALL_NAME%
curl -SLO --insecure https://openstudio-builds.s3.amazonaws.com/%OPENSTUDIO_VERSION%/%OS_INSTALL_NAME%
dir .
%OS_INSTALL_NAME% --script ci/appveyor/install-windows.qs
move C:\openstudio C:\projects\openstudio
dir C:\projects\openstudio
dir C:\projects\openstudio\Ruby
Expand Down
8 changes: 2 additions & 6 deletions ci/travis/install_openstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ OPENSTUDIO_VERSION_EXT=$3

if [ ! -z ${OPENSTUDIO_VERSION} ] && [ ! -z ${OPENSTUDIO_SHA} ]; then
# OPENSTUDIO_VERSION_EXT may be empty
#OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-$OPENSTUDIO_VERSION$OPENSTUDIO_VERSION_EXT.$OPENSTUDIO_SHA-Linux.deb
# Dev3 hardcoding:
OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-3.0.0%2B1c9617fa4e-Linux.deb

OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}%2B${OPENSTUDIO_SHA}-Linux.deb
echo "Installing OpenStudio ${OPENSTUDIO_DOWNLOAD_FILENAME}"

OPENSTUDIO_DOWNLOAD_BASE_URL=https://openstudio-builds.s3.amazonaws.com/3.0.0/
OPENSTUDIO_DOWNLOAD_BASE_URL=https://openstudio-builds.s3.amazonaws.com/3${OPENSTUDIO_VERSION}/
OPENSTUDIO_DOWNLOAD_URL=$OPENSTUDIO_DOWNLOAD_BASE_URL/$OPENSTUDIO_DOWNLOAD_FILENAME

# copying this from the docker-openstudio dockerfile
Expand Down
12 changes: 7 additions & 5 deletions ci/travis/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ else
cp mongodb-osx-x86_64-3.4.18/bin/* /usr/local/bin/

# Install openstudio -- Use the install script that is in this repo now, the one on OpenStudio/develop has changed
curl -SLO --insecure https://openstudio-builds.s3.amazonaws.com/3.0.0/OpenStudio-3.0.0%2B1c9617fa4e-Darwin.dmg
# OSX downloads with %2B. These are unsafe chars in url strings
hdiutil attach OpenStudio-3.0.0%2B1c9617fa4e-Darwin.dmg
export OS_NAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}%2B${OPENSTUDIO_VERSION_SHA}-Darwin
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin
curl -SLO --insecure https://openstudio-builds.s3.amazonaws.com/${OPENSTUDIO_VERSION}/${OS_NAME}.dmg
# OSX downloads with %2B but installs with + sign. These are the encoded chars in url strings.
hdiutil attach ${OS_NAME}.dmg
sed -i -e "s|REPLACEME|$HOME/openstudio|" ci/travis/install-mac.qs
rm -rf $HOME/openstudio
# Will install into $HOME/openstudio and RUBYLIB will be $HOME/openstudio/Ruby
sudo /Volumes/OpenStudio-3.0.0+1c9617fa4e-Darwin/OpenStudio-3.0.0+1c9617fa4e-Darwin.app/Contents/MacOS/OpenStudio-3.0.0+1c9617fa4e-Darwin --script ci/travis/install-mac.qs
hdiutil detach /Volumes/OpenStudio-3.0.0+1c9617fa4e -force
sudo /Volumes/${OS_NAME_WITH_PLUS}/${OS_NAME_WITH_PLUS}.app/Contents/MacOS/${OS_NAME_WITH_PLUS} --script ci/travis/install-mac.qs
hdiutil detach /Volumes/${OS_NAME_WITH_PLUS} -force

export PATH="$TRAVIS_BUILD_DIR/gems/bin:/usr/local/opt/ruby@2.5/bin:$HOME/openstudio/bin:$PATH"
export RUBYLIB="$HOME/openstudio/Ruby"
Expand Down

0 comments on commit 82e25f7

Please sign in to comment.