Skip to content

Commit

Permalink
Make bash history persist in web and db containers, for ddev#926
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Jul 9, 2019
1 parent 122f608 commit 3b6bf36
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions containers/ddev-dbserver/10.1/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ fi
# And use the mariadb version we have here.
echo $my_mariadb_version >/var/lib/mysql/db_mariadb_version.txt

cp -r /home/{.my.cnf,.bashrc} ~/
sudo mkdir -p /mnt/ddev-global-cache/bashhistory/${HOSTNAME}
sudo chown -R "$(id -u):$(id -g)" /mnt/ddev-global-cache/ ~/.my.cnf

echo
echo 'MySQL init process done. Ready for start up.'
echo
Expand Down
4 changes: 4 additions & 0 deletions containers/ddev-dbserver/10.1/files/home/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export HISTFILE=/mnt/ddev-global-cache/bashhistory/${HOSTNAME}/bash_history
export HISTSIZE=10000
export HISTFILESIZE=100000
4 changes: 4 additions & 0 deletions containers/ddev-dbserver/10.2/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ fi
# And use the mariadb version we have here.
echo $my_mariadb_version >/var/lib/mysql/db_mariadb_version.txt

cp -r /home/{.my.cnf,.bashrc} ~/
sudo mkdir -p /mnt/ddev-global-cache/bashhistory/${HOSTNAME}
sudo chown -R "$(id -u):$(id -g)" /mnt/ddev-global-cache/ ~/.my.cnf

echo
echo 'MySQL init process done. Ready for start up.'
echo
Expand Down
4 changes: 4 additions & 0 deletions containers/ddev-dbserver/10.2/files/home/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export HISTFILE=/mnt/ddev-global-cache/bashhistory/${HOSTNAME}/bash_history
export HISTSIZE=10000
export HISTFILESIZE=100000
4 changes: 4 additions & 0 deletions containers/ddev-webserver/files/home/.bashrc
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export PATH="$HOME/.composer/vendor/bin:$PATH"

export HISTFILE=/mnt/ddev-global-cache/bashhistory/${HOSTNAME}/bash_history
export HISTSIZE=10000
export HISTFILESIZE=100000
3 changes: 2 additions & 1 deletion containers/ddev-webserver/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ fi

ls /var/www/html >/dev/null || (echo "/var/www/html does not seem to be healthy/mounted; docker may not be mounting it., exiting" && exit 101)

cp -r /home/{.ssh*,.drush,.gitconfig,.my.cnf} ~/
cp -r /home/{.ssh*,.drush,.gitconfig,.my.cnf,.bashrc} ~/
sudo mkdir -p /mnt/ddev-global-cache/bashhistory/${HOSTNAME}
sudo chown -R "$(id -u):$(id -g)" /mnt/ddev-global-cache/ ~/.ssh* ~/.drush ~/.gitconfig ~/.my.cnf

mkcert -install
Expand Down

0 comments on commit 3b6bf36

Please sign in to comment.