Skip to content

Commit

Permalink
Merge branch 'feat/ios-ci-build' into 'master'
Browse files Browse the repository at this point in the history
feat(ci): ios build

See merge request papers/airgap/airgap-wallet!59
  • Loading branch information
Dominik Schöni committed Jan 8, 2019
2 parents 4c99299 + 87d6aac commit 0bb056a
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 24 deletions.
48 changes: 38 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stages:
- build
- test
- native_build
- deploy
- qa

build_ionic:
stage: build
Expand All @@ -33,9 +33,19 @@ unit:
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker run $IMAGE_TAG_CURRENT npm run test-ci
- docker run --name unit-$CI_COMMIT_SHA $IMAGE_TAG_CURRENT npm run test-ci
- docker run --name lint-$CI_COMMIT_SHA $IMAGE_TAG_CURRENT npm run lint-ci
- docker cp unit-$CI_COMMIT_SHA:/app/coverage/lcov.info lcov.info
- docker cp lint-$CI_COMMIT_SHA:/app/lintReport.json lintReport.json
after_script:
- docker rm unit-$CI_COMMIT_SHA
- docker rm lint-$CI_COMMIT_SHA
tags:
- docker
artifacts:
paths:
- lcov.info
- lintReport.json

build_android:
stage: native_build
Expand All @@ -61,18 +71,36 @@ build_ios:
stage: native_build
when: manual
before_script:
- echo "$GITLAB_DEPLOY_SSH_KEY" > airgap_cordova_secure_storage_deploy
- echo "$GITLAB_DEPLOY_SSH_KEY_PUB" > airgap_cordova_secure_storage_deploy.pub
- echo "$IOS_BUILD_JSON" > build.json
- echo "$IOS_EXPORT_OPTIONS" > exportOptions.plist
script:
- sudo xcode-select -s /Applications/Xcode_9.4.app/Contents/Developer
- sed -i -e "s/ios-CFBundleVersion=\"0.0.0\"/ios-CFBundleVersion=\"1.0.$CI_PIPELINE_ID\"/g" config.xml
- sed -i -e "s/version=\"0.0.0\"/version=\"$VERSION\"/g" config.xml
- nvm use v10.13.0
- npm install
- sed -i -e "s/ios-CFBundleVersion=\"1.0.0\"/ios-CFBundleVersion=\"1.0.$CI_PIPELINE_ID\"/g" config.xml
- ionic run build --prod
- ionic cordova platform rm ios
- ionic cordova platform add ios@latest
- ionic cordova build ios --prod --release
- find ./resources/ -name "*.png" -exec convert "{}" -alpha off "{}" \;
- fastlane ios beta
- xcodebuild -workspace platforms/ios/AirGap\ Wallet.xcworkspace -scheme "AirGap Wallet" -destination generic/platform=iOS build -allowProvisioningUpdates
- xcodebuild -workspace platforms/ios/AirGap\ Wallet.xcworkspace -scheme "AirGap Wallet" -sdk iphoneos -configuration AppStoreDistribution archive -archivePath platforms/ios/AirGap\ Wallet.xcarchive
- xcodebuild -exportArchive -archivePath platforms/ios/AirGap\ Wallet.xcarchive -exportOptionsPlist exportOptions.plist -exportPath platforms/ios/
- /Applications/Xcode_9.4.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f platforms/ios/AirGap\ Wallet.ipa -u $IOS_USERNAME -p $IOS_PASSWORD
artifacts:
paths:
- app-release.ipa
- platforms/ios/AirGap\ Wallet.ipa
tags:
- ios

qa:
stage: qa
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker create --name qa-$CI_PIPELINE_ID $IMAGE_TAG_CURRENT npm run sonar-scanner -- -X -Dsonar.typescript.lcov.reportPaths=lcov.info -Dsonar.typescript.tslint.reportPaths=lintReport.json -Dsonar.test.inclusions=**/*.spec.ts -Dsonar.tests=src/ -Dsonar.exclusions=**/node_modules/**,**/*.spec.ts,src/assets/libs/** -Dsonar.sources=src/ -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID
- docker cp lcov.info qa-$CI_PIPELINE_ID:/app/lcov.info
- docker cp lintReport.json qa-$CI_PIPELINE_ID:/app/lintReport.json
- docker start -a qa-$CI_PIPELINE_ID
after_script:
- docker rm -f qa-$CI_PIPELINE_ID || true
tags:
- docker
1 change: 0 additions & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
<plugin name="com.lampa.startapp" spec="^6.1.6" />
<plugin name="cordova-plugin-qrscanner" spec="^2.6.0" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-queries-schemes" spec="git+https://github.com/rjhilgefort/cordova-plugin-queries-schemes.git" />
<plugin name="cordova-sqlite-storage" spec="^2.4.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
<plugin name="cordova-clipboard" spec="^1.2.1" />
Expand Down
Loading

0 comments on commit 0bb056a

Please sign in to comment.