Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Removed bootstrap.sh and added the scripts to fastlane.

  • Loading branch information
Sharath Ganesh Pai authored and Tim Palade committed Sep 12, 2018
1 parent e236fb7 commit 151307cf9e966f3c1b6b27ed2878ac31ac744ba1
Showing with 107 additions and 94 deletions.
  1. +10 −16 Jenkinsfile.nightly
  2. +65 −64 Jenkinsfile.publish
  3. +32 −14 fastlane/Fastfile
@@ -65,19 +65,15 @@ node('mac-vm-host') {
java -version
node -v
npm -v
yarn -v
brew -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 Carthage node_modules Podfile.lock Pods
./bootstrap.sh --force
yarn install
pod install
fastlane clearCache
fastlane prepare
pip install virtualenv
sudo /usr/bin/easy_install virtualenv
'''
'''
}
stage('Build & Upload') {
withCredentials([
@@ -92,7 +88,7 @@ node('mac-vm-host') {
string(credentialsId: '070139a0-b210-4692-ab5f-5444f4aadac1', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: 'a1904e28-d791-4118-b8ed-3ff064aee9a4', variable: 'MATCH_PASSWORD'),
string(credentialsId: 'f206e880-e09a-4369-a3f6-f86ee94481f2', variable: 'SENTRY_AUTH_TOKEN'),
string(credentialsId: 'ab91f92a-4588-4034-8d7f-c1a741fa31ab', variable: 'FASTLANE_ITC_TEAM_ID')])
string(credentialsId: 'ab91f92a-4588-4034-8d7f-c1a741fa31ab', variable: 'FASTLANE_ITC_TEAM_ID')])
{
sh '''#!/bin/bash -l
set -x
@@ -109,20 +105,18 @@ node('mac-vm-host') {
}
catch(all) {
jobStatus = 'FAIL'
if (jobStatus == 'FAIL') {
currentBuild.result = 'FAILURE'
return
}
print "Something Failed. Check the above logs."
currentBuild.result = 'FAILURE'
}
finally {
stage("Clean Up"){
sh '''#!/bin/bash -l
set -x
set -e
rm -rf Cartfile.resolved Carthage node_modules Podfile.lock Pods
fastlane clearCache
'''
}
}
}
}
}
}
}
@@ -3,7 +3,7 @@
@Library('cliqz-shared-library@vagrant') _

properties([
disableConcurrentBuilds(),
disableConcurrentBuilds(),
[$class: 'JobRestrictionProperty']
])
node('mac-vm-host') {
@@ -12,7 +12,7 @@ node('mac-vm-host') {
writeFile file: 'Vagrantfile', text: '''
Vagrant.configure("2") do |config|
config.vm.box = "browser-ios-v300"
config.vm.define "publishios" do |publishios|
publishios.vm.hostname ="publishios"
@@ -54,77 +54,78 @@ node('mac-vm-host') {
stage('Checkout') {
checkout scm
}

stage('Prepare') {
sh '''#!/bin/bash -l
brew install getsentry/tools/sentry-cli
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 Carthage node_modules Podfile.lock Pods
./bootstrap.sh --force
yarn install
pod install
pip install virtualenv
sudo /usr/bin/easy_install virtualenv
'''
}

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: 'c033c0cc-a707-4a5d-aa5f-efccdd28c654', variable: 'SentryDSN'),
string(credentialsId: 'd373025a-dc98-4fba-a2e3-da21e2011972', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: '9d4b5abb-a0ab-4d8b-85b7-cf380485da7c', variable: 'MATCH_PASSWORD'),
string(credentialsId: 'f206e880-e09a-4369-a3f6-f86ee94481f2', variable: 'SENTRY_AUTH_TOKEN'),
string(credentialsId: 'd9dc5c33-beef-402e-93d2-376a722a9766', variable: 'FASTLANE_ITC_TEAM_ID')])
{
try {
stage('Prepare') {
sh '''#!/bin/bash -l
set -x
brew install getsentry/tools/sentry-cli
set -e
rm -rf /Users/vagrant/Library/Keychains/ios-build.keychain*
rm -rf ../build-tools
fastlane importLocalizations
set -x
java -version
node -v
npm -v
brew -v
xcodebuild -version
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
sudo xcodebuild -license accept
fastlane clearCache
fastlane prepare
pip install virtualenv
sudo /usr/bin/easy_install virtualenv
'''
if("${branchName}".contains("-beta")){
sh '''#!/bin/bash -l
set -x
set -e
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: 'c033c0cc-a707-4a5d-aa5f-efccdd28c654', variable: 'SentryDSN'),
string(credentialsId: 'd373025a-dc98-4fba-a2e3-da21e2011972', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: '9d4b5abb-a0ab-4d8b-85b7-cf380485da7c', variable: 'MATCH_PASSWORD'),
string(credentialsId: 'f206e880-e09a-4369-a3f6-f86ee94481f2', variable: 'SENTRY_AUTH_TOKEN'),
string(credentialsId: 'd9dc5c33-beef-402e-93d2-376a722a9766', variable: 'FASTLANE_ITC_TEAM_ID')])
{
sh '''#!/bin/bash -l
set -x
set -e
export MATCH_KEYCHAIN_NAME=ios-build.keychain
fastlane release
set -e
rm -rf /Users/vagrant/Library/Keychains/ios-build.keychain*
rm -rf ../build-tools
fastlane importLocalizations
'''
if("${branchName}".contains("-beta")){
sh '''#!/bin/bash -l
set -x
set -e
export MATCH_KEYCHAIN_NAME=ios-build.keychain
fastlane beta
'''
}
else if ("${branchName}".contains("-r")){
sh '''#!/bin/bash -l
set -x
set -e
export MATCH_KEYCHAIN_NAME=ios-build.keychain
fastlane release
'''
}
}
}
}

stage("Clean Up"){
sh '''#!/bin/bash -l
set -x
set -e
rm -rf Cartfile.resolved Carthage node_modules Podfile.lock Pods
'''
catch(all){
print "Something Failed. Check the above logs."
}
finally {
stage("Clean Up"){
sh '''#!/bin/bash -l
set -x
set -e
fastlane clearCache
'''
}
}
}
}
@@ -20,15 +20,15 @@ platform :ios do
clone_folder: "../build-tools",
)
sh("cd .. && sh ../build-tools/export-locales-cliqz.sh Client.xcodeproj browser-ios-l10n cliqz-ios.xliff")
end
end

lane :importLocalizations do
# Import Firefox localizations
import_repository(
url: 'https://github.com/cliqz-oss/ios-l10n-scripts.git',
clone_folder: "../build-tools",
)

sh("cd .. && sh ../build-tools/import-locales-firefox.sh --release")

# revert changes that Firefox did to InfoPlist.strings
@@ -46,12 +46,30 @@ platform :ios do

end


lane :nightly do
lane :clearCache do

# Remove the Cache
sh("cd .. && rm -rf Cartfile.resolved Carthage node_modules Podfile.lock Pods && rm -rf ~/Library/Caches/org.carthage.CarthageKit")

end

lane :prepare do

# Run Bootstrap for Carthage
sh("cd .. && carthage bootstrap --verbose --platform ios --color auto --cache-builds")

# Install NPM and POD Dependencies and Run the Build Script for NPM Dependencies.
sh("cd .. && npm install")
sh("cd .. && pod install")
sh("cd .. && npm run build")

end

lane :nightly do

# Configuring Sentry DSN
sh("cd .. && plutil -replace SentryDSN -string $SentryDSN Client/Info.plist")

# Building ReactNative Entension
sh("cd .. && npm run bundle")

@@ -82,11 +100,11 @@ platform :ios do
workspace: "Client.xcworkspace",
clean: "true",
scheme: "Firefox",
xcconfig: "Client/Configuration/Firefox.xcconfig",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DBETA'",
xcconfig: "Client/Configuration/Firefox.xcconfig",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DBETA'",
skip_profile_detection: "true",
export_options: {
provisioningProfiles: {
provisioningProfiles: {
"com.cliqz.ios.newCliqz" => "match AppStore com.cliqz.ios.newCliqz",
"com.cliqz.ios.newCliqz.ShareTo" => "match AppStore com.cliqz.ios.newCliqz.ShareTo",
}
@@ -106,11 +124,11 @@ platform :ios do
)
end

lane :beta do
lane :beta do

# Configuring Sentry DSN
sh("cd .. && plutil -replace SentryDSN -string $SentryDSN Client/Info.plist")

# Building ReactNative Entension
sh("cd .. && npm run bundle")

@@ -138,7 +156,7 @@ platform :ios do
clean: "true",
scheme: "Ghostery",
xcconfig: "Client/Configuration/Ghostery.xcconfig",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DBETA'",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DBETA'",
skip_profile_detection: "true",
export_options: {
provisioningProfiles: {
@@ -161,11 +179,11 @@ platform :ios do
)
end

lane :release do
lane :release do

# Configuring Sentry DSN
sh("cd .. && plutil -replace SentryDSN -string $SentryDSN Client/Info.plist")

# Building ReactNative Entension
sh("cd .. && npm run bundle")

@@ -193,7 +211,7 @@ platform :ios do
clean: "true",
scheme: "Ghostery",
xcconfig: "Client/Configuration/Ghostery.xcconfig",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DRELEASE'",
xcargs: "OTHER_SWIFT_FLAGS\='$(value) -DRELEASE'",
skip_profile_detection: "true",
export_options: {
provisioningProfiles: {

0 comments on commit 151307c

Please sign in to comment.