Skip to content

Commit

Permalink
add sed site front url
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcoz committed Mar 1, 2022
1 parent a3c963d commit 8e4a5d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ inputs:
required: true
SITE_BACK_DOMAIN:
required: false
SITE_FRONT_DOMAIN:
required: false


runs:
Expand Down Expand Up @@ -119,6 +121,7 @@ runs:
#PREFIX_NAME=${{ inputs.PREFIX_NAME }}
#NAMESPACE=${{ inputs.NAMESPACE }}
SITE_BACK_URL="https://${{ inputs.SITE_BACK_DOMAIN }}"
SITE_FRONT_URL="https://${{ inputs.SITE_FRONT_DOMAIN }}"
# import database
if [ "${{ inputs.PREFIX_NAME }}" == "main" ]; then
Expand All @@ -127,7 +130,7 @@ runs:
else
echo "always re-import database"
echo "some tables are excluded for ci/cd performance"
zcat latest.sql.gz | egrep -v 'INSERT INTO `(wp_matomo_(log|archive)|wp_redirection_404)' | sed -e "s#http://localhost:8080#$SITE_BACK_URL#g" | mysql $MYSQL_OPTIONS $DB_NAME
zcat latest.sql.gz | egrep -v 'INSERT INTO `(wp_matomo_(log|archive)|wp_redirection_404)' | sed -e "s#http://localhost:8080#$SITE_BACK_URL#g" -e "s#http://localhost:3000#$SITE_FRONT_URL#g" | mysql $MYSQL_OPTIONS $DB_NAME
fi
fi
Expand Down

0 comments on commit 8e4a5d2

Please sign in to comment.