You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/kb/articles/automating-shared-secrets-creation.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title:"How To:AutomatingShared Secrets Creation"
2
+
title:"How To:Automate creation ofShared Secrets"
3
3
description:
4
4
group:kb
5
5
sub-group:articles
@@ -17,9 +17,12 @@ You have numerous secrets to manage across different pipelines and want to make
17
17
18
18
##Details
19
19
20
-
The script reads each line from the provided file and appends it to thecodefreshcreate context secret command. This results in a single command that creates a secret context with all the specified secrets.
20
+
The script reads each line from the provided file and appends it to theCodefresh`create context secret` command. This results in a single command that creates a secret context with all the specified secrets.
21
21
22
-
The Script:
22
+
>**NOTE**
23
+
Ensure you have the necessary permissions to create contexts in Codefresh.
24
+
25
+
**Script**
23
26
24
27
```bash
25
28
#!/bin/bash
@@ -35,20 +38,27 @@ done < "$1"
35
38
echo"$CMD"
36
39
```
37
40
38
-
Steps toUse theScript:
41
+
**How touse thescript**
39
42
40
-
1. Prepare Your Secret List: Start by preparing a file containing your secrets. Each line in the file should contain one secret in the format KEY=VALUE.
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.
41
45
42
-
2. Set Execution Permissions: Make the script executable by running chmod +x script_name.sh.
46
+
2. Set execution permissions
47
+
Make the script executable by running:
48
+
`chmod +x script_name.sh`
43
49
44
-
3. Run the Script: Execute the script with the command ./script_name.sh secret_list.txt, where secret_list.txt is the file containing your secrets.
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
45
55
46
-
4. Verify the Creation: After execution, verify that the secret context has been created in Codefresh with the specified secrets.
56
+
4. Verify creation
57
+
After executing the script, verify that the secret context has been created in Codefresh with the specified secrets.
47
58
48
-
>**Note** : Ensure you have the necessary permissions in Codefresh to create contexts.
49
59
50
-
##Related Items
51
60
61
+
##Related articles
52
62
[Secrets in pipelines]({{site.baseurl}}/docs/pipelines/configuration/secrets-store/)
53
63
[Configuring access control for pipelines]({{site.baseurl}}/docs/administration/account-user-management/access-control/)