description |
---|
Get started with envsecrets in 4 minutes. |
- Signup for an envsecrets account.
- Install the CLI from here.
Firstly, change directory to your project root.
cd my-project
Initalize the project directory for envsecrets.
envs init
This command will ask you to choose your organisation, project and one of it's environments.
If you do not already have a project, you can create one directly from the CLI when prompted with the option.
envs set DB_PASSWORD=awesome
This will create the first version of your secrets in the initialized environment.
Import all the key-value pairs from your existing .env (or any equivalent) file in the following manner:
envs set --file .env
This will help you validate that your key-value pair indeed got set.
envs ls
If you want to export complete key-value pairs and not just the keys, use: envs export
Let's create a test script which will natively consume our secrets using the envs
CLI.
Copy and save the following contents in a file called test.sh
.
echo $DB_PASSWORD
Inject the secrets into your process and make them natively accessible.
{% tabs %} {% tab title="Example" %}
envs run -- sh test.sh
{% endtab %}
{% tab title="Second Tab" %}
envs run -- [Your Command]
{% endtab %} {% endtabs %}
Running this command should ideally output:
awesome
- Login to the platform.
- Go to the integrations tab.
- Open the catalog.
- Select the Github integration.
- This will open Github's Oauth flow.
- Authorize envsecrets' GitHub app to read/write secrets vis-a-viz your target repository.
- You will be redirected back to our platform once this flow is complete.
- Once you land on the post-integration page, you have to choose your envsecrets project and environment along with the target Github repository.
That is all! Now, go to your Github repository's "actions secrets" section in the repository "settings" and ensure the secret "DB_PASSWORD" is available.
Similarly, you can choose any native integration from our catalog of available integrations to keep your secrets synchronized everywhere in real-time.