mirror of
https://github.com/status-im/status-react.git
synced 2025-01-13 20:46:53 +00:00
Jakub Sokołowski
4e567cf782
This PR extracts all the ci/*.groovy scripts into a separate private repo located at: https://github.com/status-im/status-react-jenkins The main reasons for a separate repo are: * Hiding the internal details of our CI setup * Hiding names of Jenkins credentials available in CI jobs * Lowering attack surface for malicious external contributors * Increasing focus on PRs related to CI setup You can read more about how Jenkins pipeline shared libraries work here: https://jenkins.io/doc/book/pipeline/shared-libraries/ In simple terms I've added the repo to the main Jenkins configuration in "Global Pipeline Libraries" section and load it using: library 'status-react-jenkins@master' Which makes globally available all of the libraries defined in the `vars` directory of that repo. This also eliminates the need for statements like `android = load 'ci/android.groovy'`. Signed-off-by: Jakub Sokołowski <jakub@status.im>
56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
library 'status-react-jenkins@master'
|
|
|
|
pipeline {
|
|
agent { label 'macos' }
|
|
|
|
environment {
|
|
LANG = 'en_US.UTF-8'
|
|
LANGUAGE = 'en_US.UTF-8'
|
|
LC_ALL = 'en_US.UTF-8'
|
|
TARGET = 'ios'
|
|
FASTLANE_DISABLE_COLORS = 1
|
|
/* See nix/README.md */
|
|
NIX_IGNORE_SYMLINK_STORE = 1
|
|
/* avoid writing to r/o /nix */
|
|
GEM_HOME = '~/.rubygems'
|
|
}
|
|
|
|
options {
|
|
timestamps()
|
|
/* Disable concurrent jobs */
|
|
disableConcurrentBuilds()
|
|
/* Prevent Jenkins jobs from running forever */
|
|
timeout(time: 45, unit: 'MINUTES')
|
|
/* Don't keep more than 50 builds */
|
|
buildDiscarder(logRotator(numToKeepStr: '50'))
|
|
}
|
|
|
|
stages {
|
|
stage('Prep') {
|
|
steps { script {
|
|
nix.shell(
|
|
'bundle install --gemfile=fastlane/Gemfile',
|
|
attr: 'shells.fastlane',
|
|
)
|
|
} }
|
|
}
|
|
stage('Clean Users'){
|
|
steps { script {
|
|
withCredentials([
|
|
usernamePassword(
|
|
credentialsId: 'fastlane-match-apple-id',
|
|
usernameVariable: 'FASTLANE_APPLE_ID',
|
|
passwordVariable: 'FASTLANE_PASSWORD'
|
|
),
|
|
]) {
|
|
nix.shell(
|
|
'bundle exec --gemfile=fastlane/Gemfile fastlane ios clean',
|
|
keepEnv: ['FASTLANE_APPLE_ID', 'FASTLANE_PASSWORD'],
|
|
attr: 'shells.fastlane',
|
|
)
|
|
}
|
|
} }
|
|
}
|
|
}
|
|
}
|