Developer Documentation

Deploy Your First App 🐣

In the next few minutes, you’ll set up everything you need and deploy a simple HTML page served by a web server.

Prerequisites

💡 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

1. Connect Your AWS Account to Envirobly

Visit your Envirobly dashboard and click “Connect an AWS account”. You’ll be guided to complete the process. It takes about a minute.

2. Instal Envirobly CLI on Your Developer Machine

gem install envirobly

3. Create a Sample Codebase

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"

4. You’re Ready to Deploy

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.

5. Deploying a Change

# 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.

Cleaning up đŸ§č

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.