In the next few minutes, youâll set up everything you need and deploy a simple HTML page served by a web server.
đĄ You can copy the code samples in this documentation by hovering over them and clicking âCopyâ in the top right corner. Paste it into your command line (terminal) and press Enter to execute them.
# Check whether you have Ruby
ruby -v
# See whether Git is installed
git -v
Visit your Envirobly dashboard and click âConnect an AWS accountâ. Youâll be guided to complete the process. It takes about a minute.
gem install envirobly
git init ~/envirobly-first-steps
cd ~/envirobly-first-steps
# Sample web page
echo "Taking my first steps with Envirobly" > index.html
# Dockerfile is used to define the runtime environment of your app
cat <<EOT > Dockerfile
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/index.html
EOT
# Envirobly deploy config
mkdir .envirobly
cat <<EOT > .envirobly/deploy.yml
services:
webpage:
public: true
EOT
Feel free to edit the index.html
file to customize the text.
Once youâre done, commit the new files to the version control system:
git add .
git commit -m "My first webpage"
envirobly deploy
Youâll be asked to sign in, then specify defaults, like which region you want this project to be deployed to. Afterwards the deployment will be created and youâll be presented with a link to view the progress of the deployment. Go ahead and visit the link.
After a minute your app should be build and deployed and youâll see a link to your new service. Visit it.
The web page should show the text youâve put into index.html
file earlier.
Congratulations đ„ł
Thatâs your first deployment done. It only gets easier from now on.
# Make a change to the content
echo "I changed this" > index.html
# Commit it
git add .
git commit -m "Changes"
# Deploy the latest commit
envirobly deploy
You wonât be answering any questions this time, rather a new deployment will be created immediately. Follow the link to observe the progress. Once succeeded, visit your service and check that the new text is displayed.
Thatâs the basic workflow you can use to develop and deploy your project along the way.
To ensure youâre not leaving any running paid resources behind, visit your dashboard, click on the account you created at the beginning of this guide. Within the Projects section click on âenvirobly-first-stepsâ card. Then in the top right corner, click on the project ellipses menu ââŠâ and click âDeleteâ. Confirm the choice.