deploy.sh 520 B

123456789101112131415
  1. # deploy.sh in gogits image
  2. # Script in the gogits image
  3. ## Replace the mysql password
  4. MYSQL_PASSWORD=kuajie8402
  5. MYSQL_ALIAS=DB
  6. MYSQL_PASSWORD_LINE=`awk '$0 ~ str{print NR+1}' str="USER = root" $GOPATH/src/github.com/gogits/gogs/conf/app.ini`
  7. sed -e "${MYSQL_PASSWORD_LINE}s/.*$/PASSWD = $MYSQL_PASSWORD/g" conf/app.ini
  8. ## Replace the mysql address and port
  9. # DB_PORT=tcp://172.17.0.2:3306
  10. # DB_PORT_3306_TCP_PORT=3306
  11. # DB_PORT_3306_TCP_PROTO=tcp
  12. sed -e "/HOST = 127.0.0.1:3306/c\HOST = ${MYSQLALIAS}_PORT" app.ini