-
Notifications
You must be signed in to change notification settings - Fork 8
/
sed.production.sh
executable file
·45 lines (37 loc) · 2.24 KB
/
sed.production.sh
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
#!/usr/bin/env bash
# sed manual: https://www.gnu.org/software/sed/manual/sed.html
# use sed to modify files for production (cryptonomica-server)
# see:
# https://unix.stackexchange.com/questions/272061/bash-sh-script-to-replace-text-between-some-tags-strings-in-a-text-file
# https://stackoverflow.com/questions/30268770/how-to-insert-html-tag-with-sed
# escape '/' with '\'
# c is the change command in sed, it means "replace entire line(s)". You cannot simply leave the #start and #end lines untouched. If you want to keep them, you must re-insert them
gcloud config set project cryptonomica-server
# ./pom.xml : 25
sed -i '/<!-- endpoints.project.id START -->/,/<!-- endpoints.project.id END -->/c\
<!-- endpoints.project.id START -->\
<endpoints.project.id>cryptonomica-server<\/endpoints.project.id>\
<!-- endpoints.project.id END -->' ./pom.xml
sed -i '/<!-- sandbox SED_START -->/,/<!-- sandbox SED_END -->/c\
<!-- sandbox SED_START -->\
<!-- sandbox SED_END -->' ./src/main/webapp/index.html
sed -i '/static Boolean SED_START/,/static Boolean SED_END/c\
static Boolean SED_START;\
public static final Boolean PRODUCTION = Boolean.TRUE;\
public static final String WEB_CLIENT_ID = "762021407984-9ab8gugumsg30rrqgvma9htfkqd3uid5.apps.googleusercontent.com";\
public static final Integer priceForOneYerInEuroCents = 60 * 100;\
public static final Integer discountInPercentForTwoYears = 20;\
public static final String host = "cryptonomica.net";\
public static final String supportEmailAddress = "support@cryptonomica.net";\
public static final String adminEmailAddress = "admin@cryptonomica.net";\
public static final String verificationServiceEmailAddress = "verification@cryptonomica.net";\
public static final String emailSubjectPrefix = "[cryptonomica] ";\
static Boolean SED_END;' ./src/main/java/net/cryptonomica/constants/Constants.java
sed -i '/var SED_START;/,/var SED_END;/c\
var SED_START;\
$rootScope.PRODUCTION = true;\
var SED_END;' ./src/main/webapp/app/app.js
sed -i '/var SED_START;/,/var SED_END;/c\
var SED_START;\
$rootScope.PRODUCTION = true;\
var SED_END;' ./src/main/webapp/bills-of-exchange/app/app.js