Skip to content

Commit

Permalink
build: enable npm for php/python builds (#1133)
Browse files Browse the repository at this point in the history
* build: enable npm for php/python builds

* update comment
  • Loading branch information
dwsupplee authored Jun 22, 2021
1 parent 2514a99 commit 9763f20
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .kokoro-autosynth/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"
# Kokoro exposes this as a file, but the scripts expect just a plain variable.
export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key)

# Install npm to facilitate installation of a code formatter for PHP: https://github.com/prettier/plugin-php
# Use `nvm` to bootstrap the installation of node.js and npm.
# To learn more: https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

# Activate `nvm` so the binary is available on the path
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Use the latest LTS version of nodejs. This can change over time, but
# should prevent the need to modify this file every year.
nvm install --lts

# Verify expected versions of nodejs and npm
node --version
npm --version

# Setup git credentials
echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials
git config --global credential.helper 'store --file ~/.git-credentials'
Expand Down

0 comments on commit 9763f20

Please sign in to comment.