Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Working with Linux ??? Quick Hacks for the Command Line

You're reading from   Working with Linux ??? Quick Hacks for the Command Line Command line power like you've never seen

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129184
Length 222 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
 I»ôfan I»ôfan
Author Profile Icon I»ôfan
I»ôfan
Bogdan Vaida Bogdan Vaida
Author Profile Icon Bogdan Vaida
Bogdan Vaida
Arrow right icon
View More author details
Toc

Autoenv – Set a lasting, project-based habitat


Projects are different from one another and so are environments. We might be developing an application on our local machine with certain environment variables like debug level, API keys, or memory size. Then we want to deploy the application to a staging or production server, which has other values for the same environment variables. A tool that comes in handy for loading environments on the fly is autoenv.

To install it we go to the official GitHub page and follow the instructions:

https://github.com/kennethreitz/autoenv

First we will clone the project in our home directory, and then we add the following line to our .zshrc config file, so that every time zsh starts, autoenv is loaded by default:

source ~/.autoenv/activate.sh

Now let's create an example workplace with two imaginary projects, project 1 and project 2.

We open an environment file for project 1:

vim project1/.env

Let's now imagine that project 1 uses an environment variable called...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images