This commit is contained in:
Ray Elliott 2020-05-06 16:12:41 +01:00
parent 1deffe0dc9
commit efa14f496f
8 changed files with 30 additions and 17 deletions

View File

@ -6,6 +6,7 @@ TODO
* have wp-dev command that takes a command as an argument (e.g., create,
publish, etc)
-- make sure we cd into the correct directory first
* Script to export database from production database
* Script to export wordpress directory from production

View File

@ -1,8 +1,10 @@
#!/bin/sh
. ./load-config.sh
. /home/ray/Projects/wordpress-dev/load-config.sh
./dev/container-create.sh
cd /home/ray/Projects/wordpress-dev
# ./dev/container-create.sh
_url="$_local_hostname.$_local_domain"
cat config dev/dev-env-setup.sh | ssh root@"$_url" 'cat >/tmp/deploy-script.sh'

View File

@ -13,7 +13,7 @@ _ssh_cmd_www_cd="$_ssh_cmd_www cd /var/www/html/wordpress &&"
_wp_url="http://$_host"
printf "\nInstalling requirements ..."
$_ssh_cmd_root 'apt-get update && apt-get -y upgrade && apt-get -y install apache2 mariadb-server php php-common libapache2-mod-php python-mysqldb php-gd php-ssh2 php-mysql php-dom php-simplexml php-xml php-xmlreader php-curl php-ftp php-iconv php-imagick php-mbstring php-posix php-sockets php-tokenizer php-zip'
$_ssh_cmd_root 'apt-get update && apt-get -y upgrade && apt-get -y install apache2 mariadb-server php php-common libapache2-mod-php python-mysqldb php-gd php-ssh2 php-mysql php-dom php-simplexml php-xml php-xmlreader php-curl php-ftp php-iconv php-imagick php-mbstring php-posix php-sockets php-tokenizer php-zip curl gnupg2'
printf "\nConfiguring Apache ..."
scp ./dev/config/000-default.conf "$_scp_to":/etc/apache2/sites-enabled/000-default.conf

View File

@ -6,6 +6,8 @@ _config_dir="$_home_dir/.config"
mkdir -p "$_config_dir"
chown "$_user_www": "$_config_dir"
apt-get update && apt-get -y install curl gnupg2 zsh tmux ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip tig fzf
echo "installing lf ..."
_download_url="https://github.com/gokcehan/lf/releases/download/$_lf_version/lf-linux-amd64.tar.gz"
wget "$_download_url" -O /tmp/lf.tar.gz
@ -14,13 +16,20 @@ git clone 'https://git.rayelliott.dev/dots/lf.git' "$_config_dir/lf"
cd /tmp
rm -Rf /tmp/*
wget https://nodejs.org/dist/"$_node_version"/node-"$_node_version"-"$_node_distro".tar.xz
mkdir -p /usr/local/lib/nodejs
tar -xJvf node-"$_node_version"-"$_node_distro".tar.xz -C /usr/local/lib/nodejs
echo "PATH=/usr/local/lib/nodejs/node-$_node_version-$_node_distro/bin:$PATH" >> "$_home_dir"/.profile
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get -y install yarn curl zsh tmux ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip tig fzf
echo "PATH=/usr/local/lib/nodejs/node-$_node_version-$_node_distro/bin:$PATH" > "$_home_dir"/.profile
. "$_home_dir"/.profile
# yarn not installing due to public key unavailable error - install npm
# temporqarily
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
# echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list
# apt-get update && apt-get -y install yarn
curl -L https://www.npmjs.com/install.sh | sh
git clone https://github.com/neovim/neovim
@ -33,7 +42,8 @@ mv /tmp/neovim/runtime /usr/local/share/nvim/runtime
cd "$_home_dir"
su "$_user_www" -c "git clone https://git.rayelliott.dev/dots/nvim.git $_config_dir/nvim"
su "$_user_www" --login -c 'yarn global add neovim'
# su "$_user_www" --login -c 'yarn global add neovim'
su "$_user_www" --login -c 'npm install -g neovim'
su "$_user_www" --login -c 'python2 -m pip install --user --upgrade pynvim'
su "$_user_www" --login -c 'python3 -m pip install --user --upgrade pynvim'
su "$_user_www" --login -c "curl -fLo $_home_dir/nvim/autoload/plug.vim --create-dirs \

View File

@ -1,6 +1,6 @@
#!/bin/sh
. ./load-config.sh
. /home/ray/Projects/wordpress-dev/load-config.sh
_username="$_user_www"
_url="$_local_hostname.$_local_domain"

View File

@ -1,14 +1,14 @@
#!/bin/sh
_file="$1"
_file="$(pwd)/$1"
if [ -z "$_file" ] ; then
if [ ! -f "$_file" ] ; then
if [ -f "$(pwd)/wp-dev-config" ] ; then
_file="wp-dev-config"
_file="$(pwd)/wp-dev-config"
else
echo "Must supply configuration file as an argument."
echo "No configuration file supplied and no default ('wp-dev-config') found."
exit 1
fi
fi
. "$(pwd)/$_file"
. "$_file"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. ./load-config.sh
. /home/ray/Projects/wordpress-dev/load-config.sh
./dev/export-data.sh

View File

@ -1,6 +1,6 @@
#!/bin/sh
. ./load-config.sh
. /home/ray/Projects/wordpress-dev/load-config.sh
_ssh_url="root@$_remote_host.$_domain"