remove old jenkisnfiles

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-08-30 07:59:05 -04:00
parent 19590c8e54
commit 495f513de9
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
7 changed files with 1 additions and 1367 deletions

123
ci/Jenkinsfile vendored
View File

@ -1,123 +0,0 @@
properties([
buildDiscarder(logRotator(
numToKeepStr: '3',
daysToKeepStr: '7',
))
])
env.LANG="en_US.UTF-8"
env.LANGUAGE="en_US.UTF-8"
env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1
def installJSDeps() {
def attempt = 1
def maxAttempts = 10
def installed = false
while (!installed && attempt <= maxAttempts) {
println "#${attempt} attempt to install npm deps"
sh 'scripts/prepare-for-platform.sh mobile'
sh 'npm install'
installed = fileExists('node_modules/web3/index.js')
attemp = attempt + 1
}
}
timeout(90) {
node ('fastlane') {
load "$HOME/env.groovy"
try {
stage('Git & Dependencies') {
slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL
checkout scm
try {
sh 'git rebase origin/develop'
} catch (e) {
sh 'git rebase --abort'
throw e
}
sh 'rm -rf node_modules'
sh 'cp .env.jenkins .env'
installJSDeps()
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
sh 'cd ios && pod install && cd ..'
}
stage('Code style checks') {
sh 'lein cljfmt check'
}
stage('Tests') {
sh 'lein test-cljs'
}
stage('Build') {
sh 'lein prod-build'
}
// Android
stage('Build (Android)') {
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease'
}
stage('Deploy (Android)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android upload_diawi'
}
}
// iOS
stage('Build (iOS)') {
withCredentials([
string(credentialsId: "slave-pass-${env.NODE_NAME}", variable: 'KEYCHAIN_PASSWORD'),
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')]) {
sh 'fastlane ios adhoc'
}
}
stage('Deploy (iOS)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane ios upload_diawi'
}
}
// Android for e2e
stage('Build (Android) for e2e tests') {
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
}
stage('Upload apk for e2e tests') {
if (env.CHANGE_ID != null) {
env.SAUCE_LABS_APK = env.CHANGE_ID + '.apk'
withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android saucelabs'
sh 'fastlane android upload_diawi'
}
}
}
} catch (e) {
slackSend color: 'bad', message: BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
throw e
}
}
}

1
ci/Jenkinsfile vendored Symbolic link
View File

@ -0,0 +1 @@
Jenkinsfile.combined

View File

@ -1,284 +0,0 @@
properties([
buildDiscarder(logRotator(
numToKeepStr: '2',
daysToKeepStr: '3',
artifactNumToKeepStr: '2',
artifactDaysToKeepStr: '3'
))
])
env.LANG = 'en_US.UTF-8'
env.LANGUAGE = 'en_US.UTF-8'
env.LC_ALL = 'en_US.UTF-8'
env.REALM_DISABLE_ANALYTICS=1
apkUrl = ''
ipaUrl = ''
testPassed = true
scriptOutput = ''
packageFolder = './StatusImPackage'
external_modules_dir = [
'node_modules/react-native-i18n/desktop',
'node_modules/react-native-config/desktop',
'node_modules/react-native-fs/desktop',
'node_modules/react-native-http-bridge/desktop',
'node_modules/react-native-webview-bridge/desktop',
'node_modules/react-native-keychain/desktop',
'node_modules/react-native-securerandom/desktop',
'modules/react-native-status/desktop',
'node_modules/google-breakpad',
]
external_fonts = [
'../../../../../resources/fonts/SF-Pro-Text-Regular.otf',
'../../../../../resources/fonts/SF-Pro-Text-Medium.otf',
'../../../../../resources/fonts/SF-Pro-Text-Light.otf',
]
def gitHubNotify(commentMsg) {
withCredentials([string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) {
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
println("Result of github comment curl: " + ghOutput);
}
}
def installJSDeps() {
def attempt = 1
def maxAttempts = 10
def installed = false
sh 'node -v'
sh 'npm -v'
while (!installed && attempt <= maxAttempts) {
println "#${attempt} attempt to install npm deps"
sh 'scripts/prepare-for-platform.sh desktop'
sh 'npm install'
installed = fileExists('node_modules/web3/index.js')
attemp = attempt + 1
}
}
def doGitRebase() {
try {
sh 'git rebase origin/develop'
} catch (e) {
sh 'git rebase --abort'
throw e
}
}
def cleanupBuild() {
sh 'rm -rf node_modules'
sh "rm -rf ${packageFolder}"
sh 'rm -rf desktop/modules'
sh 'rm -rf desktop/node_modules'
}
def cleanupAndDeps() {
cleanupBuild()
sh 'cp .env.jenkins .env'
sh 'lein deps'
installJSDeps()
}
def slackNotify(message, color = 'good') {
slackSend(
color: color,
channel: '#jenkins-desktop',
message: "${BRANCH_NAME}(${env.CHANGE_BRANCH}) ${message} ${env.BUILD_URL}"
)
}
def buildClojureScript() {
sh 'rm -f index.desktop.js'
sh 'lein prod-build-desktop'
sh "mkdir ${packageFolder}"
sh """
react-native bundle \\
--entry-file index.desktop.js \\
--dev false --platform desktop \\
--bundle-output ${packageFolder}/StatusIm.jsbundle \\
--assets-dest ${packageFolder}/assets
"""
}
timeout(90) {
node() {
gitHubNotify("Desktop Jenkins build job started at ${env.BUILD_URL}")
}
try {
parallel(
'MacOS build': {
node('macos1') {
load "$HOME/env.groovy"
try {
stage('Git & Deps') {
slackNotify('MacOS build started.')
checkout scm
doGitRebase()
cleanupAndDeps()
}
stage('Build ClojureScript') {
buildClojureScript()
}
stage('Build MacOS binaries') {
/* add path for QT installation binaries */
env.PATH = "/Users/administrator/qt/5.9.1/clang_64/bin:${env.PATH}"
dir('desktop') {
sh 'rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
sh """
cmake -Wno-dev \\
-DCMAKE_BUILD_TYPE=Release \\
-DEXTERNAL_MODULES_DIR='${external_modules_dir.join(";")}' \\
-DDESKTOP_FONTS='${external_fonts.join(";")}' \\
-DJS_BUNDLE_PATH='${workspace}/${packageFolder}/StatusIm.jsbundle' \\
-DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
"""
sh 'make'
}
}
stage('Create MacOS Bundle') {
dir(packageFolder) {
sh 'curl -L -O "https://github.com/gnl/StatusAppFiles/raw/master/StatusIm.app.zip"'
sh 'unzip StatusIm.app.zip'
sh 'cp -r assets/share/assets StatusIm.app/Contents/Resources'
sh 'ln -sf ../Resources/assets ../Resources/ubuntu-server ../Resources/node_modules ' +
'StatusIm.app/Contents/MacOS'
sh 'chmod +x StatusIm.app/Contents/Resources/ubuntu-server'
sh 'cp ../desktop/bin/StatusIm StatusIm.app/Contents/MacOS'
sh 'cp ../desktop/reportApp/reportApp StatusIm.app/Contents/MacOS'
sh 'cp -f ../deployment/macos/qt-reportApp.conf StatusIm.app/Contents/Resources'
sh 'ln -sf ../Resources/qt-reportApp.conf StatusIm.app/Contents/MacOS/qt.conf'
sh 'install_name_tool -add_rpath "@executable_path/../Frameworks" ' +
'-delete_rpath "/Users/administrator/qt/5.9.1/clang_64/lib" ' +
'StatusIm.app/Contents/MacOS/reportApp'
sh 'cp -f ../deployment/macos/Info.plist StatusIm.app/Contents'
sh """
macdeployqt StatusIm.app -verbose=1 -dmg \\
-qmldir='${workspace}/node_modules/react-native/ReactQt/runtime/src/qml/'
"""
sh 'rm -f StatusIm.app.zip'
}
}
stage('Archive Artifact') {
archiveArtifacts 'StatusImPackage/*.dmg'
}
slackNotify('MacOS build finished successfully.')
} catch (e) {
slackNotify('Failed to build on MacOS.', color: 'bad')
throw e
} finally {
cleanupBuild()
}
}
},
'Linux build': {
node ('linux-01') {
def qt_bin = '/opt/qt59/bin'
try {
stage('Git & Deps') {
slackNotify('Linux build started.')
checkout scm
doGitRebase()
cleanupAndDeps()
}
stage('Build ClojureScript') {
buildClojureScript()
}
stage('Build Linux binaries') {
/* add path for QT installation binaries */
env.PATH = "${qt_bin}:${env.PATH}"
dir('desktop') {
sh 'rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
sh """
cmake -Wno-dev \\
-DCMAKE_BUILD_TYPE=Release \\
-DEXTERNAL_MODULES_DIR='${external_modules_dir.join(";")}' \\
-DDESKTOP_FONTS='${external_fonts.join(";")}' \\
-DJS_BUNDLE_PATH='${workspace}/${packageFolder}/StatusIm.jsbundle' \\
-DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
"""
sh 'make'
}
}
stage('Create Linux AppImage') {
dir(packageFolder) {
sh 'rm -rf StatusImAppImage'
/* TODO this needs to be fixed: status-react/issues/5378 */
sh 'cp /opt/StatusImAppImage.zip ./'
sh 'unzip ./StatusImAppImage.zip'
sh 'rm -rf AppDir'
sh 'mkdir AppDir'
}
sh "cp -r ./deployment/linux/usr ${packageFolder}/AppDir"
sh "cp ./deployment/linux/.env ${packageFolder}/AppDir"
sh "cp ./desktop/bin/StatusIm ${packageFolder}/AppDir/usr/bin"
sh "cp ./desktop/reportApp/reportApp ${packageFolder}/AppDir/usr/bin"
sh 'wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage'
sh 'chmod a+x ./linuxdeployqt-continuous-x86_64.AppImage'
sh 'rm -f Application-x86_64.AppImage'
sh 'rm -f StatusIm-x86_64.AppImage'
sh "ldd ${packageFolder}/AppDir/usr/bin/StatusIm"
sh """
./linuxdeployqt-continuous-x86_64.AppImage \\
${packageFolder}/AppDir/usr/bin/reportApp \\
-verbose=3 -always-overwrite -no-strip -no-translations -qmake=${qt_bin}/qmake \\
-qmldir='${workspace}/desktop/reportApp'
"""
sh """
./linuxdeployqt-continuous-x86_64.AppImage \\
${packageFolder}/AppDir/usr/share/applications/StatusIm.desktop \\
-verbose=3 -always-overwrite -no-strip \\
-no-translations -bundle-non-qt-libs \\
-qmake=${qt_bin}/qmake \\
-extra-plugins=imageformats/libqsvg.so \\
-qmldir='${workspace}/node_modules/react-native'
"""
dir(packageFolder) {
sh 'ldd AppDir/usr/bin/StatusIm'
sh 'cp -r assets/share/assets AppDir/usr/bin'
sh 'cp -rf StatusImAppImage/* AppDir/usr/bin'
sh 'rm -f AppDir/usr/bin/StatusIm.AppImage'
}
sh """
./linuxdeployqt-continuous-x86_64.AppImage \\
${packageFolder}/AppDir/usr/share/applications/StatusIm.desktop \\
-verbose=3 -appimage -qmake=${qt_bin}/qmake
"""
dir(packageFolder) {
sh 'ldd AppDir/usr/bin/StatusIm'
sh 'rm -rf StatusIm.AppImage'
sh 'cp -f ../StatusIm-x86_64.AppImage StatusIm.AppImage'
}
}
stage('Archive Artifact') {
archiveArtifacts 'StatusImPackage/*.AppImage'
}
slackNotify('Linux build finished successfully.')
} catch (e) {
slackNotify('Failed to build on Linux.', color: 'bad')
throw e
} finally {
cleanupBuild()
}
}
}
)
} catch (e) {
node() {
gitHubNotify("Desktop Jenkins build was failed or cancelled. More details at ${env.BUILD_URL}")
}
}
}

View File

@ -1,316 +0,0 @@
properties([
buildDiscarder(logRotator(
numToKeepStr: '2',
daysToKeepStr: '3',
artifactNumToKeepStr: '2',
artifactDaysToKeepStr: '3'
))
])
env.LANG = 'en_US.UTF-8'
env.LANGUAGE = 'en_US.UTF-8'
env.LC_ALL = 'en_US.UTF-8'
env.REALM_DISABLE_ANALYTICS=1
app_url = ''
dmg_url = ''
app_file = ''
dmg_file = ''
commit = ''
testPassed = true
packageFolder = './StatusImPackage'
external_modules_dir = [
'node_modules/react-native-i18n/desktop',
'node_modules/react-native-config/desktop',
'node_modules/react-native-fs/desktop',
'node_modules/react-native-http-bridge/desktop',
'node_modules/react-native-webview-bridge/desktop',
'node_modules/react-native-keychain/desktop',
'node_modules/react-native-securerandom/desktop',
'modules/react-native-status/desktop',
]
def installJSDeps() {
def attempt = 1
def maxAttempts = 10
def installed = false
sh 'node -v'
sh 'npm -v'
while (!installed && attempt <= maxAttempts) {
println "#${attempt} attempt to install npm deps"
sh 'scripts/prepare-for-platform.sh desktop'
sh 'npm install'
installed = fileExists('node_modules/web3/index.js')
attemp = attempt + 1
}
}
def doGitRebase() {
try {
sh 'git rebase origin/develop'
} catch (e) {
sh 'git rebase --abort'
throw e
}
}
def cleanupBuild() {
sh 'rm -rf node_modules'
sh "rm -rf ${packageFolder}"
sh 'rm -rf desktop/modules'
sh 'rm -rf desktop/node_modules'
}
def cleanupAndDeps() {
cleanupBuild()
sh 'cp .env.jenkins .env'
sh 'lein deps'
installJSDeps()
}
def slackNotify(message, color = 'good') {
slackSend(
color: color,
channel: '#jenkins-desktop',
message: "develop (${env.CHANGE_BRANCH}) ${message} ${env.BUILD_URL}"
)
}
def buildClojureScript() {
sh 'rm -f index.desktop.js'
sh 'lein prod-build-desktop'
sh "mkdir ${packageFolder}"
sh """
react-native bundle \\
--entry-file index.desktop.js \\
--dev false --platform desktop \\
--bundle-output ${packageFolder}/StatusIm.jsbundle \\
--assets-dest ${packageFolder}/assets
"""
}
def uploadArtifact(filename) {
def domain = 'ams3.digitaloceanspaces.com'
def bucket = 'status-im-desktop'
withCredentials([usernamePassword(
credentialsId: 'digital-ocean-access-keys',
usernameVariable: 'DO_ACCESS_KEY',
passwordVariable: 'DO_SECRET_KEY'
)]) {
sh """
s3cmd \\
--acl-public \\
--host='${domain}' \\
--host-bucket='%(bucket)s.${domain}' \\
--access_key=${DO_ACCESS_KEY} \\
--secret_key=${DO_SECRET_KEY} \\
put ${filename} s3://${bucket}/
"""
}
def url = "https://${bucket}.${domain}/${filename}"
return url
}
parallel(
'MacOS build': {
timeout(90) {
node('macos') {
load "$HOME/env.groovy"
try {
stage('Git & Deps') {
slackNotify('MacOS build started.')
checkout scm
doGitRebase()
cleanupAndDeps()
commit = sh(
returnStdout: true,
script: 'git rev-parse HEAD'
).trim().take(6)
}
stage('Build ClojureScript') {
buildClojureScript()
}
stage('Build MacOS binaries') {
/* add path for QT installation binaries */
env.PATH = "/Users/administrator/qt/5.9.1/clang_64/bin:${env.PATH}"
dir('desktop') {
sh 'rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
sh """
cmake -Wno-dev \\
-DCMAKE_BUILD_TYPE=Release \\
-DEXTERNAL_MODULES_DIR='${external_modules_dir.join(";")}' \\
-DJS_BUNDLE_PATH='${workspace}/${packageFolder}/StatusIm.jsbundle' \\
-DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
"""
sh 'make'
}
}
stage('Create MacOS Bundle') {
dir(packageFolder) {
sh 'curl -L -O "https://github.com/gnl/StatusAppFiles/raw/master/StatusIm.app.zip"'
sh 'unzip StatusIm.app.zip'
sh 'cp -r assets/share/assets StatusIm.app/Contents/Resources'
sh 'ln -sf ../Resources/assets ../Resources/ubuntu-server ../Resources/node_modules ' +
'StatusIm.app/Contents/MacOS'
sh 'chmod +x StatusIm.app/Contents/Resources/ubuntu-server'
sh 'cp ../desktop/bin/StatusIm StatusIm.app/Contents/MacOS'
sh 'cp ../desktop/reportApp/reportApp StatusIm.app/Contents/MacOS'
sh 'cp -f ../deployment/macos/qt-reportApp.conf StatusIm.app/Contents/Resources'
sh 'ln -sf ../Resources/qt-reportApp.conf StatusIm.app/Contents/MacOS/qt.conf'
sh 'install_name_tool -add_rpath "@executable_path/../Frameworks" ' +
'-delete_rpath "/Users/administrator/qt/5.9.1/clang_64/lib" ' +
'StatusIm.app/Contents/MacOS/reportApp'
sh 'cp -f ../deployment/macos/Info.plist StatusIm.app/Contents'
sh """
macdeployqt StatusIm.app -verbose=1 -dmg \\
-qmldir='${workspace}/node_modules/react-native/ReactQt/runtime/src/qml/'
"""
sh 'rm -f StatusIm.app.zip'
dmg_file = "StatusIm-${commit}.dmg"
sh "mv StatusIm.dmg ${dmg_file}"
}
}
stage('Archive Artifact') {
archiveArtifacts "StatusImPackage/${dmg_file}"
}
stage('Upload Artifacts') {
dir(packageFolder) {
dmg_url = uploadArtifact(dmg_file)
}
}
slackNotify('MacOS build finished successfully.')
} catch (e) {
slackNotify('Failed to build on MacOS.', color: 'bad')
throw e
} finally {
cleanupBuild()
}
}
}
},
'Linux build': {
timeout(90) {
node ('linux-new') {
def qt_bin = '/opt/qt59/bin'
try {
stage('Git & Deps') {
slackNotify('Linux build started.')
checkout scm
doGitRebase()
cleanupAndDeps()
commit = sh(
returnStdout: true,
script: 'git rev-parse HEAD'
).trim().take(6)
}
stage('Build ClojureScript') {
buildClojureScript()
}
stage('Build Linux binaries') {
/* add path for QT installation binaries */
env.PATH = "${qt_bin}:${env.PATH}"
dir('desktop') {
sh 'rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
sh """
cmake -Wno-dev \\
-DCMAKE_BUILD_TYPE=Release \\
-DEXTERNAL_MODULES_DIR='${external_modules_dir.join(";")}' \\
-DJS_BUNDLE_PATH='${workspace}/${packageFolder}/StatusIm.jsbundle' \\
-DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
"""
sh 'make'
}
}
stage('Create Linux AppImage') {
dir(packageFolder) {
sh 'rm -rf StatusImAppImage'
/* TODO this needs to be fixed: status-react/issues/5378 */
sh 'cp /opt/StatusImAppImage.zip ./'
sh 'unzip ./StatusImAppImage.zip'
sh 'rm -rf AppDir'
sh 'mkdir AppDir'
}
sh "cp -r ./deployment/linux/usr ${packageFolder}/AppDir"
sh "cp ./deployment/linux/.env ${packageFolder}/AppDir"
sh "cp ./desktop/bin/StatusIm ${packageFolder}/AppDir/usr/bin"
sh 'wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage'
sh 'chmod a+x ./linuxdeployqt-continuous-x86_64.AppImage'
sh 'rm -f Application-x86_64.AppImage'
sh 'rm -f StatusIm-x86_64.AppImage'
sh "ldd ${packageFolder}/AppDir/usr/bin/StatusIm"
sh """
./linuxdeployqt-continuous-x86_64.AppImage \\
${packageFolder}/AppDir/usr/share/applications/StatusIm.desktop \\
-verbose=3 -always-overwrite -no-strip \\
-no-translations -bundle-non-qt-libs \\
-qmake=${qt_bin}/qmake \\
-extra-plugins=imageformats/libqsvg.so \\
-qmldir='${workspace}/node_modules/react-native'
"""
dir(packageFolder) {
sh 'ldd AppDir/usr/bin/StatusIm'
sh 'cp -r assets/share/assets AppDir/usr/bin'
sh 'cp -rf StatusImAppImage/* AppDir/usr/bin'
sh 'rm -f AppDir/usr/bin/StatusIm.AppImage'
}
sh """
./linuxdeployqt-continuous-x86_64.AppImage \\
${packageFolder}/AppDir/usr/share/applications/StatusIm.desktop \\
-verbose=3 -appimage -qmake=${qt_bin}/qmake
"""
dir(packageFolder) {
sh 'ldd AppDir/usr/bin/StatusIm'
sh 'rm -rf StatusIm.AppImage'
app_file = "StatusIm-${commit}.AppImage"
sh "mv ../StatusIm-x86_64.AppImage ${app_file}"
}
}
stage('Archive Artifacts') {
archiveArtifacts "StatusImPackage/${app_file}"
}
stage('Upload Artifacts') {
dir(packageFolder) {
app_url = uploadArtifact(app_file)
}
}
slackNotify('Linux build finished successfully.')
} catch (e) {
slackNotify('Failed to build on Linux.', color: 'bad')
throw e
} finally {
cleanupBuild()
}
}
}
}
)
stage('Update nightly links') {
println "Publishing URLs:"
println dmg_url
println app_url
build(
job: 'misc/status-im.github.io-update_env',
parameters: [
[$class: 'StringParameterValue', name: 'DMG_URL', value: dmg_url],
[$class: 'StringParameterValue', name: 'NIX_URL', value: app_url]
]
)
}

View File

@ -1,182 +0,0 @@
// We need nightly builds for users who want to test apps, diawi removes old builds and limits downloads, hence the need for Artifactory.
// To see env: echo sh(returnStdout: true, script: 'env')
properties([
buildDiscarder(logRotator(
numToKeepStr: '30',
daysToKeepStr: '30',
))
])
env.LANG="en_US.UTF-8"
env.LANGUAGE="en_US.UTF-8"
env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1
env.REALM_DISABLE_ANALYTICS=1
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')
attemp = attempt + 1
}
}
timeout(90) {
node ('fastlane'){
def apkUrl = ''
def testApkUrl = ''
def ipaUrl = ''
def version
def build_no
load "$HOME/env.groovy"
try {
stage('Git & Dependencies') {
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
checkout scm
sh 'git fetch --tags'
sh 'rm -rf node_modules'
sh 'cp .env.nightly .env'
sh 'scripts/prepare-for-platform.sh mobile'
version = readFile("${env.WORKSPACE}/VERSION").trim()
installJSDeps()
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
sh 'cd ios && pod install && cd ..'
}
stage('Tag Build') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'status-im-auto',
usernameVariable: 'GIT_USER',
passwordVariable: 'GIT_PASS'
]]) {
build_no = sh(
returnStdout: true,
script: './scripts/build_no.sh --increment'
).trim()
}
}
stage('Tests') {
sh 'lein test-cljs'
}
stage('Build') {
sh 'lein prod-build'
}
stage('Build (Android)') {
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease'
}
stage('Deploy (Android)') {
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
println (artifact_dir + 'app-release.apk')
def artifact = (artifact_dir + 'app-release.apk')
def server = Artifactory.server('artifacts')
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
def filename = 'im.status.ethereum-' + shortCommit + '-n-fl' + '.apk'
def newArtifact = (artifact_dir + filename)
sh ('cp ' + artifact + ' ' + newArtifact)
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
def buildInfo = server.upload(uploadSpec)
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
sh ('echo ARTIFACT Android: ' + apkUrl)
withCredentials([
string(
credentialsId: "SUPPLY_JSON_KEY_DATA",
variable: 'GOOGLE_PLAY_JSON_KEY'
),
string(
credentialsId: "SLACK_URL",
variable: 'SLACK_URL'
)
]) {
sh ('bundle exec fastlane android nightly')
}
}
stage('Build & TestFlight (iOS)') {
withCredentials([
string(credentialsId: "slave-pass-${env.NODE_NAME}", variable: 'KEYCHAIN_PASSWORD'),
string(credentialsId: "SLACK_URL", variable: 'SLACK_URL'),
string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID'),
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')]) {
sh "plutil -replace CFBundleShortVersionString -string ${version} ios/StatusIm/Info.plist"
sh "plutil -replace CFBundleVersion -string ${build_no} ios/StatusIm/Info.plist"
sh 'fastlane ios nightly'
}
}
stage('Deploy diawi (iOS)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane ios upload_diawi'
env.WORKSPACE = pwd()
ipaUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
} catch (e) {
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
throw e
}
stage('Run status-nightly-publish-link job') {
build(
job: 'misc/status-im.github.io-update_env',
parameters: [
[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl],
[$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]
]
)
}
stage('Build (Android) for e2e tests') {
sh 'cd android && \
mv app/build/outputs/apk/release/app-release.apk \
app/build/outputs/apk/release/app-release.original.apk \
&& ENVFILE=.env.e2e ./gradlew assembleRelease'
}
stage('Upload apk for e2e tests') {
env.SAUCE_LABS_APK = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android saucelabs'
sh 'fastlane android upload_diawi'
testApkUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
stage('Slack Notification') {
slackSend color: 'good', message: 'Nightly build (develop) \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl
}
stage('Run extended e2e tests') {
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + env.SAUCE_LABS_APK)], wait: false
}
}
}

View File

@ -1,179 +0,0 @@
// We need nightly builds for users who want to test apps, diawi removes old builds and limits downloads, hence the need for Artifactory.
// To see env: echo sh(returnStdout: true, script: 'env')
properties([
buildDiscarder(logRotator(
numToKeepStr: '30',
daysToKeepStr: '30',
))
])
env.LANG="en_US.UTF-8"
env.LANGUAGE="en_US.UTF-8"
env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1
env.REALM_DISABLE_ANALYTICS=1
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')
attemp = attempt + 1
}
}
timeout(90) {
node ('fastlane'){
def apkUrl = ''
def testApkUrl = ''
def ipaUrl = ''
def version
def build_no
load "$HOME/env.groovy"
try {
stage('Git & Dependencies') {
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
checkout scm
sh 'git fetch --tags'
sh 'rm -rf node_modules'
sh 'cp .env.nightly.staging.fleet .env'
sh 'scripts/prepare-for-platform.sh mobile'
version = readFile("${env.WORKSPACE}/VERSION").trim()
installJSDeps()
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
sh 'cd ios && pod install && cd ..'
}
stage('Tag Build') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'status-im-auto',
usernameVariable: 'GIT_USER',
passwordVariable: 'GIT_PASS'
]]) {
build_no = sh(
returnStdout: true,
script: './scripts/build_no.sh --increment'
).trim()
}
}
stage('Tests') {
sh 'lein test-cljs'
}
stage('Build') {
sh 'lein prod-build'
}
stage('Build (Android)') {
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease'
}
stage('Deploy (Android)') {
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
println (artifact_dir + 'app-release.apk')
def artifact = (artifact_dir + 'app-release.apk')
def server = Artifactory.server('artifacts')
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
def filename = 'im.status.ethereum-' + shortCommit + '-n-fl' + '.apk'
def newArtifact = (artifact_dir + filename)
sh ('cp ' + artifact + ' ' + newArtifact)
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
def buildInfo = server.upload(uploadSpec)
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
sh ('echo ARTIFACT Android: ' + apkUrl)
withCredentials([
string(
credentialsId: "SUPPLY_JSON_KEY_DATA",
variable: 'GOOGLE_PLAY_JSON_KEY'
),
string(
credentialsId: "SLACK_URL",
variable: 'SLACK_URL'
)
]) {
sh ('bundle exec fastlane android nightly')
}
}
stage('Build & TestFlight (iOS)') {
withCredentials([
string(credentialsId: "slave-pass-${env.NODE_NAME}", variable: 'KEYCHAIN_PASSWORD'),
string(credentialsId: "SLACK_URL", variable: 'SLACK_URL'),
string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID'),
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')]) {
sh "plutil -replace CFBundleShortVersionString -string ${version} ios/StatusIm/Info.plist"
sh "plutil -replace CFBundleVersion -string ${build_no} ios/StatusIm/Info.plist"
sh 'fastlane ios nightly'
}
}
stage('Deploy diawi (iOS)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane ios upload_diawi'
env.WORKSPACE = pwd()
ipaUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
} catch (e) {
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
throw e
}
stage('Run status-nightly-publish-link job') {
build(
job: 'misc/status-im.github.io-update_env',
parameters: [
[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl],
[$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]
]
)
}
stage('Build (Android) for e2e tests') {
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
}
stage('Upload apk for e2e tests') {
env.SAUCE_LABS_APK = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android saucelabs'
sh 'fastlane android upload_diawi'
testApkUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
stage('Slack Notification') {
slackSend color: 'good', message: 'Nightly build (develop) \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl
}
stage('Run extended e2e tests') {
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + env.SAUCE_LABS_APK)], wait: false
}
}
}

View File

@ -1,128 +0,0 @@
env.LANG="en_US.UTF-8"
env.LANGUAGE="en_US.UTF-8"
env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1
env.REALM_DISABLE_ANALYTICS=1
def installJSDeps() {
def attempt = 1
def maxAttempts = 10
def installed = false
while (!installed && attempt <= maxAttempts) {
println "#${attempt} attempt to install npm deps"
sh 'scripts/prepare-for-platform.sh mobile'
sh 'npm install'
installed = fileExists('node_modules/web3/index.js')
attemp = attempt + 1
}
}
timeout(90) {
node ('fastlane') {
def apkUrl = ''
def ipaUrl = ''
def branch;
load "$HOME/env.groovy"
try {
stage('Git & Dependencies') {
slackSend color: 'good', message: REPO + ":" + BRANCH_NAME + ' build started. ' + env.BUILD_URL
checkout scm
sh 'rm -rf node_modules'
sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."'
// Assume all parameters are set in Jenkins 'Parameterized build'
// TODO(oskarth): Consider read/write from .env to avoid having to specify in Jenkins again
// sh 'cp .env.jenkins .env'
sh 'echo TESTFAIRY_ENABLED=' + TESTFAIRY_ENABLED + '>>' + '.env'
sh 'echo ETHEREUM_DEV_CLUSTER=' + ETHEREUM_DEV_CLUSTER + '>>' + '.env'
sh 'echo MAINNET_NETWORKS_ENABLED=' + MAINNET_NETWORKS_ENABLED + '>>' + '.env'
sh 'echo LOG_LEVEL=' + LOG_LEVEL + '>>' + '.env'
sh 'echo LOG_LEVEL_STATUS_GO=' + LOG_LEVEL_STATUS_GO + '>>' + '.env'
sh 'echo FLEET=' + FLEET + '>>' + '.env'
sh 'echo OFFLINE_INBOX_ENABLED=' + OFFLINE_INBOX_ENABLED + '>>' + '.env'
sh 'echo POW_TARGET=' + POW_TARGET + '>>' + '.env'
sh 'echo POW_TIME=' + POW_TIME + '>>' + '.env'
sh 'echo MAINNET_WARNING_ENABLED=' + MAINNET_WARNING_ENABLED + '>>' + '.env'
sh 'echo DEFAULT_NETWORK=' + DEFAULT_NETWORK + '>>' + '.env'
sh 'echo "**********************************************************************"'
sh 'echo PARAMETERIZED BUILD - USING CUSTOM ENVIRONMENT'
sh 'cat .env'
sh 'echo "**********************************************************************"'
installJSDeps()
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
sh 'cd ios && pod install && cd ..'
}
stage('Tests') {
sh 'lein test-cljs'
}
stage('Build') {
sh 'lein prod-build'
}
// Android
stage('Build (Android)') {
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease'
}
stage('Deploy (Android)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android upload_diawi'
apkUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
// iOS
stage('Build (iOS)') {
withCredentials([
string(
credentialsId: "slave-pass-${env.NODE_NAME}",
variable: 'KEYCHAIN_PASSWORD'
),
string(
credentialsId: 'fastlane-match-password',
variable:'MATCH_PASSWORD'
)]) {
sh 'fastlane ios adhoc'
}
}
stage('Deploy (iOS)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane ios upload_diawi'
env.WORKSPACE = pwd()
ipaUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
stage('Slack Notification') {
slackSend(
color: 'good',
message: "Branch: ${REPO}:${BRANCH_NAME}\nAndroid: ${apkUrl}\niOS: ${ipaUrl}"
)
}
} catch (e) {
slackSend color: 'bad', message: REPO + ":" + BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
throw e
}
}
}

View File

@ -1,155 +0,0 @@
// We need release builds for users who want to test apps, diawi removes old builds and limits downloads, hence the need for Artifactory.
// To see env: echo sh(returnStdout: true, script: 'env')
env.LANG="en_US.UTF-8"
env.LANGUAGE="en_US.UTF-8"
env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1
env.REALM_DISABLE_ANALYTICS=1
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')
attemp = attempt + 1
}
}
timeout(90) {
node ('fastlane'){
def apkUrl = ''
def ipaUrl = ''
def version
def build_no
load "$HOME/env.groovy"
try {
stage('Git & Dependencies') {
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
checkout scm
sh 'git fetch --tags'
sh 'rm -rf node_modules'
sh 'cp .env.prod .env'
sh 'scripts/prepare-for-platform.sh mobile'
version = readFile("${env.WORKSPACE}/VERSION").trim()
installJSDeps()
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
sh 'cd ios && pod install && cd ..'
}
stage('Tag Build') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'status-im-auto',
usernameVariable: 'GIT_USER',
passwordVariable: 'GIT_PASS'
]]) {
build_no = sh(
returnStdout: true,
script: './scripts/build_no.sh --increment'
).trim()
}
}
stage('Tests') {
sh 'lein test-cljs'
}
stage('Build') {
sh 'lein prod-build'
}
stage('Build (Android)') {
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease -PreleaseVersion=' + version
}
stage('Deploy (Android)') {
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
println (artifact_dir + 'app-release.apk')
sh ('ls -la ' + artifact_dir)
def artifact = (artifact_dir + 'app-release.apk')
def server = Artifactory.server('artifacts')
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
def filename = 'im.status.ethereum-' + shortCommit + '-rel' + '.apk'
def newArtifact = (artifact_dir + filename)
sh ('mv ' + artifact + ' ' + newArtifact)
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
def buildInfo = server.upload(uploadSpec)
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
sh ('echo ARTIFACT Android: ' + apkUrl)
}
stage('Build (iOS)') {
withCredentials([
string(
credentialsId: "slave-pass-${env.NODE_NAME}",
variable: 'KEYCHAIN_PASSWORD'
),
string(
credentialsId: 'fastlane-match-password',
variable:'MATCH_PASSWORD'
)]) {
sh "plutil -replace CFBundleShortVersionString -string ${version} ios/StatusIm/Info.plist"
sh "plutil -replace CFBundleVersion -string ${build_no} ios/StatusIm/Info.plist"
sh 'fastlane ios adhoc'
}
stage('Deploy (iOS)') {
withCredentials([
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane ios upload_diawi'
env.WORKSPACE = pwd()
ipaUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
}
}
} catch (e) {
slackSend color: 'bad', message: 'Release build failed to build. ' + env.BUILD_URL
throw e
}
stage('Slack Notification') {
slackSend color: 'good', message: 'Release build \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl
}
stage('Build (Android) for e2e tests') {
sh 'cd android && ENVFILE=.env.e2e ./gradlew assembleRelease'
}
stage('Upload apk for e2e tests') {
env.SAUCE_LABS_APK = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
]) {
sh 'fastlane android saucelabs'
sh 'fastlane android upload_diawi'
}
}
stage('Run extended e2e tests') {
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + env.SAUCE_LABS_APK)], wait: false
}
}
}