Skip to content

Commit e01b11d

Browse files
committed
ci(travis): fix nvm problem
nvm command must be placed to “.travis.yml”, not to external file — https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728278371#L182
1 parent 6c977ff commit e01b11d

2 files changed

Lines changed: 38 additions & 36 deletions

File tree

.travis.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System
2020
# https://blog.travis-ci.com/2017-08-31-trusty-as-default-status
2121

22-
# [DEPRECATED] “sudo” key:
22+
# [DECLINED] “sudo” key:
2323
# https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
2424
# [NOTE] Needs for correct APT addon usage:
2525
# https://docs.travis-ci.com/user/reference/overview/
@@ -46,11 +46,13 @@ os: linux
4646
# https://docs.travis-ci.com/user/reference/linux#overview
4747
dist: focal
4848

49+
4950
# [INFO] Don't download all repository history, that save a time:
5051
# https://docs.travis-ci.com/user/customizing-the-build/#git-clone-depth
5152
git:
5253
depth: 1
5354

55+
5456
# Environment:
5557
# [INFO] Using secure variables for Travis CI:
5658
# https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
@@ -105,6 +107,7 @@ env:
105107
lmIISg0P2VtPLZIw4sCSJ9ts3dnOtADkYDiruXF1laoKmw4+73TpbNsvxNTYitSnWFsAOKoZqzCX3+t5v+swkb7gc7i+pXKDwuLaF6pF1lemV/
106108
3bpq7yay5d6KmMIPpDwW+rBNLhCbzxPLpGdG40xd9Gs+w6iRoRXIlChh6PuGohDAPcA/oMofXtHic3hx5ViAPDcxsoB5pjc8CM=
107109
110+
108111
# Needs “language: bash” for multilanguage projects:
109112
# https://github.com/travis-ci/travis-ci/issues/4895
110113
# https://github.com/travis-ci/docs-travis-ci-com/issues/910
@@ -115,6 +118,7 @@ env:
115118
# https://github.com/travis-ci/travis-ci/issues/9180
116119
language: python
117120

121+
118122
# [DEPRECATED]
119123
# # [NOTE] Python 3.7.3 or higher required, Python 3.7.2 have a bug:
120124
# # ModuleNotFoundError: No module named '_contextvars'
@@ -123,18 +127,6 @@ language: python
123127
# https://travis-ci.community/t/add-python-3-8-support/5463/4
124128
python: 3.8
125129

126-
# [DEPRECATED] Doesn't work on Travis CI, needs “matrix.include”:
127-
# https://github.com/travis-ci/travis-ci/issues/9634
128-
# # Multiple scripts
129-
# # https://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-your-builds-across-virtual-machines
130-
# env:
131-
# # “grunt default” = “grunt”;
132-
# # Travis CI support blank value.
133-
# - GRUNT_COMMAND=
134-
# # If http-server run in background, “pipenv run pelican content -s publishconf.py”
135-
# # command can't move “theme” folder.
136-
# # I can't find method for http-server stop
137-
# - GRUNT_COMMAND=default && grunt http-server screenshots && grunt publish
138130

139131
# [INFO] “matrix.include”:
140132
# https://docs.travis-ci.com/user/customizing-the-build#build-matrix
@@ -157,6 +149,7 @@ jobs:
157149
# https://github.com/calebzulawski/cotila/blob/master/.travis.yml
158150
- MATRIX_DEPLOY=1
159151

152+
160153
# Sections:
161154
# https://docs.travis-ci.com/user/job-lifecycle
162155
# https://stackoverflow.com/a/34384262/5951529
@@ -196,6 +189,7 @@ addons:
196189
# Cache doesn't save between “images” — new builds: new virtual machine for each build:
197190
# https://docs.travis-ci.com/user/caching/#Things-not-to-cache
198191

192+
199193
before_install:
200194
# Virtual environment inside project directory:
201195
# https://jcutrer.com/howto/dev/python/pipenv-pipfile
@@ -236,12 +230,42 @@ before_install:
236230
# https://stackoverflow.com/a/34549249/5951529
237231
- git config --global core.quotePath false
238232

233+
239234
install:
235+
# [NOTE] Node.js latest version required;
236+
# because by default it doesn’t work correctly:
237+
# https://travis-ci.org/github/Kristinita/KristinitaPelican/jobs/728121010
238+
# [LEARN][NVM] Install the latest Node.js version by NVM:
239+
# https://github.com/nvm-sh/nvm#usage
240+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728253580#L187-L188
241+
# [INFO] David Welsh reccomends NVM installation:
242+
# https://davidwalsh.name/nvm
243+
# [NOTE] “nvm install node” must be in “.travis.yml” file, not in external files;
244+
# otherwise you get error “nvm: command not found”:
245+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728278371#L182
246+
# https://travis-ci.org/github/Kristinita/KristinitaPelican/jobs/728274971#L238
247+
# https://github.com/travis-ci/travis-ci/issues/6027
248+
# https://github.com/travis-ci/travis-ci/issues/5999
249+
# [NOTE] Doesn’t work:
250+
# “node_js: node”:
251+
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions
252+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728248259#L182-L183
253+
# Node.js from apt addon:
254+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728250645#L223-L224
255+
# “.nvmrc”:
256+
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions-using-nvmrc
257+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728252349#L182-L183
258+
# “apt-get -y install node.js”:
259+
# https://stackoverflow.com/a/21119945/5951529
260+
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728252818#L219-220
261+
- nvm install node
262+
240263
# [NOTE] Parallelshell works, but no time economy, diff:
241264
# https://travis-ci.org/Kristinita/SashaPelicanTest/jobs/347254717
242265
# https://travis-ci.org/Kristinita/SashaPelicanTest/jobs/347267767
243266
- bash bash/travis-install.sh
244267

268+
245269
# [INFO] Automatically deploy site to GitHub Pages:
246270
# https://docs.travis-ci.com/user/deployment
247271
# https://docs.travis-ci.com/user/deployment/pages/

bash/travis-install.sh

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,6 @@
2525
# https://travis-ci.org/Kristinita/SashaScrutinizer/builds/363772800
2626

2727

28-
# [NOTE] Node.js latest version required;
29-
# because by default it doesn't work correctly:
30-
# https://travis-ci.org/github/Kristinita/KristinitaPelican/jobs/728121010
31-
# [LEARN][NVM] Install the latest Node.js version by NVM:
32-
# https://github.com/nvm-sh/nvm#usage
33-
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728253580#L187-L188
34-
# [INFO] David Welsh reccomends NVM installation:
35-
# https://davidwalsh.name/nvm
36-
# [NOTE] Doesn't work:
37-
# "node_js: node":
38-
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions
39-
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728248259#L182-L183
40-
# Node.js from apt addon:
41-
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728250645#L223-L224
42-
# ".nvmrc":
43-
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions-using-nvmrc
44-
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728252349#L182-L183
45-
# "apt-get -y install node.js":
46-
# https://stackoverflow.com/a/21119945/5951529
47-
# https://travis-ci.org/github/Kristinita/SashaTravisDebugging/builds/728252818#L219-220
48-
49-
5028
# [NOTE] Grunt tasks needs grunt-cli globally:
5129
# https://stackoverflow.com/a/21133609/5951529
5230

@@ -79,7 +57,7 @@
7957
# "https://packages.microsoft.com/config/ubuntu/packages-microsoft-prod.deb" and
8058
# "sudo apt-get install dotnet-sdk" will not works
8159
parallel ::: 'pip install --upgrade pip && pip install pipenv==11.10.2 && pipenv install --dev && pipenv run peru sync' \
82-
'nvm install node && npm install --global npm && npm install -g grunt-cli && npm install' \
60+
'npm install --global npm && npm install -g grunt-cli && npm install' \
8361
'git clone https://github.com/htacg/tidy-html5.git && cd tidy-html5 && cd build/cmake && cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIB:BOOL=OFF && make && sudo make install' \
8462
'gem install travis' \
8563
'wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb && sudo apt-get update && sudo apt-get install dotnet-sdk-3.1 && dotnet tool install -g localappveyor'

0 commit comments

Comments
 (0)