Skip to content

Instantly share code, notes, and snippets.

@jamalx31
Created June 29, 2020 16:01
Show Gist options
  • Save jamalx31/345fe46f9f582a5433d358bc8a612962 to your computer and use it in GitHub Desktop.
Save jamalx31/345fe46f9f582a5433d358bc8a612962 to your computer and use it in GitHub Desktop.
A pipeline template to automate app deployments
pipeline {
agent any
options {
// timeout(time: 60, unit: 'MINUTES')
}
parameters {
// choice(name: 'update', choices: ['PATCH', 'MINOR', 'MAJOR'], description: 'Increasing version major.minor.patch')
}
environment {
// ENVFILE = ".env.${getBuildEnv()}"
}
stages {
// Step 1
stage('Checkout') {
steps {
// fetch the repot
// install packages
// and notify Slack
}
}
// Step 2
stage('Detox Testing') {
when {
equals expected: 'master', actual: env.BRANCH_NAME
}
steps {
// Run tests
}
post {
success {
// set tests results
}
}
}
// Step 3 build iOS App
stage('Build iOS') {
steps {
// Build
}
post {
success {
// upload to App Center
}
}
}
// Step 3 build Android App
stage('Build Android') {
steps {
// build
}
post {
success {
// sign APK
// upload to App Center
}
}
}
// step 4 if prodcution
stage('Submit To Stores') {
when {
equals expected: 'master', actual: env.BRANCH_NAME
}
steps {
// submit apps to App Store & Play Store
}
post {
success {
// update version number on Github
}
}
}
}
post {
always {
// send report and results to Slack
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment