Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Jun 7, 2019
1 parent 11827ca commit f7d64a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions install/buildenv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

ENV_FILE=BUILD.env

Expand Down Expand Up @@ -34,9 +35,9 @@ branch=${branch##*/}
hash=${hash:0:7}
## get IP
RE='[0-9]+\s+IN\s+A\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'
[[ `drill SimpleMailForwarder.Builder.\`hostname\` @wimi.36c33f49.svc.dockerapp.io` =~ $RE ]] \
&& SMF_BUILD_IP="${BASH_REMATCH[1]}"
# RE='[0-9]+\s+IN\s+A\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'
# [[ `drill SimpleMailForwarder.Builder.\`hostname\` @wimi.36c33f49.svc.dockerapp.io` =~ $RE ]] \
# && SMF_BUILD_IP="${BASH_REMATCH[1]}"
#
# Save to file
Expand Down
9 changes: 5 additions & 4 deletions script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# maintainer: Zhuohuan LI <[email protected]>
#
set -e

OWNER="zixia"
NAME="simple-mail-forwarder"
Expand All @@ -12,10 +13,10 @@ TAG='' && [ -n "$1" ] && TAG=":$1" && shift
BASEDIR=$(dirname $0)
ENV_FILE=$BASEDIR/../BUILD.env

RE='[0-9]+\s+IN\s+A\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'
[[ `drill SimpleMailForwarder.Builder.\`hostname\` @wimi.36c33f49.svc.dockerapp.io` =~ $RE ]] && {
SMF_BUILD_IP="${BASH_REMATCH[1]}"
}
# RE='[0-9]+\s+IN\s+A\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'
# [[ `drill SimpleMailForwarder.Builder.\`hostname\` @wimi.36c33f49.svc.dockerapp.io` =~ $RE ]] && {
# SMF_BUILD_IP="${BASH_REMATCH[1]}"
# }

cat > $ENV_FILE <<_EOF
IMAGE_NAME=$IMAGE_NAME
Expand Down

0 comments on commit f7d64a0

Please sign in to comment.