forked from kickstarter/android-oss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (59 loc) · 3.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
BRANCH ?= master
COMMIT ?= $(CIRCLE_SHA1)
bootstrap: dependencies secrets
./script/bootstrap
bootstrap-circle: dependencies secrets
./script/bootstrap_configs
dependencies: submodules secrets
submodules:
git submodule sync --recursive
git submodule update --init --recursive || true
git submodule foreach git checkout $(sha1)
secrets:
# Copy java secrets over. Fallback to example secrets if they don't exist.
-@rm -rf vendor/native-secrets
-@git clone [email protected]:kickstarter/native-secrets.git vendor/native-secrets 2>/dev/null || echo '(Skipping secrets.)'
cp vendor/native-secrets/android/Secrets.java app/src/main/java/com/kickstarter/libs/utils/Secrets.java \
|| cp app/src/main/java/com/kickstarter/libs/utils/Secrets.java.example app/src/main/java/com/kickstarter/libs/utils/Secrets.java
cp vendor/native-secrets/ruby/secrets.rb lib/milkrun/secrets.rb || true
cp vendor/native-secrets/fonts/ss-kickstarter.otf app/src/main/assets/fonts/ss-kickstarter.otf || true
# Copy kola configs over. Fallback to examples if they don't exist.
mkdir -p app/src/debug/res/values/
mkdir -p app/src/main/res/values/
cp vendor/native-secrets/android/koala_endpoint_debug.xml app/src/debug/res/values/koala_endpoint.xml \
|| cp config/koala_endpoint.xml.example app/src/debug/res/values/koala_endpoint.xml
cp vendor/native-secrets/android/koala_endpoint.xml app/src/main/res/values/koala_endpoint.xml \
|| cp config/koala_endpoint.xml.example app/src/main/res/values/koala_endpoint.xml
# Copy crashlytics over. Fallback to examples if they don't exist
cp vendor/native-secrets/android/fabric.properties app/fabric.properties || cp config/fabric.properties.example app/fabric.properties
# Copy slack_webhook over.
cp vendor/native-secrets/android/slack.properties app/slack.properties || true
# Copy web client over.
cp -rf vendor/native-secrets/android/WebViewJavascriptInterface.java app/src/main/java/com/kickstarter/libs/WebViewJavascriptInterface.java \
|| cp -rf config/WebViewJavascriptInterface.java app/src/main/java/com/kickstarter/libs/WebViewJavascriptInterface.java
cp -rf vendor/native-secrets/android/KSWebViewClient.java app/src/main/java/com/kickstarter/services/KSWebViewClient.java \
|| cp -rf config/KSWebViewClient.java app/src/main/java/com/kickstarter/services/KSWebViewClient.java
mkdir -p app/src/main/assets/www/
cp vendor/native-secrets/android/WebViewJavascript.html app/src/main/assets/www/WebViewJavascript.html || true
.PHONY: bootstrap bootstrap-circle dependencies secrets
sync_oss_to_private:
@echo "Syncing oss to private..."
@git checkout oss $(BRANCH)
@git pull oss $(BRANCH)
@git push private $(BRANCH)
@echo "private and oss remotes are now synced!"
sync_private_to_oss:
@echo "Syncing private to oss..."
@git checkout private $(BRANCH)
@git pull private $(BRANCH)
@git push oss $(BRANCH)
@echo "private and oss remotes are now synced!"
alpha:
@echo "Adding remotes..."
@git remote add oss https://github.com/kickstarter/android-oss
@git remote add private https://github.com/kickstarter/android-private
@echo "Deploying private/alpha-$(COMMIT)..."
@git branch -f alpha
@git push -f private alpha
@git branch -d alpha
@echo "Deploy has been kicked off to CircleCI!"