Tutorial¶
This document will explain how to install Outpak and use it in your projects.
Creating the pak.yml file¶
For a simple example, let’s consider the following environment for your project, loaded in the .bashrc file:
$ export MY_ENVIRONMENT="docker"
$ export MY_GIT_TOKEN="12345abcde"
Based on these values, we can create the pak.yml
configuration file:
version: "1"
github_key: MY_GIT_TOKEN
env_key: MY_ENVIRONMENT
envs:
Docker:
key_value: docker
clone_dir: /opt/src
files:
- requirements.txt
- requirements_test.txt
Note
Save the pak.yml on the same directory where the requirements.txt
files are located.
The github_key
¶
The github_key
points to the environment variable you use to store your Git Personal Token. (For Bitbucket App Password, use the key bitbucket_key
). On our example is the MY_GIT_TOKEN env.
The env_key
¶
The env_key
points to the environment variable which you use to indicate what is the project current working environment (development, stage, etc…). In our example is the MY_ENVIRONMENT env.
The envs
key¶
The envs
list can hold one entry per possible value the MY_ENVIRONMENT (the env_key
) holds. In our example, MY_ENVIRONMENT was set to “docker”, so we need a “Docker” entry in this key:
- The
key_value
must be the same value stored in the MY_ENVIRONMENT var: in our example “docker”- The full path for cloning projects will be
/opt/src
as indicated inclone_dir
key.- The list of files which will be processed are:
requirements.txt
andrequirements_test.txt
as indicated in keyfiles
.
Note
Check the Pak.yml Reference page to the complete reference for pak.yml
files.
Running Outpak¶
After create the configuration file, you can start install packages with the command:
$ pak install --config /path/to/pak/file
If you do not inform the path for the pak.yml
file, Outpak will attempt to find it in the current directory.
Note
Also you can set the OUTPAK_FILE
environment variable for where the pak.yml
file is located.