Skip to content

Commit

Permalink
Merge pull request #71 from nathf/master
Browse files Browse the repository at this point in the history
Add support for differing yarn versions
  • Loading branch information
gjaldon authored Mar 11, 2019
2 parents 95bd23e + 530bb07 commit 3e414fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ node_version=5.3.0
# We can set the version of NPM to use for the app here
npm_version=2.10.1

# We can set the version of Yarn to use for the app here
yarn_version=1.13.0

# We can set the path to phoenix app. E.g. apps/phoenix_app when in umbrella.
phoenix_relative_path=.

Expand Down
10 changes: 8 additions & 2 deletions lib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ install_npm() {
install_yarn() {
local dir="$1"

echo "Downloading and installing yarn..."
local download_url="https://yarnpkg.com/latest.tar.gz"
if [ ! $yarn_version ]; then
echo "Downloading and installing yarn lastest..."
local download_url="https://yarnpkg.com/latest.tar.gz"
else
echo "Downloading and installing yarn $yarn_version..."
local download_url="https://yarnpkg.com/downloads/$yarn_version/yarn-v$yarn_version.tar.gz"
fi

local code=$(curl "$download_url" -L --silent --fail --retry 5 --retry-max-time 15 -o /tmp/yarn.tar.gz --write-out "%{http_code}")
if [ "$code" != "200" ]; then
echo "Unable to download yarn: $code" && false
Expand Down
1 change: 1 addition & 0 deletions phoenix_static_buildpack.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
clean_cache=false
compile="compile"
node_version=6.9.2
yarn_version=0.27.5
phoenix_relative_path=.
remove_node=false
assets_path=.
Expand Down

0 comments on commit 3e414fc

Please sign in to comment.