This repository has been archived by the owner. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
| @@ -0,0 +1,128 @@ | ||
| #!/bin/env groovy | ||
|
|
||
| @Library('cliqz-shared-library@vagrant') _ | ||
|
|
||
| properties([ | ||
| disableConcurrentBuilds(), | ||
| [$class: 'JobRestrictionProperty'] | ||
| ]) | ||
| node('mac-vm-host') { | ||
| def branchName = "${BRANCH_NAME}" | ||
|
|
||
| writeFile file: 'Vagrantfile', text: ''' | ||
| Vagrant.configure("2") do |config| | ||
| config.vm.box = "browser-ios-v298" | ||
| config.vm.define "publishios" do |publishios| | ||
| publishios.vm.hostname ="publishios" | ||
| publishios.vm.network "public_network", :bridge => "en0", auto_config: false | ||
| publishios.vm.boot_timeout = 900 | ||
| publishios.vm.provider "vmware_fusion" do |v| | ||
| v.name = "publishios" | ||
| v.whitelist_verified = true | ||
| v.gui = false | ||
| v.memory = ENV["NODE_MEMORY"] | ||
| v.cpus = ENV["NODE_CPU_COUNT"] | ||
| v.cpu_mode = "host-passthrough" | ||
| v.vmx["remotedisplay.vnc.enabled"] = "TRUE" | ||
| v.vmx["RemoteDisplay.vnc.port"] = ENV["NODE_VNC_PORT"] | ||
| v.vmx["ethernet0.pcislotnumber"] = "33" | ||
| end | ||
| publishios.vm.provision "shell", privileged: false, run: "always", inline: <<-SHELL#!/bin/bash -l | ||
| set -e | ||
| set -x | ||
| rm -f agent.jar | ||
| curl -LO #{ENV['JENKINS_URL']}/jnlpJars/agent.jar | ||
| ls . | ||
| java -version | ||
| nohup java -jar agent.jar -jnlpUrl #{ENV['JENKINS_URL']}/computer/#{ENV['NODE_ID']}/slave-agent.jnlp -secret #{ENV["NODE_SECRET"]} & | ||
| SHELL | ||
| end | ||
| end | ||
| ''' | ||
|
|
||
| vagrant.inside( | ||
| 'Vagrantfile', | ||
| '/jenkins', | ||
| 4, // CPU | ||
| 8000, // MEMORY | ||
| 12000, // VNC port | ||
| false, // rebuild image | ||
| ) { nodeId -> | ||
| node(nodeId) { | ||
| stage('Checkout') { | ||
| checkout scm | ||
| } | ||
|
|
||
| stage('Prepare') { | ||
| sh '''#!/bin/bash -l | ||
| set -e | ||
| set -x | ||
| java -version | ||
| node -v | ||
| npm -v | ||
| yarn -v | ||
| xcodebuild -version | ||
| pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | ||
| sudo xcodebuild -license accept | ||
| brew -v | ||
| npm -g install yarn | ||
| rm -rf Cartfile.resolved | ||
| ./bootstrap.sh --force | ||
| yarn install | ||
| pod install | ||
| ''' | ||
| } | ||
|
|
||
| if("${branchName}".contains("-beta")){ | ||
| stage('Build & Upload') { | ||
| withCredentials([ | ||
| [ | ||
| $class : 'UsernamePasswordMultiBinding', | ||
| credentialsId : '85859bba-4927-4b14-bfdf-aca726009962', | ||
| passwordVariable: 'GITHUB_PASSWORD', | ||
| usernameVariable: 'GITHUB_USERNAME', | ||
| ], | ||
| string(credentialsId: 'c9d7aaae-25ee-4b74-b03f-d50312c53edd', variable: 'ITUNES_USER'), | ||
| string(credentialsId: '59474dcc-f87e-41ac-803c-e32a0029f7e7', variable: 'SentryDSN'), | ||
| string(credentialsId: '070139a0-b210-4692-ab5f-5444f4aadac1', variable: 'FASTLANE_PASSWORD'), | ||
| string(credentialsId: 'a1904e28-d791-4118-b8ed-3ff064aee9a4', variable: 'MATCH_PASSWORD')]) | ||
| { | ||
| sh '''#!/bin/bash -l | ||
| set -x | ||
| set -e | ||
| rm -rf /Users/vagrant/Library/Keychains/ios-build.keychain* | ||
| export MATCH_KEYCHAIN_NAME=ios-build.keychain | ||
| fastlane beta | ||
| ''' | ||
| } | ||
| } | ||
| } | ||
| else if ("${branchName}".contains("-r")){ | ||
| stage('Build & Upload') { | ||
| withCredentials([ | ||
| [ | ||
| $class : 'UsernamePasswordMultiBinding', | ||
| credentialsId : '85859bba-4927-4b14-bfdf-aca726009962', | ||
| passwordVariable: 'GITHUB_PASSWORD', | ||
| usernameVariable: 'GITHUB_USERNAME', | ||
| ], | ||
| string(credentialsId: 'c9d7aaae-25ee-4b74-b03f-d50312c53edd', variable: 'ITUNES_USER'), | ||
| string(credentialsId: '59474dcc-f87e-41ac-803c-e32a0029f7e7', variable: 'SentryDSN'), | ||
| string(credentialsId: '070139a0-b210-4692-ab5f-5444f4aadac1', variable: 'FASTLANE_PASSWORD'), | ||
| string(credentialsId: 'a1904e28-d791-4118-b8ed-3ff064aee9a4', variable: 'MATCH_PASSWORD')]) | ||
| { | ||
| sh '''#!/bin/bash -l | ||
| set -x | ||
| set -e | ||
| rm -rf /Users/vagrant/Library/Keychains/ios-build.keychain* | ||
| export MATCH_KEYCHAIN_NAME=ios-build.keychain | ||
| fastlane release | ||
| ''' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |