ensure npm deps are installed in jenkins pipelines
This commit is contained in:
parent
b267a3017a
commit
558fc8fd62
|
@ -2,6 +2,17 @@ env.LANG="en_US.UTF-8"
|
|||
env.LANGUAGE="en_US.UTF-8"
|
||||
env.LC_ALL="en_US.UTF-8"
|
||||
|
||||
def installJSDeps() {
|
||||
def attempt = 1
|
||||
def maxAttempts = 10
|
||||
def installed = false
|
||||
while (!installed && attempt <= maxAttempts) {
|
||||
println "#${attempt} attempt to install npm deps"
|
||||
sh 'npm install'
|
||||
installed = fileExists('node_modules/web3/index.js')
|
||||
}
|
||||
}
|
||||
|
||||
node ('macos1') {
|
||||
def apkUrl = ''
|
||||
def ipaUrl = ''
|
||||
|
@ -22,7 +33,8 @@ node ('macos1') {
|
|||
|
||||
sh 'rm -rf node_modules'
|
||||
sh 'cp .env.jenkins .env'
|
||||
sh 'lein deps && npm install'
|
||||
sh 'lein deps'
|
||||
installJSDeps()
|
||||
sh '[ -f node_modules/react-native/packager/src/JSTransformer/index.js ] && sed -i "" "s/301000/1201000/g" node_modules/react-native/packager/src/JSTransformer/index.js || echo "New packager"'
|
||||
|
||||
// Fix silly RN upgrade weird env issue
|
||||
|
@ -30,7 +42,6 @@ node ('macos1') {
|
|||
|
||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||
sh 'cd ios && pod install && cd ..'
|
||||
sh 'npm install'
|
||||
}
|
||||
|
||||
stage('Tests') {
|
||||
|
|
|
@ -5,6 +5,17 @@ env.LANG="en_US.UTF-8"
|
|||
env.LANGUAGE="en_US.UTF-8"
|
||||
env.LC_ALL="en_US.UTF-8"
|
||||
|
||||
def installJSDeps() {
|
||||
def attempt = 1
|
||||
def maxAttempts = 10
|
||||
def installed = false
|
||||
while (!installed && attempt <= maxAttempts) {
|
||||
println "#${attempt} attempt to install npm deps"
|
||||
sh 'npm install'
|
||||
installed = fileExists('node_modules/web3/index.js')
|
||||
}
|
||||
}
|
||||
|
||||
node ('macos1'){
|
||||
def apkUrl = ''
|
||||
def ipaUrl = ''
|
||||
|
@ -23,7 +34,8 @@ node ('macos1'){
|
|||
sh 'git checkout develop'
|
||||
sh 'rm -rf node_modules'
|
||||
sh 'cp .env.jenkins .env'
|
||||
sh 'lein deps && npm install'
|
||||
sh 'lein deps'
|
||||
installJSDeps()
|
||||
sh '[ -f node_modules/react-native/packager/src/JSTransformer/index.js ] && sed -i "" "s/301000/1201000/g" node_modules/react-native/packager/src/JSTransformer/index.js || echo "New packager"'
|
||||
|
||||
// Fix silly RN upgrade weird env issue
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
env.LANG="en_US.UTF-8"
|
||||
env.LANGUAGE="en_US.UTF-8"
|
||||
env.LC_ALL="en_US.UTF-8"
|
||||
|
||||
def installJSDeps() {
|
||||
def attempt = 1
|
||||
def maxAttempts = 10
|
||||
def installed = false
|
||||
while (!installed && attempt <= maxAttempts) {
|
||||
println "#${attempt} attempt to install npm deps"
|
||||
sh 'npm install'
|
||||
installed = fileExists('node_modules/web3/index.js')
|
||||
}
|
||||
}
|
||||
|
||||
node ('macos1') {
|
||||
def apkUrl = ''
|
||||
def ipaUrl = ''
|
||||
|
@ -39,7 +51,8 @@ node ('macos1') {
|
|||
sh 'cat .env'
|
||||
sh 'echo "**********************************************************************"'
|
||||
|
||||
sh 'lein deps && npm install'
|
||||
sh 'lein deps'
|
||||
installJSDeps()
|
||||
// Uncomment with RN merge
|
||||
sh '[ -f node_modules/react-native/packager/src/JSTransformer/index.js ] && sed -i "" "s/301000/1201000/g" node_modules/react-native/packager/src/JSTransformer/index.js || echo "New packager"'
|
||||
// sh 'sed -i "" "s/301000/1201000/g" node_modules/react-native/packager/src/JSTransformer/index.js'
|
||||
|
|
Loading…
Reference in New Issue