Skip to content

Commit

Permalink
refactor: Refactor the banner to a separate banner_message.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Feb 14, 2023
1 parent a204a84 commit 6c27924
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .docker-config/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN chmod a+x run_queue.sh \
chown -R www-data:www-data /var/www/project
COPY ./composer_install.sh .
RUN chmod a+x composer_install.sh
COPY ./banner_message.sh .
RUN chmod a+x banner_message.sh

WORKDIR /var/www/project

Expand Down
22 changes: 22 additions & 0 deletions .docker-config/php/banner_message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Banner Message shell script
#
# Display a banner message to let the user know the environment is ready for use
#
# @author nystudio107
# @copyright Copyright (c) 2023 nystudio107
# @link https://nystudio107.com/
# @license MIT

# Rewrite the PRIMARY_SITE_URL env var if we're running in Codespaces
if [[ ! ${CODESPACES:-"unset"} == "unset" ]]; then
export PRIMARY_SITE_URL="https://${CODESPACE_NAME}-${DEV_SERVER_PORT}.preview.app.github.dev/"
fi
# Banner message
sleep 1
echo "### Your Craft site is ready!"
echo "Frontend URL: ${PRIMARY_SITE_URL}"
echo "CP URL: ${PRIMARY_SITE_URL}admin"
echo "CP User: ${CRAFT_CP_USER}"
echo "CP Password: ${CRAFT_CP_PASSWORD}"

0 comments on commit 6c27924

Please sign in to comment.