Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkinsfile fix #1

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
602d370
remove cocoapods
corinnekrych Sep 24, 2015
6c6c623
Add -ObjC to other linker flags
corinnekrych Sep 24, 2015
5a72a42
cleaning fhconfig
corinnekrych Sep 24, 2015
ae52c56
Merge branch 'polish'
corinnekrych Sep 24, 2015
d21ca48
Modify ui flow to not display use details in webview
corinnekrych Sep 25, 2015
86177c0
Merge branch 'pr/3'
danielpassos Sep 26, 2015
b4fdf86
Add activity spinning wheel
corinnekrych Sep 28, 2015
7a5e726
Remove close from WebView navigation bar
corinnekrych Sep 28, 2015
9939218
add same icons than android templates
corinnekrych Sep 28, 2015
37ce22e
UI constraints fix
corinnekrych Sep 28, 2015
48d6702
Sign in again
corinnekrych Sep 28, 2015
d2d762e
Add error message pop-up
corinnekrych Sep 28, 2015
dbcbb31
Merge branch 'polishing'
corinnekrych Sep 28, 2015
34b1656
Merge pull request #4 from corinnekrych/polishing
edewit Sep 29, 2015
c4c1c57
Merge branch 'master' of github.com:feedhenry-templates/saml-ios-app
corinnekrych Oct 29, 2015
a38d629
align to min supported version ie: 7.0
corinnekrych Oct 29, 2015
962652e
use leatest released fwk 2.2.19
corinnekrych Oct 29, 2015
b07d9e8
Merge branch 'deployment.target.7.0'
corinnekrych Oct 29, 2015
9af5293
plist renamed
corinnekrych Jan 20, 2016
6a01f53
Merge branch 'RHMAP-3850.project.structure.for.digger'
corinnekrych Jan 20, 2016
423e620
Update README.md
corinnekrych Jan 25, 2016
69d43bf
update to fh-ios-sdk 3.0.0
corinnekrych Jan 26, 2016
b0237f7
Merge branch 'RHMAP-3849.update.fh-ios-sdk.to.3.0.0'
corinnekrych Jan 26, 2016
f25d498
[email protected]
jasonmadigan Jan 28, 2016
89a9194
Merge remote-tracking branch 'origin/RHMAP-3987-ios-sdk-311-master'
corinnekrych Jan 31, 2016
fb08918
Podify
corinnekrych Feb 2, 2016
99debd7
travis build
corinnekrych Feb 2, 2016
d0938eb
travis
corinnekrych Feb 2, 2016
98dab4e
share schema
corinnekrych Feb 2, 2016
2143097
Merge branch 'RHMAP-3917.travis'
corinnekrych Feb 2, 2016
bff5044
travis with cocoapods
corinnekrych Feb 2, 2016
91552bb
schema
corinnekrych Feb 2, 2016
852bf03
Merge branch 'RHMAP-3917.travis.cocoapods' into cocoapods
corinnekrych Feb 2, 2016
0fca748
Unify README
corinnekrych Feb 16, 2016
e068857
remove copy/paste
corinnekrych Feb 16, 2016
28f0111
README repo typo
corinnekrych Feb 16, 2016
1e4678d
README unified
corinnekrych Feb 16, 2016
50f7f6b
Merge branch 'RHMAP-4249.unified.README'
corinnekrych Feb 17, 2016
87f1d2c
Updating to Apache License
matzew Jun 30, 2016
ac1039f
Merge pull request #15 from feedhenry-templates/LICENSE_UPDATE
matzew Jul 13, 2016
db69530
FH-2547 updated to CocoaPods 1.0.1
jcesarmobile Sep 9, 2016
6d110d9
Added pod repo update
jcesarmobile Sep 13, 2016
2098b6c
Remove unused UI tests
corinnekrych Sep 13, 2016
d0fd1d9
Merge pull request #1 from corinnekrych/FH-2547.review
jcesarmobile Sep 13, 2016
4a2cb70
Removed pod update
jcesarmobile Sep 13, 2016
3f36937
Merge pull request #16 from jcesarmobile/FH-2547
corinnekrych Sep 13, 2016
c7c1b49
Merge branch 'master' into cocoapods
corinnekrych Sep 16, 2016
a20bbf4
Unify .gitignore
corinnekrych Sep 28, 2016
2ecd9e8
Merge pull request #18 from corinnekrych/FH-2789.gitignore
corinnekrych Sep 28, 2016
4b18a22
Add Swift version note
danielpassos Oct 10, 2016
599b99d
Fix markdown format
danielpassos Oct 10, 2016
b83e1ef
Merge pull request #19 from feedhenry-templates/README
corinnekrych Oct 11, 2016
9b82471
Add CONTRIBUTING.md
pmdarrow Nov 29, 2016
d913e3c
Merge pull request #21 from feedhenry-templates/add-contribution-guid…
pmdarrow Nov 30, 2016
9644eac
RHMAP-11790 Update to Xcode 8 recommended settings
jcesarmobile Nov 23, 2016
c37213b
Merge branch 'pr/22'
danielpassos Feb 1, 2017
4bbc043
RHMAP-13784 fix iOS Objective C SAML app crashes after logging in
jcesarmobile Feb 28, 2017
8f3430d
Merge pull request #24 from jcesarmobile/RHMAP-13784
jcesarmobile Feb 28, 2017
39f5d1c
Can submit to iTunes Connect
jhellar Feb 28, 2017
c96544a
Merge pull request #23 from jhellar/RHMAP-11428
jcesarmobile Mar 2, 2017
af3ced2
RHMAP-16314 Show disabled connection text when using a disabled tag
jcesarmobile Jul 19, 2017
3313138
Merge pull request #26 from jcesarmobile/RHMAP-16314
danielpassos Jul 19, 2017
39f2896
Add Jenkinsfile (#27)
laurafitzgerald Aug 9, 2017
cf3b031
update language
laurafitzgerald Aug 10, 2017
e3618bb
Merging branch update-language
laurafitzgerald Aug 10, 2017
19951dc
jenkinsfile fix
odra Aug 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 43 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
# Exclude OS X folder attributes
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
lib-cov
lcov.info
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results
build
.grunt
# Exclude user-specific XCode files
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.moved-aside
*.xcuserstate

node_modules
**/*.xcuserdatad/**
**/*.xcworkspace/**
# Exclude user-specific XCode files- with some IDE configuration tmp binaries could be configure to working directory.
build/
build/*
DerivedData/
Build/*
Build/

Pods/
# Obj-C/Swift binaries
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

# Playgrounds
# To demo some API features, playground are a useful feature.
# We exclude IDE specific files that saves user specific data.
timeline.xctimeline
playground.xcworkspace

# CocoaPods
# We check in xcodeproj but exclude CocoaPods generated xcworkspace
# We have chosen not to checked-in Pods.
# Podfile.lock is not checked-in as we make sure all dependencies (and transitive ones) are fixed in podspec.
Pods/
*.xcworkspace
Podfile.lock

# Exclude generated directory as part of FeedHenry release process script
dist/
Releases-*/*
FH-*/
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: objective-c
osx_image: xcode8.1
xcode_workspace: saml-ios-app.xcworkspace
xcode_scheme: saml-ios-app
xcode_sdk: iphonesimulator

before_install:
- travis_wait pod repo update --silent

notifications:
irc: "irc.freenode.org#feedhenry"

script:
- xcodebuild clean build -workspace saml-ios-app.xcworkspace -scheme saml-ios-app -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES

branches:
only:
- master
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# How to contribute

Thank you for your interest in contributing to the FeedHenry project. We want
keep this process as easy as possible so we've outlined a few guidelines below.
For more information about the FeedHenry project, visit
[our website](http://feedhenry.org/).

## Asking for help

Whether you're contributing a new feature or bug fix, or simply submitting a
ticket, the FeedHenry team is available for technical advice or feedback.
You can reach us at #feedhenry on [Freenode IRC](https://freenode.net/) or the
[feedhenry-dev list](https://www.redhat.com/mailman/listinfo/feedhenry-dev)
-- both are actively monitored.

## Getting started

* Make sure you have a [JIRA account](https://issues.jboss.org)
* Make sure you have a [GitHub account](https://github.com/signup/free)
* Submit a ticket for your issue to the
[FeedHenry project](https://issues.jboss.org/projects/FH/), assuming one does
not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub.

## Making changes

* Create a topic branch from where you want to base your work.
* This is usually the master branch.
* To quickly create a topic branch based on master; `git checkout -b
<branch name> master`. By convention we typically include the JIRA issue
key in the branch name, e.g. `FH-1234-my-feature`.
* Please avoid working directly on the `master` branch.
* Make commits of logical units.
* Prepend your commit messages with a JIRA ticket number, e.g. "FH-1234: Fix
spelling mistake in README."
* Follow the coding style in use.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure you have added the necessary tests for your changes.
* Run _all_ the tests to assure nothing else was accidentally broken.

## Submitting changes

* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the repository in the [FeedHenry GitHub organization]
(https://github.com/feedhenry) and choose branch you want to patch
(usually master).
* Advanced users may want to install the [GitHub CLI](https://hub.github.com/)
and use the `hub pull-request` command.
* Update your JIRA ticket to mark that you have submitted code and are ready
for it to be reviewed (Status: Dev Complete).
* Include a link to the pull request in the ticket.
* Add detail about the change to the pull request including screenshots
if the change affects the UI.

## Reviewing changes

* After submitting a pull request, one of FeedHenry team members will review it.
* Changes may be requested to conform to our style guide and internal
requirements.
* When the changes are approved and all tests are passing, a FeedHenry team
member will merge them.
* Note: if you have write access to the repository, do not directly merge pull
requests. Let another team member review your pull request and approve it.

## Coding best practices

We have compiled a set of best practices for each programming
language we use. View them [here](https://github.com/fheng/best_practice).

# Additional Resources

* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
* [Read the Issue Guidelines by @necolas](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md) for more details
109 changes: 109 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* IOS Jenkinsfile
*/

// In RHMAP's case, the following parameters are sent by RHMAP to the Jenkins job.
// This means, the Jenkins job has to be a parametrized build with those parameters.
CODE_SIGN_PROFILE_ID = params?.BUILD_CREDENTIAL_ID?.trim() // e.g. "redhat-dist-dp"
BUILD_CONFIG = params?.BUILD_CONFIG?.trim() // e.g. "Debug" or "Release"

// To hardcode the values uncomment the lines below
//CODE_SIGN_PROFILE_ID = "redhat-dist-dp"
//BUILD_CONFIG = "Debug"

// sample values commented below are for https://github.com/feedhenry-templates/saml-ios-app
/* ------------- use these to hardcode values in Jenkinsfile ---------------- */
PROJECT_NAME = "saml-ios-app"
INFO_PLIST = "saml-ios-app/saml-ios-app-Info.plist"
VERSION = "0.1-alpha"
SHORT_VERSION = "0.1"
BUNDLE_ID = "com.feedhenry.saml-ios-app"
OUTPUT_FILE_NAME="${PROJECT_NAME}-${BUILD_CONFIG}.ipa"
SDK = "iphoneos"

XC_VERSION = "" // use something like 8.3 to use a specific XCode version.
// If this is not set, the default Xcode on the machine will be used

CLEAN = true // do a clean build and sign


/* ------------- use these to get values from Jenkins parametrized build ---------------- */
/*
PROJECT_NAME = params?.PROJECT_NAME?.trim() // e.g. "saml-ios-app"
INFO_PLIST = params?.INFO_PLIST?.trim() // e.g. "saml-ios-app/saml-ios-app-Info.plist"
VERSION = params?.APP_VERSION?.trim() // e.g. "0.1-alpha"
SHORT_VERSION = params?.APP_SHORT_VERSION?.trim() // e.g. "0.1"
BUNDLE_ID = params?.BUNDLE_ID?.trim() // e.g. "com.feedhenry.saml-ios-app"
OUTPUT_FILE_NAME = params?.OUTPUT_FILE_NAME?.trim() ?: "myapp.ipa" // if not set, myapp.ipa will be used
SDK = params?.OUTPUT_FILE_NAME?.trim() ?: "iphoneos" // if not set, "iphoneos" will be used

XC_VERSION = params?.XC_VERSION?.trim() ?: "" // use something like 8.3 to use a specific XCode version.
// if not set, the default Xcode on the machine will be used

CLEAN = params?.CLEAN?.trim()?.toBoolean() ?: true // default value is true
*/

/*
NOTE: RHMAP sends `BUILD_CONFIG` parameter to denote if it is a debug build or a release build.
However, from codesign/xcodebuild perspective, the steps required are the same.
So, we just ignore that parameter.
*/


// parametrized values

FH_CONFIG_CONTENT = params?.FH_CONFIG_CONTENT ?: ""

// RHMAP specific values. RHMAP currently sends build config type all lower case. we handle it here as case matters for Xcode.
// also, RHMAP can send "Distribution" config. we use "Release" in that case.
if(BUILD_CONFIG.toLowerCase() == "debug"){
BUILD_CONFIG = "Debug"
}
else if(BUILD_CONFIG.toLowerCase() == "release" || BUILD_CONFIG.toLowerCase() == "distribution"){
BUILD_CONFIG = "Release"
}

node('ios') {
stage('Checkout') {
checkout scm
}

stage('Prepare') {
writeFile file: "${PROJECT_NAME}/fhconfig.plist", text: FH_CONFIG_CONTENT
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}"
}
}
8 changes: 5 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source 'https://github.com/CocoaPods/Specs.git'

xcodeproj 'saml-ios-app.xcodeproj'
platform :ios, '7.0'
project 'saml-ios-app.xcodeproj'
platform :ios, '8.0'

pod 'FH', '2.2.11'
target 'saml-ios-app' do
pod 'FH', '~> 4.0.0'
end
20 changes: 0 additions & 20 deletions Podfile.lock

This file was deleted.

56 changes: 53 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
saml-ios-app
============
Simple native iOS app to work with [```SAML Service``` connector service](https://github.com/feedhenry-templates/saml-service). To configure the service in your RHMAP platform read the [SAML notes](https://github.com/feedhenry-templates/saml-service/blob/master/NOTES.md)
# saml-ios-app [![Build Status](https://travis-ci.org/feedhenry-templates/saml-ios-app.png)](https://travis-ci.org/feedhenry-templates/saml-ios-app)

> Swift version is available [here](https://github.com/feedhenry-templates/saml-ios-swift).

Author: Corinne Krych
Level: Intermediate
Technologies: Objective-C, iOS, RHMAP, CocoaPods.
Summary: A demonstration of how to authenticate with SAML IdP with RHMAP.
Community Project : [Feed Henry](http://feedhenry.org)
Target Product: RHMAP
Product Versions: RHMAP 3.7.0+
Source: https://github.com/feedhenry-templates/saml-ios-app
Prerequisites: fh-ios-sdk : 3.+, Xcode : 8+, iOS SDK : iOS8+, CocoaPods: 1.0.1+

## What is it?

Simple native iOS app to work with [```SAML Service``` connector service](https://github.com/feedhenry-templates/saml-service) in RHMAP. The user can login to the app using SAML authentication, user details available on SAML IdP are displayed once successfully logged in.To configure the service in your RHMAP platform read the [SAML notes](https://github.com/feedhenry-templates/saml-service/blob/master/NOTES.md).

If you do not have access to a RHMAP instance, you can sign up for a free instance at [https://openshift.feedhenry.com/](https://openshift.feedhenry.com/).

## How do I run it?

### RHMAP Studio

This application and its cloud services are available as a project template in RHMAP as part of the "SAML Project" template.

### Local Clone (ideal for Open Source Development)
If you wish to contribute to this template, the following information may be helpful; otherwise, RHMAP and its build facilities are the preferred solution.

## Build instructions

1. Clone this project
1. Populate ```saml-ios-app/fhconfig.plist``` with your values as explained [on section 2.1.4. Setup](https://access.redhat.com/documentation/en/red-hat-mobile-application-platform-hosted/3/paged/client-sdk/chapter-2-native-ios-objective-c).
1. Run ```pod install```
1. Open ```saml-ios-app.xcworkspace```
1. Run the project

## How does it work?

### Using FHCloudRequest
In this example we used ```FHCloudRequest``` to make request on the REST endpoint setup to deal with SAML authentication.

### iOS9 and non TLS1.2 backend

If your RHMAP is depoyed without TLS1.2 support, open as source ```saml-ios-app/saml-ios-appr-Info.plist``` add the exception lines:

```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```
Loading