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

Commit5d46430

Browse files
Merge pull request#902 from maryiaCodefresh/maryia-new-kb
Created automating-shared-secrets-creation.md
2 parents034cc70 +b933191 commit5d46430

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title:"How To: Automate creation of Shared Secrets"
3+
description:
4+
group:kb
5+
sub-group:articles
6+
toc:true
7+
kb:false
8+
ht:true
9+
common:false
10+
categories:[Pipelines, CLI]
11+
support-reviewed:2024-01-17 MB
12+
---
13+
14+
##Overview
15+
16+
You have numerous secrets to manage across different pipelines and want to make the process more efficient.
17+
18+
##Details
19+
20+
The script reads each line from the provided file and appends it to the Codefresh`create context secret` command. This results in a single command that creates a secret context with all the specified secrets.
21+
22+
>**NOTE**
23+
Ensure you have the necessary permissions to create contexts in Codefresh.
24+
25+
**Script**
26+
27+
```bash
28+
#!/bin/bash
29+
30+
CMD="codefresh create context secret <secret_context_name>"
31+
32+
whileread LINE;do
33+
34+
CMD="${CMD} -v${LINE}"
35+
36+
done<"$1"
37+
38+
echo"$CMD"
39+
```
40+
41+
**How to use the script**
42+
43+
1. Prepare your secrets list
44+
Start by preparing a file containing your secrets. Each line in the file should contain one secret in the format KEY=VALUE.
45+
46+
2. Set execution permissions
47+
Make the script executable by running:
48+
`chmod +x script_name.sh`
49+
50+
3. Run the script
51+
Execute the script with the command:
52+
`./script_name.sh secret_list.txt`
53+
where:
54+
`secret_list.txt` is the file containing your secrets
55+
56+
4. Verify creation
57+
After executing the script, verify that the secret context has been created in Codefresh with the specified secrets.
58+
59+
60+
61+
##Related articles
62+
[Secrets in pipelines]({{site.baseurl}}/docs/pipelines/configuration/secrets-store/)
63+
[Configuring access control for pipelines]({{site.baseurl}}/docs/administration/account-user-management/access-control/)
64+
[Pipeline execution context]({{site.baseurl}}docs/administration/account-user-management/pipeline-execution-context/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp