Skip to content

Commit

Permalink
deps.sh: Cache installed tailor
Browse files Browse the repository at this point in the history
The install.sh provided by tailor installs into /usr/local,
which is not cachable and requires sudo.

Revise the install.sh to install with a PREFIX of ~/.local/,
which places everything into ~/.local/tailor/, with the
version specific components in ~/.local/tailor/tailor-1.9.x/
  • Loading branch information
jayvdb committed Dec 16, 2016
1 parent 42036f9 commit e16a04a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .ci/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,14 @@ if [ ! -e ~/pmd-bin-5.4.1/bin ]; then
fi

# Tailor (Swift) commands
curl -fsSL https://tailor.sh/install.sh | sed 's/read -r CONTINUE < \/dev\/tty/CONTINUE=y/' > install.sh
sudo bash install.sh
# Comment out the hardcoded PREFIX, so we can put it into ~/.local
if [ ! -e ~/.local/tailor/tailor-latest ]; then
curl -fsSL -o install.sh https://tailor.sh/install.sh
sed -i 's/read -r CONTINUE < \/dev\/tty/CONTINUE=y/;;s/^PREFIX.*/# PREFIX=""/;' install.sh
PREFIX=$HOME/.local bash ./install.sh
# Provide a constant path for the executable
ln -s ~/.local/tailor/tailor-* ~/.local/tailor/tailor-latest
fi

# making coala cache the dependencies downloaded upon first run
echo '' > dummy
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ cache:
- ~/pmd-bin-5.4.1
- ~/bakalint-0.4.0
- ~/dart-sdk/bin
- ~/.local/tailor/

env:
global:
- CIRCLE_NODE_INDEX=-1 # Avoid accidentially being a CircleCI worker
- USE_PPAS=true
- R_LIB_USER=~/R/Library
- LINTR_COMMENT_BOT=false
- PATH="$PATH:$TRAVIS_BUILD_DIR/node_modules/.bin:$TRAVIS_BUILD_DIR/vendor/bin:$HOME/dart-sdk/bin:$HOME/.cabal/bin:$HOME/infer-linux64-v0.7.0/infer/bin:$HOME/pmd-bin-5.4.1/bin:/$HOME/bakalint-0.4.0"
- PATH="$PATH:$TRAVIS_BUILD_DIR/node_modules/.bin:$TRAVIS_BUILD_DIR/vendor/bin:$HOME/dart-sdk/bin:$HOME/.cabal/bin:$HOME/infer-linux64-v0.7.0/infer/bin:$HOME/pmd-bin-5.4.1/bin:$HOME/bakalint-0.4.0:$HOME/.local/tailor/tailor-latest/bin"

before_install:
- nvm install 4
Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- ~/.local/share/coala-bears
- ~/bakalint-0.4.0
- ~/.julia
- ~/.local/tailor/
pre:
- sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
- echo 'export PATH=$PATH:~/coala-bears/node_modules/.bin' >> ~/.circlerc
Expand All @@ -25,6 +26,7 @@ dependencies:
- echo 'export PATH=$PATH:~/infer-linux64-v0.7.0/infer/bin' >> ~/.circlerc
- echo 'export PATH=$PATH:~/pmd-bin-5.4.1/bin' >> ~/.circlerc
- echo 'export PATH=$PATH:~/bakalint-0.4.0' >> ~/.circlerc
- echo 'export PATH=$PATH:~/.local/tailor/tailor-latest/bin' >> ~/.circlerc
- echo 'export R_LIB_USER=~/.RLibrary' >> ~/.circlerc
- sed -i '/source \/home\/ubuntu\/virtualenvs\//d' ~/.circlerc
- mkdir -p ~/.RLibrary
Expand Down

0 comments on commit e16a04a

Please sign in to comment.