Skip to content

Commit

Permalink
Add wp-install script
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Jun 26, 2019
1 parent 25111df commit 601de3e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions hack/docker/bin/wp-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2019 Pressinfra SRL.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
set -o pipefail

title="$1"
url="$2"
user="$3"
# escape quotes
# due to: https://github.com/wp-cli/wp-cli/issues/5089
pass=$(echo $4 | sed -e "s/'/\\\'/g" -e 's/"/\\"/g')
email="$5"

wp core install \
---title="$title" \
---url="$url" \
---admin_user="$user" \
---admin_password="$pass" \
---admin_email="$email" \
---skip-email

0 comments on commit 601de3e

Please sign in to comment.