diff --git a/.circleci/config.yml b/.circleci/config.yml index c2d1c96b..ed5455c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,6 +19,8 @@ image_config: &image_config NODE_VERSION_NUM: # pick a version from https://nodejs.org/dist + YARN: # Yarn options: true, false + PYTHON_VERSION_NUM: # pick a version from https://python.org/ftp/python JAVA: # Java options: true, false diff --git a/scripts/generate.sh b/scripts/generate.sh index 8eebd452..f4134abc 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -26,6 +26,13 @@ if [ ! -e $NODE_VERSION_NUM ] ; then rm -r node-v$NODE_VERSION_NUM" fi +if [ $YARN = "true" ] ; then + echo "RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -" + echo "RUN echo \"deb https://dl.yarnpkg.com/debian/ stable main\" | tee /etc/apt/sources.list.d/yarn.list" + echo "RUN apt-get -y install apt-transport-https " + echo "RUN apt-get update && apt-get -y install yarn" +fi + if [ ! -e $PYTHON_VERSION_NUM ] ; then echo "RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION_NUM/Python-$PYTHON_VERSION_NUM.tgz && \ tar xzf Python-$PYTHON_VERSION_NUM.tgz && \ diff --git a/scripts/setup.sh b/scripts/setup.sh index 9ffdd455..09c8bace 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -59,6 +59,20 @@ else perl -i -pe "s/- run: node/# - run: node/" .circleci/config.yml fi +read -r -p " +Does your project need Yarn? Enter the word 'yes' to install Yarn or hit enter to skip installing Yarn +: " YARN + +case "$YARN" in + yes) + perl -i -pe 's/# Yarn options: true, false/true/' .circleci/config.yml + ;; + *) + perl -i -pe 's/# Yarn options: true, false/false/' .circleci/config.yml + perl -i -pe "s/- run: yarn/# - run: yarn/" .circleci/config.yml + ;; +esac + read -r -p " Pick a Python version from https://python.org/ftp/python, or hit enter to skip installing Python : " PYTHON_VERSION_NUM diff --git a/scripts/tests.bats b/scripts/tests.bats index c1ced48c..9f62bfda 100644 --- a/scripts/tests.bats +++ b/scripts/tests.bats @@ -12,6 +12,14 @@ node --version | grep $NODE_VERSION_NUM } +@test "yarn" { + if [ $YARN != "true" ] ; then + skip "yarn not installed" + fi + + yarn --version +} + @test "ruby version" { if [ -e $RUBY_VERSION_NUM ] ; then skip "ruby not installed"