build: improve npm build
Add go.mod to node_modules folder, that way Go compiler doesn't need to scan the node_module directories for any Go code. Change-Id: I747909416490c847d6b4bfa3438fea66660fcd53
This commit is contained in:
parent
05e165283f
commit
97e6e5a6a3
@ -35,10 +35,6 @@ pipeline {
|
||||
|
||||
// pre-check that we cannot do at a later stage reliably
|
||||
sh 'check-large-files'
|
||||
|
||||
// add a stub go.mod file to node projects to prevent go build ./... from scanning them
|
||||
sh 'mkdir -p web/satellite/node_modules web/storagenode/node_modules web/multinode/node_modules'
|
||||
sh 'touch web/satellite/node_modules/go.mod web/storagenode/node_modules/go.mod web/multinode/node_modules/go.mod'
|
||||
}
|
||||
}
|
||||
stage('Build Web') {
|
||||
|
@ -35,10 +35,6 @@ pipeline {
|
||||
|
||||
// pre-check that we cannot do at a later stage reliably
|
||||
sh 'check-large-files'
|
||||
|
||||
// add a stub go.mod file to node projects to prevent go build ./... from scanning them
|
||||
sh 'mkdir -p web/satellite/node_modules web/storagenode/node_modules web/multinode/node_modules'
|
||||
sh 'touch web/satellite/node_modules/go.mod web/storagenode/node_modules/go.mod web/multinode/node_modules/go.mod'
|
||||
}
|
||||
}
|
||||
stage('Gerrit status') {
|
||||
@ -93,7 +89,8 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Web') {
|
||||
|
||||
stage('Build and Lint Web') {
|
||||
// The build code depends on the following assets being loaded.
|
||||
parallel {
|
||||
stage('web/satellite') {
|
||||
@ -158,6 +155,8 @@ pipeline {
|
||||
sh 'npm ci --prefer-offline --no-audit'
|
||||
sh 'npm run build'
|
||||
sh script: 'npm audit', returnStatus: true
|
||||
sh 'npm run check'
|
||||
sh 'npm run lint'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,17 +191,7 @@ pipeline {
|
||||
sh './scripts/check-package-lock.sh'
|
||||
}
|
||||
}
|
||||
stage('Lint Admin UI') {
|
||||
when {
|
||||
changeset "satellite/admin/ui"
|
||||
}
|
||||
steps {
|
||||
dir("satellite/admin/ui") {
|
||||
sh 'npm run check'
|
||||
sh 'npm run lint'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Tests') {
|
||||
environment {
|
||||
STORJ_TEST_HOST = '127.0.0.20;127.0.0.21;127.0.0.22;127.0.0.23;127.0.0.24;127.0.0.25'
|
||||
|
3
satellite/admin/ui/.gitignore
vendored
3
satellite/admin/ui/.gitignore
vendored
@ -6,3 +6,6 @@ node_modules
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
|
||||
# Stub for Go to avoid scanning node_modules.
|
||||
!node_modules/go.mod
|
5
satellite/admin/ui/node_modules/go.mod
vendored
Normal file
5
satellite/admin/ui/node_modules/go.mod
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module storj.io/storj/satellite/admin/ui/node_modules
|
||||
|
||||
go 1.17
|
||||
|
||||
// Stub module to prevent Go from scanning node_modules directory.
|
3
web/multinode/.gitignore
vendored
3
web/multinode/.gitignore
vendored
@ -24,3 +24,6 @@ yarn-error.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
|
||||
# Stub for Go to avoid scanning node_modules.
|
||||
!node_modules/go.mod
|
5
web/multinode/node_modules/go.mod
vendored
Normal file
5
web/multinode/node_modules/go.mod
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module storj.io/storj/web/multinode/node_modules
|
||||
|
||||
go 1.17
|
||||
|
||||
// Stub module to prevent Go from scanning node_modules directory.
|
3
web/satellite/.gitignore
vendored
3
web/satellite/.gitignore
vendored
@ -30,3 +30,6 @@ yarn-error.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
|
||||
# Stub for Go to avoid scanning node_modules.
|
||||
!node_modules/go.mod
|
5
web/satellite/node_modules/go.mod
vendored
Normal file
5
web/satellite/node_modules/go.mod
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module storj.io/storj/web/satellite/node_modules
|
||||
|
||||
go 1.17
|
||||
|
||||
// Stub module to prevent Go from scanning node_modules directory.
|
3
web/storagenode/.gitignore
vendored
3
web/storagenode/.gitignore
vendored
@ -24,3 +24,6 @@ yarn-error.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
|
||||
# Stub for Go to avoid scanning node_modules.
|
||||
!node_modules/go.mod
|
5
web/storagenode/node_modules/go.mod
vendored
Normal file
5
web/storagenode/node_modules/go.mod
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module storj.io/storj/web/storagenode/node_modules
|
||||
|
||||
go 1.17
|
||||
|
||||
// Stub module to prevent Go from scanning node_modules directory.
|
Loading…
Reference in New Issue
Block a user