From 471395fba7831257417622edb4525e291b2cc368 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Tue, 19 Dec 2023 13:05:01 -0800 Subject: [PATCH] Fixed new project scripts --- bin/generate_env.sh | 10 ++++++---- bin/inc_new_project/git_setup.sh | 9 +++++---- bin/inc_new_project/remote_git_setup.sh | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/generate_env.sh b/bin/generate_env.sh index c378629..6ba59c5 100644 --- a/bin/generate_env.sh +++ b/bin/generate_env.sh @@ -18,11 +18,11 @@ PROJECTNAME=${1:-$(prompt_for_value "Enter PROJECTNAME")} cat < $ENV_FILE # Docker -NETWORKNAME=${PROJECTNAME}_web +NETWORKNAME=admin_web # MySQL MYSQL_ROOT_PASSWORD=$(generate_password) -MYSQL_USER=u$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]') +MYSQL_USER=u_$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]') MYSQL_PASSWORD=$(generate_password) MYSQL_DATABASE=db_$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]') @@ -31,8 +31,8 @@ GITEA_API_URL=REPLACEME ACCESS_TOKEN=REPLACEME # Joomla -EMAIL=noreply@example.com -JOOMLA_USER="John Doe" +EMAIL=noreply@$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]').com +JOOMLA_USER="$PROJECTNAME" JOOMLA_USERNAME=admin # Passwords must be 12 characters long (admin-password) JOOMLA_PASSWORD=$(generate_password) @@ -45,4 +45,6 @@ SMTP_SECURITY='None' SMTP_PORT=1025 EOF +rm $0 + echo "Generated $ENV_FILE with randomly generated passwords and customized PROJECTNAME." diff --git a/bin/inc_new_project/git_setup.sh b/bin/inc_new_project/git_setup.sh index 8e712cc..ae3442f 100644 --- a/bin/inc_new_project/git_setup.sh +++ b/bin/inc_new_project/git_setup.sh @@ -1,14 +1,15 @@ #!/bin/bash +# This Bash script initializes a new Git repository, removes existing Git info, creates a README.md with the project name, and makes an initial commit. PROJECTNAME=$(basename "$(pwd)") -# Remove existing Git repository information -rm -rf .git +rm -rf .git # Remove existing Git repository information -rm README.md +# New readme for Project +rm README.md touch README.md echo "# ${PROJECTNAME}" > README.md -echo "" > README.md +echo "" >> README.md echo "Created a fresh repo for your ${PROJECTNAME} project." >> README.md # Initialize a new Git repository diff --git a/bin/inc_new_project/remote_git_setup.sh b/bin/inc_new_project/remote_git_setup.sh index 4eaaecd..b134d4e 100644 --- a/bin/inc_new_project/remote_git_setup.sh +++ b/bin/inc_new_project/remote_git_setup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Creates a private Git repository on Gitea using its API, adds a remote origin to the local Git repository, and pushes existing changes to the master branch. PROJECTNAME=$(basename "$(pwd)")