This repository has been archived by the owner on Dec 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update mobile ci cd topic * update based on feedback from reviews
- Loading branch information
Showing
9 changed files
with
246 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
modules/ROOT/pages/digger/access-mobile-client-build-logs.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[[access-mobile-client-build-logs]] | ||
= Viewing Build Logs | ||
|
||
== Viewing Build History in the OpenShift Console | ||
|
||
All of the builds related to your mobile client can be seen in the **Builds** tab of your {mobile-client}. Each build can be expanded to show further information about the build configuration, latest build and build history. | ||
|
||
All builds have a *View Log* link associated with them to access the detailed logs of that build. | ||
|
||
image::mobile-clients-builds-complete.png[access-build-from-notification][align="center"] | ||
|
||
|
||
== Viewing Build Logs in Jenkins | ||
|
||
. Navigate to the {mobile-client} and click the *Builds* tab. | ||
|
||
. Click the *View Log* link for the build, you are redirected to the Jenkins instance that has been running your build. | ||
|
||
. If prompted, log into OpenShift and accept the authorization request for: | ||
+ | ||
* user:info permission | ||
* user:check-access permission | ||
|
||
. View the log of the build. Based on your permissions to the OpenShift project, you might have access to other Jenkins capabilities, such as inspecting the build configuration or re-running the build with changes in the pipeline script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[cleaning-up-mobile-client-builds]] | ||
= Cleaning up a Mobile Client Build | ||
|
||
== Deleting a Build Instance | ||
|
||
After creating and running a build, you can click through to your mobile client screen from the project overview and into the *Builds* tab. In this tab you see the details of your various mobile client builds. | ||
|
||
1. Click the build number of the build you want to delete. The build details screen is displayed. | ||
2. Choose *Delete* from the *Actions* menu. The build resource is removed from OpenShift along with the corrosponding build in the CI/CD service and any artefacts. | ||
|
||
== Deleting a {digger-service} Build Configuration | ||
|
||
When you create a {mobile-client} build configuration, you create a https://docs.openshift.org/latest/dev_guide/builds/index.html#defining-a-buildconfig[BuildConfig] resource in OpenShift. This build config is then translated into a Jenkins Build for your mobile client in the CI/CD service. If you want to remove the entire Job from the CI/CD service and clean up everything in OpenShift, then deleting the build config will achieve this. To delete the build config, click into your mobile client and open the builds tab. From here you can select the delete option from the more actions (the three dots) at the far right of the build row. Once deleted associated resources and builds with that Job will be removed as will the underlying Jenkins Job in the CI/CD service. |
134 changes: 134 additions & 0 deletions
134
modules/ROOT/pages/digger/proc_adding-a-jenkinsfile.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
= Adding a Jenkinsfile | ||
|
||
To build a mobile app using the {digger-service} service, you must add a `Jenkinsfile` to your git repository, typically in the root directory of that repository. | ||
|
||
The following sample files are suitable for the link:showcase-apps.html[Showcase Apps]. You may need a different configuration for your mobile app. | ||
|
||
== Sample Android Jenkinsfile for Debug Build Type | ||
|
||
```groovy | ||
node("android") { | ||
stage("Checkout") { | ||
checkout scm | ||
} | ||
|
||
stage("Prepare") { | ||
sh 'chmod +x ./gradlew' | ||
} | ||
|
||
stage("Build") { | ||
sh './gradlew clean assembleDebug' //comment for debug builds | ||
} | ||
|
||
uncomment the following stage if running a release build | ||
stage("Sign") { | ||
|
||
} | ||
|
||
stage("Archive") { | ||
archiveArtifacts artifacts: 'app/build/outputs/apk/**/app-debug.apk', excludes: 'app/build/outputs/apk/*-unaligned.apk' | ||
} | ||
} | ||
|
||
``` | ||
|
||
== Sample Android Jenkinsfile for Release Build Type | ||
|
||
```groovy | ||
node("android") { | ||
stage("Checkout") { | ||
checkout scm | ||
} | ||
|
||
stage("Prepare") { | ||
sh 'chmod +x ./gradlew' | ||
} | ||
|
||
stage("Build"){ | ||
sh './gradlew clean assembleRelease' // uncomment for release build | ||
} | ||
|
||
stage("Sign") { | ||
signAndroidApks ( | ||
keyStoreId: "myproject-testandroidcert", | ||
keyAlias: "aerogear", | ||
apksToSign: "**/*-unsigned.apk", | ||
// uncomment the following line to output the signed APK to a separate directory as described above | ||
// signedApkMapping: [ $class: UnsignedApkBuilderDirMapping ], | ||
// uncomment the following line to output the signed APK as a sibling of the unsigned APK, as described above, or just omit signedApkMapping | ||
// you can override these within the script if necessary | ||
// androidHome: '/usr/local/Cellar/android-sdk' | ||
) | ||
} | ||
|
||
stage("Archive") { | ||
archiveArtifacts artifacts: 'app/build/outputs/apk/**/app-release.apk', excludes: 'app/build/outputs/apk/*-unaligned.apk' | ||
} | ||
} | ||
|
||
``` | ||
|
||
== Sample iOS Jenkinsfile for Release Build Type | ||
|
||
```groovy | ||
CODE_SIGN_PROFILE_ID = "myproject-iostestcert" | ||
BUILD_CONFIG = "Debug" // Use either "Debug" or "Release" | ||
|
||
PROJECT_NAME = "helloworld-ios-app" | ||
INFO_PLIST = "helloworld-ios-app/helloworld-ios-app-Info.plist" | ||
VERSION = "1.0.0" | ||
SHORT_VERSION = "1.0" | ||
BUNDLE_ID = "org.aerogear.helloworld-ios-app" | ||
OUTPUT_FILE_NAME="${PROJECT_NAME}-${BUILD_CONFIG}.ipa" | ||
SDK = "iphoneos" | ||
|
||
// use something like 8.3 to use a specific XCode version, default version is used if not set | ||
XC_VERSION = "" | ||
|
||
// do a clean build and sign | ||
CLEAN = true | ||
|
||
node('ios') { | ||
stage('Checkout') { | ||
checkout scm | ||
} | ||
|
||
stage('Prepare') { | ||
sh '/usr/local/bin/pod install' | ||
} | ||
|
||
stage('Build') { | ||
withEnv(["XC_VERSION=${XC_VERSION}"]) { | ||
xcodeBuild( | ||
cleanBeforeBuild: CLEAN, | ||
src: './', | ||
schema: "${PROJECT_NAME}", | ||
workspace: "${PROJECT_NAME}", | ||
buildDir: "build", | ||
sdk: "${SDK}", | ||
version: "${VERSION}", | ||
shortVersion: "${SHORT_VERSION}", | ||
bundleId: "${BUNDLE_ID}", | ||
infoPlistPath: "${INFO_PLIST}", | ||
xcodeBuildArgs: 'ENABLE_BITCODE=NO OTHER_CFLAGS="-fstack-protector -fstack-protector-all"', | ||
autoSign: false, | ||
config: "${BUILD_CONFIG}" | ||
) | ||
} | ||
} | ||
|
||
stage('CodeSign') { | ||
codeSign( | ||
profileId: "${CODE_SIGN_PROFILE_ID}", | ||
clean: CLEAN, | ||
verify: true, | ||
ipaName: "${OUTPUT_FILE_NAME}", | ||
appPath: "build/${BUILD_CONFIG}-${SDK}/${PROJECT_NAME}.app" | ||
) | ||
} | ||
|
||
stage('Archive') { | ||
archiveArtifacts "build/${BUILD_CONFIG}-${SDK}/${OUTPUT_FILE_NAME}" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
//':context:' is a vital parameter. See: http://asciidoctor.org/docs/user-manual/#include-multiple | ||
:context: proc_building-a-mobile-app | ||
|
||
[id='{context}_proc_building-a-mobile-app'] | ||
= Building a Mobile App | ||
|
||
To build a mobile app. | ||
|
||
. Log in to the OpenShift Console. | ||
|
||
. Browse to the *Project Overview* screen and find the {mobile-client} you want to build. | ||
|
||
. Click on the name of the {mobile-client} to open the details view. | ||
|
||
. From the *Builds* tab, select the mobile app you want to build click *Start Build*. | ||
+ | ||
NOTE: Expanding the build section will show the current status of this build. | ||
|
||
. Check the mobile app build status by expanding the mobile client box. | ||
+ | ||
NOTE: This box lists the last 5 builds for this client. | ||
|
||
. To view the mobile app as a pipeline build, from the left menu, click *Builds > Pipeline*. | ||
+ | ||
Each build step is displayed (along with the current step status: completed, error or running) based on the stages in your Jenkinsfile code. | ||
|
||
. To view the full build log, click *view log* which redirects you to your Jenkins instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.