Skip to content

Commit

Permalink
Merge pull request e-mission#640 from e-mission/ci_for_serve_install
Browse files Browse the repository at this point in the history
Ci for serve install
  • Loading branch information
shankari authored Apr 18, 2020
2 parents 605b8ca + 21a44ff commit 8c3f6ee
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 2,524 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/serve-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This is a basic workflow to help you get started with Actions

name: osx-serve-install

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '5 4 * * 0'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Print the xcode path
run: xcode-select --print-path

- name: Print the xcode setup
run: xcodebuild -version -sdk

- name: Print applications through dmg
run: ls /Applications

- name: Print applications through brew
run: brew list

- name: Setup the serve environment
shell: bash -l {0}
run: |
source setup/setup_serve.sh
npx cordova -version
npx ionic --version
# TODO: figure out how to check that a server started correctly
# - name: Try starting it
# run: npx run serve

113 changes: 28 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,94 +12,26 @@ https://github.com/e-mission/e-mission-docs/tree/master/docs/e-mission-phone

Updating the UI only
---
If you want to make only UI changes, (as opposed to modifying the existing plugins, adding new plugins, etc), you can use the **new and improved** (as of June 2018) e-mission dev app.

### Dependencies
1. node.js: You probably want to install this using [nvm](https://github.com/creationix/nvm), to ensure that you can pick a particular [version of node](https://github.com/creationix/nvm#usage).
```
$ node -v
v9.4.0
$ npm -v
6.0.0
```
Make sure that the permissions are set correctly - npm and node need to be owned by `root` or another admin user.
```
$ which npm
/usr/local/bin/npm
$ ls -al /usr/local/bin/npm
lrwxr-xr-x 1 root wheel 38 May 8 10:04 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
$ ls -al /usr/local/lib/node_modules/npm/bin/npm-cli.js
-rwxr-xr-x 1 cusgadmin staff 4295 Oct 26 1985 /usr/local/lib/node_modules/npm/bin/npm-cli.js
```
2. [bower](https://bower.io/):
[![osx-serve-install](https://github.com/e-mission/e-mission-phone/workflows/osx-serve-install/badge.svg)](https://github.com/e-mission/e-mission-phone/actions?query=workflow%3Aosx-serve-install)

```
$ bower -v
1.8.4
```
### Installation
1. Install the most recent release of the em-devapp (https://github.com/e-mission/e-mission-devapp)
1. Get the current version of the phone UI code
1. Fork this repo using the github UI
1. Clone your fork
```
$ git clone <your repo URL>
```
```
$ cd e-mission-phone
```
1. Create a remote to pull updates from upstream
```
$ git remote add upstream https://github.com/e-mission/e-mission-phone.git
```
1. Setup the config
```
$ ./bin/configure_xml_and_json.js serve
```
If you want to make only UI changes, (as opposed to modifying the existing plugins, adding new plugins, etc), you can use the **new and improved** (as of June 2018) e-mission dev app.

1. Install all required node modules
### Installing

```
$ npm install
```
1. Install javascript dependencies
```
$ bower install
```
1. Configure values if necessary - e.g.
Run the setup script

```
$ ls www/json/*.sample
$ cp www/json/startupConfig.json.sample www/json/startupConfig.json
$ cp ..... www/json/connectionConfig.json
```
1. Run the setup script
```
$ source setup/setup_serve.sh
```

```
$ npm run setup-serve
> edu.berkeley.eecs.emission@2.5.0 setup /private/tmp/e-mission-phone
> ./bin/download_settings_controls.js
**(optional)** Configure by changing the files in `www/json`.
Defaults are in `www/json/*.sample`

Sync collection settings updated
Data collection settings updated
Transition notify settings updated
```
```
$ ls www/json/*.sample
$ cp www/json/startupConfig.json.sample www/json/startupConfig.json
$ cp ..... www/json/connectionConfig.json
```

### Running

Expand All @@ -123,7 +55,7 @@ If you want to make only UI changes, (as opposed to modifying the existing plugi
- Safari ([enable develop menu](https://support.apple.com/guide/safari/use-the-safari-develop-menu-sfri20948/mac)): Develop -> Simulator -> index.html
- Chrome: chrome://inspect -> Remote target (emulator)
**Ta-da!** If you change any of the files in the `www` directory, the app will automatically be re-loaded without manually restarting either the server or the app.
**Ta-da!** :gift: If you change any of the files in the `www` directory, the app will automatically be re-loaded without manually restarting either the server or the app :tada:
**Note1**: You may need to scroll up, past all the warnings about `Content Security Policy has been added` to find the port that the server is listening to.
Expand Down Expand Up @@ -178,6 +110,15 @@ AND/OR
$ source setup/setup_ios_native.sh
```
**(optional)** Configure by changing the files in `www/json`.
Defaults are in `www/json/*.sample`
```
$ ls www/json/*.sample
$ cp www/json/startupConfig.json.sample www/json/startupConfig.json
$ cp ..... www/json/connectionConfig.json
```
Run in the emulator
```
Expand All @@ -198,8 +139,6 @@ Troubleshooting
- javascript errors: `rm -rf node_modules && npm install`
- native code compile errors: `rm -rf plugins && rm -rf platforms && npx cordova prepare`
Create a remote to pull updates from upstream
Beta-testing debugging
---
If users run into problems, they have the ability to email logs to the
Expand All @@ -219,6 +158,10 @@ $ less /tmp/loggerDB.<issue>.withdate.log
Contributing
---
Add the main repo as upstream
$ git remote add upstream https://github.com/covid19database/phone-app.git
Create a new branch (IMPORTANT). Please do not submit pull requests from master
$ git checkout -b mybranch
Expand Down
Loading

0 comments on commit 8c3f6ee

Please sign in to comment.