-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 3.4 KB
/
setup-kosli.yml
File metadata and controls
104 lines (87 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Setup kosli
on:
workflow_dispatch:
env:
# kosli commands picks up org, flow, trail and api-token from these environment variables
KOSLI_ORG: "${{ vars.KOSLI_ORG }}"
KOSLI_API_TOKEN: "${{ secrets.KOSLI_PUBLIC_API_TOKEN }}"
KOSLI_CLI_VERSION: "${{ vars.KOSLI_CLI_VERSION }}"
KOSLI_ENV_PROD: "jira-multi-repo-prod"
jobs:
create-flows:
name: Create kosli flows and environments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Kosli cli
uses: kosli-dev/setup-cli-action@v2
with:
version:
${{ vars.KOSLI_CLI_VERSION }}
### flows ###
- name: Create jira-multi-repo-release flow
run:
kosli create flow jira-multi-repo-release
--description "Track a top level release of multiple applications"
--template-file kosli-flow-templates/release-template.yml
### Custom attestation types ###
- name: Create jira-issues-list attestation type
run:
kosli create attestation-type jira-issues-list
--description "List of Jira issues"
--schema custom-attestation-types/jira-issues-list-schema.json
- name: Create sw-update-plan attestation type
run:
kosli create attestation-type sw-update-plan
--description "Planed update of SW"
--schema custom-attestation-types/sw-update-plan-schema.json
### environments ###
- name: Create prod env
run:
kosli create environment ${{ env.KOSLI_ENV_PROD }}
--description "A simulated production environment for jira multi repo"
--type server
### create policies ###
# - name: Create has provenance policy
# run:
# kosli create policy has-provenance policies/has-provenance.yml
# --description "Artifacts has provenance"
# --type env
#
# - name: Create trail compliant policy
# run:
# kosli create policy trail-compliant policies/trail-compliant.yml
# --description "Artifacts comes from trails that are compliant"
# --type env
#
# - name: Create has release approval policy
# run:
# kosli create policy has-release-approval policies/has-release-approval.yml
# --description "Artifacts has been approved for release"
# --type env
### attache policies ###
- name: Attach has provenance policy to all envs
run:
kosli attach-policy has-provenance
--environment ${{ env.KOSLI_ENV_PROD }}
- name: Attach trail compliant policy to all envs
run:
kosli attach-policy trail-compliant
--environment ${{ env.KOSLI_ENV_PROD }}
- name: Attach has release approval to prod
run:
kosli attach-policy has-release-approval
--environment ${{ env.KOSLI_ENV_PROD }}
### detach old policies
# - name: Detach jira-multi-repo-releases-dev-staging-policy
# run:
# kosli detach-policy jira-multi-repo-releases-dev-staging-policy
# --environment ${{ env.KOSLI_ENV_DEV }}
# --environment ${{ env.KOSLI_ENV_STAGING }}
#
# - name: Detach jira-multi-repo-releases-prod-policy
# run:
# kosli detach-policy jira-multi-repo-releases-prod-policy
# --environment ${{ env.KOSLI_ENV_PROD }}