Skip to content

Commit

Permalink
update scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Sep 6, 2022
1 parent 2bccc01 commit 71a43e2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
Empty file modified build.sh
100644 → 100755
Empty file.
Empty file modified docker-build.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions docker-serve.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ if [[ "${PORT_LIVERELOAD}" == "" ]]; then
PORT_LIVERELOAD=$(cat dev-livereload.port)
fi

# install ruby-devel
apt-get install -y ruby-dev

gem install i18n jekyll bundler jemoji nokogiri -n /usr/local/bin

Expand Down
Empty file modified docker-sleep.sh
100644 → 100755
Empty file.
Empty file modified docker-start.sh
100644 → 100755
Empty file.
Empty file modified docker-webp.sh
100644 → 100755
Empty file.
30 changes: 21 additions & 9 deletions serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,31 @@

SITE_NAME=$(cat CNAME)
SITE_NAME=${SITE_NAME//[^a-zA-Z0-9-]/-}
CONATINER_NAME = "build-$SITE_NAME"
CONATINER_NAME="build-$SITE_NAME"

PORT=$(cat dev.port)
PORT_LIVERELOAD =$(cat dev-livereload.port)
PORT_LIVERELOAD=$(cat dev-livereload.port)

$DOCKER_INSPECT_CHECK=$( docker inspect --format "{{.State.Status}}" $CONATINER_NAME )
DOCKER_INSPECT_CHECK=$( docker inspect --format "{{.State.Status}}" $CONATINER_NAME )

Start-Process 'http://localhost:8105/'
open 'http://localhost:8105/'

if ($DOCKER_INSPECT_CHECK -contains "running") {
Write-Host "Shell into existing Docker container:"
# if DOCKER_INSPECT_CHECK is "running" then exec into the container
if [ "$DOCKER_INSPECT_CHECK" == "running" ]; then
echo "Shell into existing Docker container:"
docker exec -it $CONATINER_NAME bash --login
} else {
Write-Host "Starting Docker container to run build server:"
else
echo "Starting Docker container to run build server:"
docker run --name $CONATINER_NAME -it --rm -p ${PORT}:${PORT} -p ${PORT_LIVERELOAD}:${PORT_LIVERELOAD} -v ${PWD}:/build/source:rw aemdesign/centos-java-buildpack bash --login /build/source/docker-serve.sh
}
fi




# if [[ "$DOCKER_INSPECT_CHECK" == "running"]]; then
# echo "Shell into existing Docker container:"
# docker exec -it $CONATINER_NAME bash --login
# else
# echo "Starting Docker container to run build server:"
# docker run --name $CONATINER_NAME -it --rm -p ${PORT}:${PORT} -p ${PORT_LIVERELOAD}:${PORT_LIVERELOAD} -v ${PWD}:/build/source:rw aemdesign/centos-java-buildpack bash --login /build/source/docker-serve.sh
# fi

0 comments on commit 71a43e2

Please sign in to comment.