This repository has been archived by the owner on Aug 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.sh
executable file
·64 lines (51 loc) · 1.68 KB
/
build.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
set -e
cat > src/main/resources/oauth.properties << EOF
clientId=${LGTMIN_CLIENT_ID}
clientSecret=${LGTM_SECRET}
EOF
cat > src/main/resources/jwt.properties << EOF
key=${JWT_SIGNING_KEY}
EOF
cat > src/main/resources/imgur.properties << EOF
clientId=${IMGUR_CLIENT_ID}
EOF
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then
echo "Cron mode"
if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then
rm -rf $HOME/google-cloud-sdk
curl https://sdk.cloud.google.com | bash
fi
export PATH=$PATH:$HOME/google-cloud-sdk/bin
export CLOUDSDK_CORE_PROJECT=lgtmin
groovy letsencrypt.groovy
cat lgtm.in.crt lgtm.in.chain.crt > lgtm.in.combined.crt
export CERTNAME=lgtmin_$(date +"%Y%m%d")
gcloud beta app ssl-certificates create \
--display-name $CERTNAME \
--certificate lgtm.in.combined.crt \
--private-key lgtm.in.key
CERT_ID=$(gcloud beta app ssl-certificates list | grep $CERTNAME | tr -s " " | cut -d " " -f 1 | head -1)
echo $CERT_ID
gcloud beta app domain-mappings update lgtm.in --certificate-id $CERT_ID
gcloud beta app domain-mappings update www.lgtm.in --certificate-id $CERT_ID
rm -f rm *.key *.csr *.crt
else
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
if [ "$TRAVIS_BRANCH" = "master" ]; then
openssl aes-256-cbc \
-K $encrypted_e5eaaca705ea_key \
-iv $encrypted_e5eaaca705ea_iv \
-in .appcfg_oauth2_tokens_java.enc \
-out .appcfg_oauth2_tokens_java \
-d
cat .appcfg_oauth2_tokens_java | sed -e "s/rahul/$(whoami)/g" > $HOME/.appcfg_oauth2_tokens_java
./gradlew check
./gradlew appengineUpdateAll
else
./gradlew check
fi
else
./gradlew check
fi
fi