Loading .circleci/config.yml 0 → 100644 +149 −0 Original line number Diff line number Diff line version: 2 jobs: node: working_directory: ~/mobile-native docker: - image: circleci/node:10 steps: - checkout - restore_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - restore_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} - run: yarn install - save_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} paths: - ~/.cache/yarn - save_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} paths: - node_modules - run: name: jest tests command: | mkdir -p test-results/jest yarn run test --maxWorkers=2 environment: JEST_JUNIT_OUTPUT: test-results/jest/junit.xml - persist_to_workspace: root: ~/mobile-native paths: - node_modules - store_test_results: path: test-results - store_artifacts: path: test-results ios: macos: xcode: "10.1" working_directory: ~/mobile-native # use a --login shell so our "set Ruby version" command gets picked up for later steps shell: /bin/bash --login -o pipefail steps: - checkout - run: name: set Ruby version command: echo "ruby-2.4" > ~/.ruby-version - restore_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - restore_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} # not using a workspace here as Node and Yarn versions # differ between our macOS executor image and the Docker containers above - run: yarn install - save_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} paths: - ~/.cache/yarn - save_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} paths: - node_modules - restore_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - run: command: gem update --system && gem install bundler && bundle install working_directory: ios - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle ### TODO- get tests running with fastlane #- run: # command: bundle exec fastlane test # working_directory: ios #- run: # name: set up test results # working_directory: ios # when: always # command: | # mkdir -p test-results/fastlane test-results/xcode # mv fastlane/report.xml test-results/fastlane # mv fastlane/test_output/report.junit test-results/xcode/junit.xml #- store_test_results: # path: ios/test-results #- store_artifacts: # path: ios/test-results - run: name: Build release .ipa command: fastlane buildrelease working_directory: ios branches: only: - /stable-*/ - /release-*/ - test/circle-ci - run: name: Upload to crashalytics command: echo "TODO" working_directory: ios branches: only: - /release-*/ - run: name: Upload to Testflight release command: fastlane testflight working_directory: ios branches: only: - /stable-*/ - /release-*/ - test/circle-ci workflows: version: 2 node-ios: jobs: - node - ios: requires: - node .gitlab-ci.yml +55 −44 Original line number Diff line number Diff line stages: - test #- test - build - test_e2e - e2e - deploy variables: GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle # test:jest: # image: node:10.10.0 # stage: test # cache: # key: ${CI_COMMIT_REF_SLUG} # paths: # - node_modules/ # - .jest/cache/ # script: # - yarn install # - yarn test test_spec: image: node:10.10.0 stage: test cache: paths: - node_modules/ - .jest/cache/ script: - echo $CI_PROJECT_NAMESPACE - yarn install - yarn test tags: - docker build: image: reactnativecommunity/react-native-android build:android: image: circleci/android:api-28-node stage: build cache: key: ${CI_COMMIT_REF_SLUG} paths: - .gradle/wrapper - .gradle/caches - node_modules/ before_script: - echo 999999 > /proc/sys/fs/inotify/max_user_instances - echo 999999 > /proc/sys/fs/inotify/max_user_watches - echo 999999 > /proc/sys/fs/inotify/max_queued_events - echo $ANDROID_KEYSTORE | base64 --decode > android/app/minds.keystore - echo "MYAPP_RELEASE_STORE_PASSWORD=${KEYSTORE_PASSWORD}" >> ./android/gradle.properties - echo "MYAPP_RELEASE_KEY_PASSWORD=${KEYSTORE_PASSWORD}" >> ./android/gradle.properties - sudo sysctl fs.inotify.max_user_watches=524288 - sudo sysctl -p script: - yarn install - cd android && chmod +x gradlew - ./gradlew assembleRelease - cp app/build/outputs/apk/release/app-release.apk ../Minds.apk - cd android - bundle install - fastlane assemble_build - cp app/build/outputs/apk/release/app-release.apk ../Minds-$CI_BUILD_REF_SLUG.apk artifacts: name: "Minds APK" paths: - Minds.apk - Minds-$CI_BUILD_REF_SLUG.apk expire_in: 7 days when: on_success only: variables: - $CI_PROJECT_NAMESPACE == "minds" test_e2e: e2e:browserstacks: image: node:10.10.0 stage: test_e2e stage: e2e cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - export bsAPP=`curl -u "${bsUSER}:${bsKEY}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./Minds.apk"| grep -o 'bs\:\/\/.*"' | sed 's/.$//'` - export bsAPP=`curl -u "${bsUSER}:${bsKEY}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./Minds-$CI_BUILD_REF_SLUG.apk"| grep -o 'bs\:\/\/.*"' | sed 's/.$//'` - yarn e2e tags: - docker dependencies: - build - build:android only: refs: - stable/* - release/* - feat/* allow_failure: true deploy:s3: image: minds/ci:latest stage: deploy script: - echo "Upload Minds-$CI_BUILD_REF_SLUG.apk" dependencies: - build:android only: refs: - release/* deploy:google_play: image: minds/ci:latest stage: deploy script: - echo "Upload Minds-$CI_BUILD_REF_SLUG.apk" dependencies: - build:android only: variables: - $CI_PROJECT_NAMESPACE == "minds" refs: - stable/* App-test.js 0 → 100644 +74 −0 Original line number Diff line number Diff line //import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' import './global'; import './shim' //import crypto from "crypto"; // DO NOT REMOVE! import React, { Component } from 'react'; import { createStackNavigator, NavigationActions } from 'react-navigation'; import { BackHandler, Platform, AppState, Linking, Text, Alert, View, } from 'react-native'; import NavigationStack from './src/navigation/NavigationStack'; import NavigationService from './src/navigation/NavigationService'; const Stack = createStackNavigator({}); /** * App */ export default class App extends Component { constructor(props) { super(props); this.state = { appState: AppState.currentState }; } /** * Handle app state changes */ handleAppStateChange = (nextState) => { // if the app turns active we check for shared if (this.state.appState.match(/inactive|background/) && nextState === 'active') { receiveShare.handle(); } this.setState({appState: nextState}) } /** * On component will mount */ componentWillMount() { if (!Text.defaultProps) Text.defaultProps = {}; Text.defaultProps.style = { fontFamily: 'Roboto', color: '#444', }; } /** * Render */ render() { const app = ( <View></View> ); return [ app ]; } } README.md +24 −1 Original line number Diff line number Diff line # Minds Mobile Apps ## Branch Structure | Branch | | |-----------|------------------------------------------------------------------------------------------------------------------------------------| | master | Approved code ready to merged into the next stable release. All tests should pass and be in a 'ready' state | | stable/* | Stable builds, inherited from `release/*` branches. Fastlane automatically deploys these builds. | | release/* | WIP builds. Run `fastlane run increment_version_number` upon creating the branch. | | feat/* | New branches should be made for each Gitlab issue. Merge requests should be opened pointing towards the respective release branch. | ## Increasing the version number ### Patch `fastlane run increment_version_number bump_type:patch` ### Minor `fastlane run increment_version_number bump_type:minor` ### Major `fastlane run increment_version_number bump_type:major` ## Platforms - iOS Loading android/.gitignore 0 → 100644 +14 −0 Original line number Diff line number Diff line # fastlane specific fastlane/report.xml # deliver temporary files fastlane/Preview.html # snapshot generated screenshots fastlane/screenshots # scan temporary files fastlane/test_output # Fastlane builds builds/* Loading
.circleci/config.yml 0 → 100644 +149 −0 Original line number Diff line number Diff line version: 2 jobs: node: working_directory: ~/mobile-native docker: - image: circleci/node:10 steps: - checkout - restore_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - restore_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} - run: yarn install - save_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} paths: - ~/.cache/yarn - save_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} paths: - node_modules - run: name: jest tests command: | mkdir -p test-results/jest yarn run test --maxWorkers=2 environment: JEST_JUNIT_OUTPUT: test-results/jest/junit.xml - persist_to_workspace: root: ~/mobile-native paths: - node_modules - store_test_results: path: test-results - store_artifacts: path: test-results ios: macos: xcode: "10.1" working_directory: ~/mobile-native # use a --login shell so our "set Ruby version" command gets picked up for later steps shell: /bin/bash --login -o pipefail steps: - checkout - run: name: set Ruby version command: echo "ruby-2.4" > ~/.ruby-version - restore_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} - restore_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} # not using a workspace here as Node and Yarn versions # differ between our macOS executor image and the Docker containers above - run: yarn install - save_cache: key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} paths: - ~/.cache/yarn - save_cache: key: node-v1-{{ checksum "package.json" }}-{{ arch }} paths: - node_modules - restore_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} - run: command: gem update --system && gem install bundler && bundle install working_directory: ios - save_cache: key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }} paths: - vendor/bundle ### TODO- get tests running with fastlane #- run: # command: bundle exec fastlane test # working_directory: ios #- run: # name: set up test results # working_directory: ios # when: always # command: | # mkdir -p test-results/fastlane test-results/xcode # mv fastlane/report.xml test-results/fastlane # mv fastlane/test_output/report.junit test-results/xcode/junit.xml #- store_test_results: # path: ios/test-results #- store_artifacts: # path: ios/test-results - run: name: Build release .ipa command: fastlane buildrelease working_directory: ios branches: only: - /stable-*/ - /release-*/ - test/circle-ci - run: name: Upload to crashalytics command: echo "TODO" working_directory: ios branches: only: - /release-*/ - run: name: Upload to Testflight release command: fastlane testflight working_directory: ios branches: only: - /stable-*/ - /release-*/ - test/circle-ci workflows: version: 2 node-ios: jobs: - node - ios: requires: - node
.gitlab-ci.yml +55 −44 Original line number Diff line number Diff line stages: - test #- test - build - test_e2e - e2e - deploy variables: GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle # test:jest: # image: node:10.10.0 # stage: test # cache: # key: ${CI_COMMIT_REF_SLUG} # paths: # - node_modules/ # - .jest/cache/ # script: # - yarn install # - yarn test test_spec: image: node:10.10.0 stage: test cache: paths: - node_modules/ - .jest/cache/ script: - echo $CI_PROJECT_NAMESPACE - yarn install - yarn test tags: - docker build: image: reactnativecommunity/react-native-android build:android: image: circleci/android:api-28-node stage: build cache: key: ${CI_COMMIT_REF_SLUG} paths: - .gradle/wrapper - .gradle/caches - node_modules/ before_script: - echo 999999 > /proc/sys/fs/inotify/max_user_instances - echo 999999 > /proc/sys/fs/inotify/max_user_watches - echo 999999 > /proc/sys/fs/inotify/max_queued_events - echo $ANDROID_KEYSTORE | base64 --decode > android/app/minds.keystore - echo "MYAPP_RELEASE_STORE_PASSWORD=${KEYSTORE_PASSWORD}" >> ./android/gradle.properties - echo "MYAPP_RELEASE_KEY_PASSWORD=${KEYSTORE_PASSWORD}" >> ./android/gradle.properties - sudo sysctl fs.inotify.max_user_watches=524288 - sudo sysctl -p script: - yarn install - cd android && chmod +x gradlew - ./gradlew assembleRelease - cp app/build/outputs/apk/release/app-release.apk ../Minds.apk - cd android - bundle install - fastlane assemble_build - cp app/build/outputs/apk/release/app-release.apk ../Minds-$CI_BUILD_REF_SLUG.apk artifacts: name: "Minds APK" paths: - Minds.apk - Minds-$CI_BUILD_REF_SLUG.apk expire_in: 7 days when: on_success only: variables: - $CI_PROJECT_NAMESPACE == "minds" test_e2e: e2e:browserstacks: image: node:10.10.0 stage: test_e2e stage: e2e cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - export bsAPP=`curl -u "${bsUSER}:${bsKEY}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./Minds.apk"| grep -o 'bs\:\/\/.*"' | sed 's/.$//'` - export bsAPP=`curl -u "${bsUSER}:${bsKEY}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./Minds-$CI_BUILD_REF_SLUG.apk"| grep -o 'bs\:\/\/.*"' | sed 's/.$//'` - yarn e2e tags: - docker dependencies: - build - build:android only: refs: - stable/* - release/* - feat/* allow_failure: true deploy:s3: image: minds/ci:latest stage: deploy script: - echo "Upload Minds-$CI_BUILD_REF_SLUG.apk" dependencies: - build:android only: refs: - release/* deploy:google_play: image: minds/ci:latest stage: deploy script: - echo "Upload Minds-$CI_BUILD_REF_SLUG.apk" dependencies: - build:android only: variables: - $CI_PROJECT_NAMESPACE == "minds" refs: - stable/*
App-test.js 0 → 100644 +74 −0 Original line number Diff line number Diff line //import 'abortcontroller-polyfill/dist/polyfill-patch-fetch' import './global'; import './shim' //import crypto from "crypto"; // DO NOT REMOVE! import React, { Component } from 'react'; import { createStackNavigator, NavigationActions } from 'react-navigation'; import { BackHandler, Platform, AppState, Linking, Text, Alert, View, } from 'react-native'; import NavigationStack from './src/navigation/NavigationStack'; import NavigationService from './src/navigation/NavigationService'; const Stack = createStackNavigator({}); /** * App */ export default class App extends Component { constructor(props) { super(props); this.state = { appState: AppState.currentState }; } /** * Handle app state changes */ handleAppStateChange = (nextState) => { // if the app turns active we check for shared if (this.state.appState.match(/inactive|background/) && nextState === 'active') { receiveShare.handle(); } this.setState({appState: nextState}) } /** * On component will mount */ componentWillMount() { if (!Text.defaultProps) Text.defaultProps = {}; Text.defaultProps.style = { fontFamily: 'Roboto', color: '#444', }; } /** * Render */ render() { const app = ( <View></View> ); return [ app ]; } }
README.md +24 −1 Original line number Diff line number Diff line # Minds Mobile Apps ## Branch Structure | Branch | | |-----------|------------------------------------------------------------------------------------------------------------------------------------| | master | Approved code ready to merged into the next stable release. All tests should pass and be in a 'ready' state | | stable/* | Stable builds, inherited from `release/*` branches. Fastlane automatically deploys these builds. | | release/* | WIP builds. Run `fastlane run increment_version_number` upon creating the branch. | | feat/* | New branches should be made for each Gitlab issue. Merge requests should be opened pointing towards the respective release branch. | ## Increasing the version number ### Patch `fastlane run increment_version_number bump_type:patch` ### Minor `fastlane run increment_version_number bump_type:minor` ### Major `fastlane run increment_version_number bump_type:major` ## Platforms - iOS Loading
android/.gitignore 0 → 100644 +14 −0 Original line number Diff line number Diff line # fastlane specific fastlane/report.xml # deliver temporary files fastlane/Preview.html # snapshot generated screenshots fastlane/screenshots # scan temporary files fastlane/test_output # Fastlane builds builds/*