Last active
November 8, 2019 13:13
-
-
Save benyblack/d1de2e3b2aa21274871e8d132884dd73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RED='\033[0;31m' | |
BLUE='\033[1;34m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
R="${BLUE}Running ${NC}" | |
D="${GREEN}Done! ${NC}" | |
clear | |
sleep 1 | |
echo "${BLUE}Create a Postgres server by docker ${NC}" | |
echo "${R} docker pull postgres" | |
sleep 2 | |
docker pull postgres | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Running the docker postgres container in the background: ${NC}" | |
echo "${R} docker run -d --rm -p 5432:5432 --name postgres_hello_world_ci -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=hello_world_ci_dev postgres" | |
sleep 2 | |
docker run -d --rm -p 5432:5432 --name postgres_hello_world_ci -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=hello_world_ci_dev postgres | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Create a phoenix application: ${NC}" | |
echo "${R} echo no | mix phx.new hello_world_ci" | |
sleep 2 | |
echo no | mix phx.new hello_world_ci | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${R} cd hello_world_ci" | |
sleep 1 | |
cd hello_world_ci | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Getting elixir app dependencies ${NC}" | |
echo "${R} mix deps.get" | |
sleep 2 | |
mix deps.get | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Compile the code ${NC}" | |
echo "${R} mix do compile" | |
sleep 2 | |
mix do compile | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Create the database by ecto ${NC}" | |
echo "${R} mix ecto.setup" | |
sleep 2 | |
mix ecto.setup | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Build client side stuff ${NC}" | |
echo "${R} cd assets && npm install && cd .." | |
sleep 2 | |
cd assets && npm install && cd .. | |
echo ${D} | |
sleep 1 | |
clear | |
echo "${BLUE}Finally! Running the server. After this you can navigate to http://localhost:4000 to see the website ${NC}" | |
echo "${R} mix phx.server" | |
sleep 2 | |
mix phx.server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment