add install script (needs work)
This commit is contained in:
27
install-plugin.sh
Executable file
27
install-plugin.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
DOCKER_RUN_SCRIPT=../selig/cmbabaseball/docker-run.sh
|
||||
|
||||
# Check if the number of arguments is less than 1 (i.e., PLUGIN_NAME is not provided)
|
||||
if [ "$#" -lt 1 ]; then
|
||||
echo "Error: PLUGIN_NAME argument is missing."
|
||||
echo "Usage: $0 PLUGIN_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Assign the first argument to PLUGIN_NAME variable
|
||||
PLUGIN_NAME="$1"
|
||||
PLUGIN_ZIP_FILENAME="${PLUGIN_NAME}_$(date +"%y%m%d-%H%M%S").zip"
|
||||
TMPFILE=${TMPDIR}${PLUGIN_ZIP_FILENAME}
|
||||
|
||||
echo "Installing plugin $PLUGIN_NAME using ${DOCKER_RUN_SCRIPT} via $TMPFILE"
|
||||
|
||||
# Continue with your script...
|
||||
cd src/plugins/${PLUGIN_NAME} && zip -r ../../../dist/${PLUGIN_ZIP_FILENAME} . && cd ../../.. && \
|
||||
cp ./dist/${PLUGIN_ZIP_FILENAME} ${TMPFILE} &&
|
||||
${DOCKER_RUN_SCRIPT} \
|
||||
-v ${TMPFILE}:/${PLUGIN_ZIP_FILENAME} \
|
||||
wordpress:cli \
|
||||
wp plugin install /${PLUGIN_ZIP_FILENAME} --force --skip-plugins --activate
|
||||
|
||||
# End of the script
|
||||
|
||||
Reference in New Issue
Block a user