Use Docker Appium endpoint in mobile job
This commit is contained in:
@@ -46,6 +46,7 @@ Jenkins job запускают Docker не через сокет хоста, а
|
|||||||
- `BRANCH=master`
|
- `BRANCH=master`
|
||||||
- `DB_URL=jdbc:postgresql://sql.otus.kartushin.su:5432/wishlist`
|
- `DB_URL=jdbc:postgresql://sql.otus.kartushin.su:5432/wishlist`
|
||||||
- `DB_USER=student`
|
- `DB_USER=student`
|
||||||
|
- `APPIUM_URL=http://docker:4723`
|
||||||
|
|
||||||
Обязательно заполнить:
|
Обязательно заполнить:
|
||||||
- `DB_PASSWORD`
|
- `DB_PASSWORD`
|
||||||
|
|||||||
@@ -35,6 +35,12 @@
|
|||||||
<defaultValue>student</defaultValue>
|
<defaultValue>student</defaultValue>
|
||||||
<trim>true</trim>
|
<trim>true</trim>
|
||||||
</hudson.model.StringParameterDefinition>
|
</hudson.model.StringParameterDefinition>
|
||||||
|
<hudson.model.StringParameterDefinition>
|
||||||
|
<name>APPIUM_URL</name>
|
||||||
|
<description>Appium server URL</description>
|
||||||
|
<defaultValue>http://docker:4723</defaultValue>
|
||||||
|
<trim>true</trim>
|
||||||
|
</hudson.model.StringParameterDefinition>
|
||||||
<hudson.model.PasswordParameterDefinition>
|
<hudson.model.PasswordParameterDefinition>
|
||||||
<name>DB_PASSWORD</name>
|
<name>DB_PASSWORD</name>
|
||||||
<description>DB password</description>
|
<description>DB password</description>
|
||||||
@@ -55,6 +61,7 @@ pipeline {
|
|||||||
string(name: 'APP_URL', defaultValue: '', description: 'APK URL (optional)')
|
string(name: 'APP_URL', defaultValue: '', description: 'APK URL (optional)')
|
||||||
string(name: 'DB_URL', defaultValue: 'jdbc:postgresql://sql.otus.kartushin.su:5432/wishlist', description: 'JDBC url')
|
string(name: 'DB_URL', defaultValue: 'jdbc:postgresql://sql.otus.kartushin.su:5432/wishlist', description: 'JDBC url')
|
||||||
string(name: 'DB_USER', defaultValue: 'student', description: 'DB user')
|
string(name: 'DB_USER', defaultValue: 'student', description: 'DB user')
|
||||||
|
string(name: 'APPIUM_URL', defaultValue: 'http://docker:4723', description: 'Appium server URL')
|
||||||
password(name: 'DB_PASSWORD', defaultValue: '', description: 'DB password')
|
password(name: 'DB_PASSWORD', defaultValue: '', description: 'DB password')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
@@ -95,9 +102,9 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
def mvn = isUnix() ? 'mvn' : 'mvn.cmd'
|
def mvn = isUnix() ? 'mvn' : 'mvn.cmd'
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "DB_URL='${params.DB_URL}' DB_USER='${params.DB_USER}' DB_PASSWORD='${params.DB_PASSWORD}' ${mvn} -Dallure.results.directory=target/allure-results test"
|
sh "DB_URL='${params.DB_URL}' DB_USER='${params.DB_USER}' DB_PASSWORD='${params.DB_PASSWORD}' ${mvn} -Dappium.url=${params.APPIUM_URL} -Dallure.results.directory=target/allure-results test"
|
||||||
} else {
|
} else {
|
||||||
bat "set DB_URL=${params.DB_URL}&& set DB_USER=${params.DB_USER}&& set DB_PASSWORD=${params.DB_PASSWORD}&& ${mvn} -Dallure.results.directory=target/allure-results test"
|
bat "set DB_URL=${params.DB_URL}&& set DB_USER=${params.DB_USER}&& set DB_PASSWORD=${params.DB_PASSWORD}&& ${mvn} -Dappium.url=${params.APPIUM_URL} -Dallure.results.directory=target/allure-results test"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user