Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
chore: fix capitalization and spelling of languages and package manag…
Browse files Browse the repository at this point in the history
…ers (#891)

yarn -> Yarn
NPM -> npm
PNPM -> pnpm
modules -> packages
ruby -> Ruby

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
kaelig and kodiakhq[bot] authored Jan 9, 2023
1 parent 51d891f commit 40f7d5c
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ For further install instructions please visit the [official installation guide](

### Testing dynamic Versions

To test Golang or Node versions, which are dynamically downloaded via a script on startup we have a set of automated tests in [./tests](./tests). These are [bats](https://github.com/bats-core/bats-core) tests that we use to make assertions not only on the correct functioning of our bash/shell scripts, but also of the software provided by our Docker image. For an overview on how [bats works see here](https://bats-core.readthedocs.io/en/stable/).
To test Golang or Node.js versions, which are dynamically downloaded via a script on startup we have a set of automated tests in [./tests](./tests). These are [bats](https://github.com/bats-core/bats-core) tests that we use to make assertions not only on the correct functioning of our bash/shell scripts, but also of the software provided by our Docker image. For an overview on how [bats works see here](https://bats-core.readthedocs.io/en/stable/).

To run those tests you can run the following command which will load the tests in the image and executes them.

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ USER root
#
################################################################################

# this installer is needed for older node versions where no corepack is available
# this installer is needed for older Node.js versions where Corepack isn't available
RUN curl -o- -L https://yarnpkg.com/install.sh > /usr/local/bin/yarn-installer.sh

ENV NVM_VERSION=0.39.1

# Install node.js, yarn, grunt, bower
# Install Node.js, Yarn, Grunt, Bower
USER buildbot
RUN git clone https://github.com/creationix/nvm.git ~/.nvm && \
cd ~/.nvm && \
Expand All @@ -299,7 +299,7 @@ ENV PNPM_VERSION=7.13.4

ENV NETLIFY_NODE_VERSION="16"

# We install an "internal" yarn v1 executable to be used only for workspace detection. We can remove it once we have a better
# We install an "internal" Yarn v1 executable to be used only for workspace detection. We can remove it once we have a better
# strategy in place
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install --no-progress $NETLIFY_NODE_VERSION && \
Expand Down
16 changes: 8 additions & 8 deletions focal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ commandTests:
- "-c"
- |
source /opt/buildhome/.nvm/nvm.sh
echo "NVM: $(nvm --version)"
echo "Node: $(node --version)"
echo "nvm: $(nvm --version)"
echo "Node.js: $(node --version)"
echo "Yarn: $(yarn --version)"
echo "NPM: $(npm --version)"
echo "PNPM: $(pnpm --version)"
echo "npm: $(npm --version)"
echo "pnpm: $(pnpm --version)"
expectedOutput:
- "Node: v16.*.*"
- "NVM: 0.39.1"
- "Node.js: v16.*.*"
- "nvm: 0.39.1"
- "Yarn: 1.22.*"
- "NPM: 8.*.*"
- "PNPM: 7.*.*"
- "npm: 8.*.*"
- "pnpm: 7.*.*"

- name: hugo
command: "hugo"
Expand Down
6 changes: 3 additions & 3 deletions included_software.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ The specific patch versions included will depend on when the image was last buil
* Yarn - `YARN_VERSION`
* 1.22.19 (default)
* Any version available via their installer.
* NPM - `NPM_VERSION`
* npm - `NPM_VERSION`
* Version corresponding with Node.js version. (default)
* Any version available via NPM.
* bower
* Any version available via npm.
* Bower
* Python
* pip
* Version corresponding with Python version. (default)
Expand Down
92 changes: 46 additions & 46 deletions run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ run_yarn() {
fi

if [ $(which yarn) ] && [ "$(yarn --version)" != "$yarn_version" ]; then
echo "Found yarn version ($(yarn --version)) that doesn't match expected ($yarn_version)"
echo "Found Yarn version ($(yarn --version)) that doesn't match expected ($yarn_version)"
rm -rf $NETLIFY_CACHE_DIR/yarn $HOME/.yarn
npm uninstall yarn -g
fi

if ! [ $(which yarn) ]; then
echo "Installing yarn at version $yarn_version"
echo "Installing Yarn version $yarn_version"
rm -rf $HOME/.yarn
bash /usr/local/bin/yarn-installer.sh --version $yarn_version
mv $HOME/.yarn $NETLIFY_CACHE_DIR/yarn
Expand All @@ -178,14 +178,14 @@ run_yarn() {
else
# if corepack is installed use it for changing the yarn version
if [ "$(yarn --version)" != "$yarn_version" ]; then
echo "Installing yarn at version $yarn_version"
echo "Installing Yarn version $yarn_version"
corepack prepare yarn@$yarn_version --activate
fi
fi

restore_node_modules "yarn"

echo "Installing NPM modules using Yarn version $(yarn --version)"
echo "Installing npm packages using Yarn version $(yarn --version)"

# Remove the cache-folder flag if the user set any.
# We want to control where to put the cache
Expand All @@ -197,7 +197,7 @@ run_yarn() {

if yarn install --cache-folder "$HOME/.yarn_cache" ${yarn_local:+$yarn_local}
then
echo "NPM modules installed using Yarn"
echo "npm packages installed using Yarn"
else
echo "Error during Yarn install"
exit 1
Expand All @@ -212,9 +212,9 @@ run_pnpm() {
restore_home_cache ".pnpm-store" "pnpm cache"

if ! [ $(which corepack) ] || has_feature_flag "$featureFlags" "build-image-disable-node-corepack"; then
echo "Error while installing PNPM $pnpm_version"
echo "We cannot install the expected version of PNPM ($pnpm_version) as your required Node.js version $NODE_VERSION does not allow that"
echo "Please ensure that you use at least Node Version 14.19.0 or greater than 16.9.0"
echo "Error while installing pnpm $pnpm_version"
echo "We cannot install the expected version of pnpm ($pnpm_version) as your required Node.js version $NODE_VERSION does not allow that"
echo "Please ensure that you use at least Node.js version 14.19.0 or greater than 16.9.0"

exit 1
fi
Expand All @@ -228,12 +228,12 @@ run_pnpm() {

restore_node_modules "pnpm"

echo "Installing NPM modules using PNPM version $(pnpm --version)"
echo "Installing npm packages using pnpm version $(pnpm --version)"
if pnpm install ${PNPM_FLAGS:+$PNPM_FLAGS}
then
echo "NPM modules installed using PNPM"
echo "npm packages installed using pnpm"
else
echo "Error during PNPM install"
echo "Error during pnpm install"
exit 1
fi

Expand All @@ -249,12 +249,12 @@ run_npm() {
if [ "$(npm --version)" != "$NPM_VERSION" ]
then
echo "Found npm version ($(npm --version)) that doesn't match expected ($NPM_VERSION)"
echo "Installing npm at version $NPM_VERSION"
echo "Installing npm version $NPM_VERSION"
if npm install -g npm@$NPM_VERSION
then
echo "NPM installed successfully"
echo "npm installed successfully"
else
echo "Error installing NPM"
echo "Error installing npm"
exit 1
fi
fi
Expand All @@ -263,24 +263,24 @@ run_npm() {
if has_feature_flag "$featureFlags" "buildbot_bypass_module_cache"
then
echo "Bypassing sha validation. Running pre & post install scripts"
echo "Installing NPM modules using NPM version $(npm --version)"
echo "Installing npm packages using npm version $(npm --version)"
if npm install ${NPM_FLAGS:+"$NPM_FLAGS"}
then
echo "NPM modules installed"
echo "npm packages installed"
else
echo "Error during NPM install"
echo "Error during npm install"
exit 1
fi
else
if install_deps package.json $NODE_VERSION $NETLIFY_CACHE_DIR/package-sha
then
echo "Installing NPM modules using NPM version $(npm --version)"
echo "Installing npm packages using npm version $(npm --version)"

if npm install ${NPM_FLAGS:+$NPM_FLAGS}
then
echo "NPM modules installed"
echo "npm packages installed"
else
echo "Error during NPM install"
echo "Error during npm install"
exit 1
fi

Expand All @@ -302,11 +302,11 @@ install_node() {
# restore only non-existing cached versions
if [[ $(ls $NETLIFY_CACHE_DIR/node_version/) ]]
then
echo "Started restoring cached node version"
echo "Started restoring cached Node.js version"
rm -rf "$NVM_DIR/versions/node"
mkdir "$NVM_DIR/versions/node"
cp -p -r $NETLIFY_CACHE_DIR/node_version/* $NVM_DIR/versions/node/
echo "Finished restoring cached node version"
echo "Finished restoring cached Node.js version"
fi

if [ -f ".nvmrc" ]
Expand All @@ -329,13 +329,13 @@ install_node() {
env
fi
else
echo "Failed to install node version '$NODE_VERSION'"
echo "Failed to install Node.js version '$NODE_VERSION'"
exit 1
fi

# if Node.js Corepack is available enable it
if [ $(which corepack) ] && ! has_feature_flag "$featureFlags" "build-image-disable-node-corepack"; then
echo "Enabling node corepack"
echo "Enabling Node.js Corepack"
corepack enable
fi

Expand All @@ -362,7 +362,7 @@ check_python_version() {
read_node_version_file() {
local nodeVersionFile="$1"
NODE_VERSION="$(cat "$nodeVersionFile")"
echo "Attempting node version '$NODE_VERSION' from $nodeVersionFile"
echo "Attempting Node.js version '$NODE_VERSION' from $nodeVersionFile"
}

install_dependencies() {
Expand All @@ -389,7 +389,7 @@ install_dependencies() {
check_python_version "the PYTHON_VERSION environment variable"
fi

# Node version
# Node.js version
install_node "$defaultNodeVersion" "$featureFlags"

# Automatically installed Build plugins
Expand All @@ -411,9 +411,9 @@ install_dependencies() {
if [ -f .ruby-version ]
then
druby=$(cat .ruby-version)
echo "Attempting ruby version ${druby}, read from .ruby-version file"
echo "Attempting Ruby version ${druby}, read from .ruby-version file"
else
echo "Attempting ruby version ${druby}, read from environment"
echo "Attempting Ruby version ${druby}, read from environment"
fi

rvm use ${druby} > /dev/null 2>&1
Expand All @@ -423,29 +423,29 @@ install_dependencies() {
local fulldruby="ruby-${druby}"
if [ -d $NETLIFY_CACHE_DIR/ruby_version/${fulldruby} ] && [ -d $NETLIFY_CACHE_DIR/ruby_version_gems/${fulldruby} ]
then
echo "Started restoring cached ruby version"
echo "Started restoring cached Ruby version"
rm -rf $RVM_DIR/rubies/${fulldruby}
cp -p -r $NETLIFY_CACHE_DIR/ruby_version/${fulldruby} $RVM_DIR/rubies/

rm -rf $RVM_DIR/gems/${fulldruby}
cp -p -r $NETLIFY_CACHE_DIR/ruby_version_gems/${fulldruby} $RVM_DIR/gems/
echo "Finished restoring cached ruby version"
echo "Finished restoring cached Ruby version"
fi

rvm --create use ${druby} > /dev/null 2>&1
if [ $? -eq 0 ]
then
local crv=$(rvm current)
export RUBY_VERSION=${crv#ruby-}
echo "Using ruby version ${RUBY_VERSION}"
echo "Using Ruby version ${RUBY_VERSION}"
else
if rvm_install_on_use_flag=1 rvm --quiet-curl --create use ${druby}
then
local crv=$(rvm current)
export RUBY_VERSION=${crv#ruby-}
echo "Using ruby version ${RUBY_VERSION}"
echo "Using Ruby version ${RUBY_VERSION}"
else
echo "Failed to install ruby version '${druby}'"
echo "Failed to install Ruby version '${druby}'"
exit 1
fi
fi
Expand All @@ -459,7 +459,7 @@ install_dependencies() {

if ! [ -z "$bundler_version" ]
then
echo "Using bundler version $bundler_version from Gemfile.lock"
echo "Using Bundler version $bundler_version from Gemfile.lock"
fi

if ! gem list -i "^bundler$" -v "$bundler_version" > /dev/null 2>&1
Expand All @@ -473,7 +473,7 @@ install_dependencies() {
fi
if ! gem install "$bundler_gem_name" --no-document
then
echo "Error installing bundler"
echo "Error installing Bundler"
exit 1
fi
fi
Expand Down Expand Up @@ -595,11 +595,11 @@ install_dependencies() {
# SPM dependencies
if [ -f Package.swift ]
then
echo "Building Swift Package"
echo "Building Swift package"
restore_cwd_cache ".build" "swift build"
if swift build
then
echo "Swift package Built"
echo "Swift package built"
else
echo "Error building Swift package"
exit 1
Expand All @@ -615,7 +615,7 @@ install_dependencies() {
brew bundle
fi

# NPM Dependencies
# npm Dependencies
: ${YARN_VERSION="$defaultYarnVersion"}
: ${PNPM_VERSION="$defaultPnpmVersion"}
: ${CYPRESS_CACHE_FOLDER="./node_modules/.cache/CypressBinary"}
Expand Down Expand Up @@ -659,21 +659,21 @@ install_dependencies() {
then
if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ])
then
echo "Installing bower with Yarn"
echo "Installing Bower with Yarn"
yarn add bower
else
echo "Installing bower with NPM"
echo "Installing Bower with npm"
npm install bower
fi
export PATH=$(npm bin):$PATH
fi
restore_cwd_cache bower_components "bower components"
echo "Installing bower components"
echo "Installing Bower packages"
if bower install --config.interactive=false
then
echo "Bower components installed"
echo "Bower packages installed"
else
echo "Error installing bower components"
echo "Error installing Bower packages"
exit 1
fi
fi
Expand Down Expand Up @@ -834,23 +834,23 @@ cache_artifacts() {
chmod -R +rw $HOME/.gimme_cache
cache_home_directory ".gimme_cache" "go dependencies"

# cache the version of node installed
# cache the version of Node.js installed
if ! [ -d $NETLIFY_CACHE_DIR/node_version/$NODE_VERSION ]
then
rm -rf $NETLIFY_CACHE_DIR/node_version
mkdir $NETLIFY_CACHE_DIR/node_version
mv $NVM_DIR/versions/node/* $NETLIFY_CACHE_DIR/node_version/
fi

# cache the version of ruby installed
# cache the version of Ruby installed
if [[ "$CUSTOM_RUBY" -ne "0" ]]
then
if ! [ -d $NETLIFY_CACHE_DIR/ruby_version/ruby-$RUBY_VERSION ] || ! [ -d $NETLIFY_CACHE_DIR/ruby_version_gems/ruby-$RUBY_VERSION ]
then
rm -rf $NETLIFY_CACHE_DIR/ruby_version
mkdir $NETLIFY_CACHE_DIR/ruby_version
mv $RVM_DIR/rubies/ruby-$RUBY_VERSION $NETLIFY_CACHE_DIR/ruby_version/
echo "Cached ruby version $RUBY_VERSION"
echo "Cached Ruby version $RUBY_VERSION"

rm -rf $NETLIFY_CACHE_DIR/ruby_version_gems
mkdir $NETLIFY_CACHE_DIR/ruby_version_gems
Expand Down
2 changes: 1 addition & 1 deletion tests/node/bypass_cache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ teardown() {

@test 'bypass_cache run pre and post install scripts' {
run run_npm "buildbot_bypass_module_cache"
assert_output --partial "NPM modules installed"
assert_output --partial "npm packages installed"
refute_output --partial "Creating package sha"
}

Expand Down
Loading

0 comments on commit 40f7d5c

Please sign in to comment.