Skip to content

Commit

Permalink
Merge pull request #860 from crossroads/master
Browse files Browse the repository at this point in the history
September Live Release #1
  • Loading branch information
abulsayyad123 authored Sep 4, 2020
2 parents 6032b9e + c48c141 commit 7cf18df
Show file tree
Hide file tree
Showing 120 changed files with 6,345 additions and 2,099 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
aliases:
- defaults: &defaults
docker:
- image: circleci/node:8.15
- image: circleci/node:10.22
working_directory: ~/code
- &restore-repo-cache
key: v1-stock-goodcity-{{ .Environment.CIRCLE_SHA1 }}
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
test_cases:
<<: *defaults
docker:
- image: circleci/node:8.15-browsers
- image: circleci/node:10.22-browsers
environment:
JOBS: 1
steps:
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
exit 1
esac
echo "Building for ENVIRONMENT: ${ENVIRONMENT}"
EMBER_CLI_CORDOVA=1 ENVIRONMENT=${ENVIRONMENT} yarn run ember build --environment=production
EMBER_CLI_CORDOVA=1 SCANDIT_LICENSE_KEY=${SCANDIT_LICENSE_KEY_ANDROID} ENVIRONMENT=${ENVIRONMENT} yarn run ember build --environment=production
- run: mv dist/ cordova/www
- persist_to_workspace:
root: .
Expand All @@ -234,7 +234,7 @@ jobs:
android_build_and_deploy:
<<: *defaults
docker:
- image: circleci/android:api-26-node8-alpha
- image: circleci/android:api-29-node@sha256:f57cbd442b1d90d01a672e87fa9c516a71312376641d70aee67736e78cb9645f
environment:
JVM_OPTS: -Xmx3200m
KEYSTORE: goodcity.keystore
Expand Down Expand Up @@ -302,15 +302,15 @@ jobs:
steps:
- checkout
- run:
name: install node@8.15.0
name: install node@10.22.0
command: |
set +e
touch $BASH_ENV
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
echo nvm install 8.15.0 >> $BASH_ENV
echo nvm alias default 8.15.0 >> $BASH_ENV
echo nvm install 10.22.0 >> $BASH_ENV
echo nvm alias default 10.22.0 >> $BASH_ENV
- run:
name: verify node version
command: node --version
Expand Down Expand Up @@ -349,7 +349,7 @@ jobs:
name: Ember build
command: |
echo "Building for ENVIRONMENT: ${ENVIRONMENT}"
EMBER_CLI_CORDOVA=1 ENVIRONMENT=${ENVIRONMENT} yarn run ember build --environment=production
EMBER_CLI_CORDOVA=1 SCANDIT_LICENSE_KEY=${SCANDIT_LICENSE_KEY_IOS} ENVIRONMENT=${ENVIRONMENT} yarn run ember build --environment=production
- run: mv dist/ cordova/www
- persist_to_workspace:
root: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: 12.x
- name: Generate and email notes
run: npx @goodcity/release-notes --email-to "prabier@crossroads.org.hk,swkenworthy@crossroads.org.hk,mdgow@crossroads.org.hk" --head ${{github.event.pull_request.head.sha}} --base ${{github.event.pull_request.base.sha}} --email-subject "🚀 Stock Release 🚀"
run: npx @goodcity/release-notes --unshallow --email-to "prabier@crossroads.org.hk,swkenworthy@crossroads.org.hk,mdgow@crossroads.org.hk" --head ${{github.event.pull_request.head.sha}} --base ${{github.event.pull_request.base.sha}} --email-subject "🚀 Stock Release 🚀"
env:
JIRA_USERNAME: ${{secrets.jira_username}}
JIRA_PASSWORD: ${{secrets.jira_password}}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.17.0
10.22.0
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ gem "rake"
gem "fastlane", ">= 2.127.2"
gem "cocoapods"
gem 'plist'
gem 'nokogiri'
93 changes: 47 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.0.3)
aws-partitions (1.295.0)
aws-sdk-core (3.93.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-eventstream (1.1.0)
aws-partitions (1.355.0)
aws-sdk-core (3.104.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.30.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sdk-kms (1.36.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.61.2)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-s3 (1.78.0)
aws-sdk-core (~> 3, >= 3.104.3)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.1)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
capistrano (3.4.0)
i18n
Expand Down Expand Up @@ -70,50 +70,48 @@ GEM
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.1.5)
declarative (0.0.10)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.5.1)
digest-crc (0.6.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.5)
emoji_regex (1.0.1)
dotenv (2.7.6)
emoji_regex (3.0.0)
escape (0.0.4)
excon (0.73.0)
faraday (0.17.3)
excon (0.76.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.7)
fastlane (2.145.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.0)
fastlane (2.156.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.2, < 2.0.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 0.17)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.13.1)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.29.2, < 0.37.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (~> 2.1.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.3.0, < 2.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
Expand All @@ -128,7 +126,7 @@ GEM
fourflusher (2.2.0)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-api-client (0.36.4)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
Expand All @@ -139,50 +137,52 @@ GEM
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.1)
google-cloud-env (1.3.3)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.0)
google-cloud-storage (1.26.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.27.0)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.11.0)
googleauth (0.13.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.12)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jmespath (1.4.0)
json (2.3.0)
jwt (2.1.0)
json (2.3.1)
jwt (2.2.1)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
molinillo (0.6.6)
multi_json (1.14.1)
multi_xml (0.6.0)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (5.2.0)
netrc (0.11.0)
os (1.1.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
os (1.1.1)
plist (3.5.0)
public_suffix (2.0.5)
public_suffix (4.0.5)
rake (12.3.3)
representable (3.0.4)
declarative (< 0.1.0)
Expand All @@ -191,7 +191,7 @@ GEM
retriable (3.1.2)
rouge (2.0.7)
ruby-macho (1.4.0)
rubyzip (1.3.0)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
Expand All @@ -210,7 +210,7 @@ GEM
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-cursor (0.7.1)
tty-screen (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
tzinfo (1.2.5)
Expand All @@ -221,12 +221,12 @@ GEM
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.15.0)
xcodeproj (1.18.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
Expand All @@ -239,6 +239,7 @@ DEPENDENCIES
capistrano (= 3.4.0)
cocoapods
fastlane (>= 2.127.2)
nokogiri
plist
rake

Expand Down
37 changes: 31 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ require "json"
require "fileutils"
require "rake/clean"
require 'plist'
require 'nokogiri'

ROOT_PATH = File.dirname(__FILE__)
CORDOVA_PATH = "#{ROOT_PATH}/cordova".freeze
CONFIG_XML_PATH = "#{CORDOVA_PATH}/config.xml".freeze
CLEAN.include("dist", "cordova/www", "#{CORDOVA_PATH}/platforms/android/build",
"#{CORDOVA_PATH}/platforms/ios/build")
CLOBBER.include('cordova/platforms', 'cordova/plugins')
Expand All @@ -43,6 +45,28 @@ TESTFAIRY_PLUGIN_NAME = 'com.testfairy.cordova-plugin'.freeze
KEYSTORE_FILE = "#{CORDOVA_PATH}/goodcity.keystore".freeze
BUILD_JSON_FILE = "#{CORDOVA_PATH}/build.json".freeze

# Helper method
def add_plugin(name, version, variables = {})
xml = File.read(CONFIG_XML_PATH)
doc = Nokogiri.XML(xml)
widget = doc.at_css('widget')

plugin = Nokogiri::XML::Node.new "plugin", doc
plugin['spec'] = version
plugin['name'] = name

variables.each do |n, v|
var = Nokogiri::XML::Node.new "variable", doc
var['name'] = n
var['value'] = v
plugin.add_child(var)
end

widget.add_child(plugin)

File.write(CONFIG_XML_PATH, doc.to_xml)
end

# Default task
task default: %w[app:build]

Expand Down Expand Up @@ -76,6 +100,13 @@ namespace :cordova do
build_details.map{|key, value| log("#{key.upcase}: #{value}")}
sh %{ cd #{CORDOVA_PATH}; cordova-update-config --appname "#{app_name}" --appid #{app_id} --appversion #{app_version} }

#Temporary fix for phonegap-plugin-push
if platform == 'android'
add_plugin('phonegap-plugin-push', '2.1.2')
elsif platform == 'ios'
add_plugin('phonegap-plugin-push', '1.9.2', { SENDER_ID: 'XXXXXXX' })
end

log("Preparing app for #{platform}")
Dir.chdir(CORDOVA_PATH) do
system({"ENVIRONMENT" => environment}, "cordova prepare #{platform}")
Expand All @@ -92,12 +123,6 @@ namespace :cordova do
desc "Cordova build {platform}"
task build: :prepare do
Dir.chdir(CORDOVA_PATH) do
#Temporary fix for phonegap-plugin-push
if platform == 'android'
sh %{ cordova plugin add phonegap-plugin-push@2.1.2 }
else
sh %{ cordova plugin add phonegap-plugin-push@1.9.2 --variable SENDER_ID="XXXXXXX" }
end
build = (environment == "staging" && platform == 'android') ? "debug" : "release"
extra_params = (platform === "android") ? '' : ios_build_config
system({"ENVIRONMENT" => environment}, "cordova compile #{platform} --#{build} --device #{extra_params}")
Expand Down
4 changes: 2 additions & 2 deletions app/components/add-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default Ember.Component.extend(AsyncMixin, {

async removeRequest(reqId) {
const req = this.get("store").peekRecord("goodcity_request", reqId);
this.runTask(
await this.get("goodcityRequestService").deleteRequest(reqId)
await this.runTask(
this.get("goodcityRequestService").deleteRequest(reqId)
);
this.get("store").unloadRecord(req);
},
Expand Down
Loading

0 comments on commit 7cf18df

Please sign in to comment.