Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit929a7df

Browse files
Small changes to Vault example
1 parent5be5447 commit929a7df

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

‎_docs/yaml-examples/examples/vault-secrets-in-the-pipeline.md‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ redirect_from:
88
toc:true
99
---
1010

11-
Codefresh offers a Vault plugin you may use from the[Step Marketplace](https://codefresh.io/steps/step/vault). The plugin imports key-value pairs from the Vault server, and exports them into the pipeline. Since this is a custom typed-step, variables are written to`/meta/env_vars_to_export`, as opposed to`/codefresh/volume/env_vars_to_export`.
12-
11+
Codefresh offers a Vault plugin you may use from the[Step Marketplace](https://codefresh.io/steps/step/vault). The plugin imports key-value pairs from the Vault server, and exports them into the pipeline.
1312
##Prerequisites
1413

1514
- A[free Codefresh account](https://codefresh.io/docs/docs/getting-started/create-a-codefresh-account/)
@@ -34,10 +33,21 @@ The example application retrieves the system variable "password," from the pipel
3433

3534
Also in the example application is a simple unit test that ensures we are able to read and write data to the database.
3635

37-
You cannot run the application locally, as it needs to run in the pipeline in orderfor the teststopass.
36+
You cannot run the application locally, as it needs to run in the pipeline in orderto use our environment variablestoconnect.
3837

3938
##Create the Pipeline
4039

40+
We will be running the following pipeline that contains three step types: a vault step, a[git-clone]({{site.baseurl}}/docs/codefresh-yaml/steps/git-clone/) step, and a[freestyle step]({{site.baseurl}}/docs/codefresh-yaml/steps/freestyle/).
41+
42+
{% include image.html
43+
lightbox="true"
44+
file="/images/examples/secrets/vault-pipeline.png"
45+
url="/images/examples/secrets/vault-pipeline.png"
46+
alt="Vault pipeline"
47+
caption="Vault Pipeline"
48+
max-width="100%"
49+
%}
50+
4151
You should be able to copy and paste this YAML in the in-line editor of the Codefresh UI. It will automatically clone the project for you.
4252

4353
Note that you need to change the`VAULT_ADDR`,`VAULT_AUTH`, and`VAULT_AUTH_TOKEN` arguments under the first step to your respective values.
@@ -88,4 +98,19 @@ The above pipeline does the following:
8898
-Spins up a [Service Container]({{site.baseurl}}/docs/codefresh-yaml/service-containers/) running Redis on port 6379 , and sets the password to the database using our exported environment variable
8999
-Sets `maven.repo.local` to cache Maven dependencies into the local codefresh volume to [speed up builds]({{site.baseurl}}/docs/learn-by-example/java/spring-boot-2/#caching-the-maven-dependencies)
90100
-Runs unit tests and packages the jar. Note how you can directly refer to the service container's name (`my-redis-db-host`) when we set `server.host`
101+
102+
You will see that the variable was correctly exported to the pipeline by running a simple `echo` command:
103+
{% include image.html
104+
lightbox="true"
105+
file="/images/examples/secrets/vault-pipeline2.png"
106+
url="/images/examples/secrets/vault-pipeline2.png"
107+
alt="Vault pipeline Variable"
108+
caption="Vault Pipeline Variable"
109+
max-width="100%"
110+
%}
91111

112+
## What to Read Next
113+
114+
-[Git-clone Step]({{site.baseurl}}/docs/codefresh-yaml/steps/git-clone/)
115+
-[Freestyle Step]({{site.baseurl}}/docs/codefresh-yaml/steps/freestyle/)
116+
-[Service Containers]({{site.baseurl}}//docs/codefresh-yaml/service-containers/)
20.3 KB
Loading
6.11 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp