Skip to content

Commit f8dc366

Browse files
committed
OPS-15 Begin kosli trail when creating release
1 parent c4518e7 commit f8dc366

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.github/workflows/create-release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
env:
77
# kosli commands picks up org, flow, trail and api-token from these environment variables
88
KOSLI_ORG: kosli-public
9+
KOSLI_FLOW: "jira-example-release"
910
KOSLI_API_TOKEN: "${{ secrets.KOSLI_PUBLIC_API_TOKEN }}"
1011
KOSLI_CLI_VERSION: "2.11.8"
1112
KOSLI_ENV_STAGING: "jira-integration-example-staging"
@@ -33,10 +34,9 @@ jobs:
3334
version:
3435
${{ env.KOSLI_CLI_VERSION }}
3536

36-
- name: Create release candidate
37+
- name: Create Jira release candidate
3738
run: |
3839
source scripts/lib-jira.sh
39-
source scripts/lib-kosli.sh
4040
4141
# Fail if release already exists
4242
CURRENT_REL_JSON=$(get_current_release_candidate ${{ env.JIRA_PROJECT_ID }})
@@ -50,7 +50,28 @@ jobs:
5050
TIMESTAMP=$(date -u "+%Y-%m-%d-%H-%M-%S")
5151
CREATE_RESULT_JSON=$(create_release ${{ env.JIRA_PROJECT_ID }} ${TIMESTAMP})
5252
RELEASE_ID=$(echo "${CREATE_RESULT_JSON}" | jq .id)
53-
53+
echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
54+
55+
- name: Begin trail
56+
uses: ./.github/workflows/composites/kosli-begin-trail
57+
with:
58+
kosli-trail: ${{ env.RELEASE_ID }}
59+
# kosli-template-file: ${{ env.KOSLI_TEMPLATE_FILE }}
60+
61+
- name: Report current staging SW
62+
run: |
63+
source scripts/lib-kosli.sh
64+
get_current_running_env_json ${{ env.KOSLI_ENV_STAGING }} > /tmp/staging-env.json
65+
jq '[.[] | {name, fingerprint, git_commit}]' /tmp/staging-env.json > /tmp/user-data.json
66+
kosli attest generic \
67+
--name staging-software \
68+
--trail ${{ env.RELEASE_ID }} \
69+
--user-data /tmp/user-data.json
70+
71+
- name: Add Jira tickets to release
72+
run: |
73+
source scripts/lib-jira.sh
74+
source scripts/lib-kosli.sh
5475
# Add all jira tickets between prod and staging
5576
JIRA_KEYS=$(get_issue_keys_between_staging_and_prod)
5677
echo "Found issues: ${JIRA_KEYS}"

apps/backend/backend-content.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
This is just a file to test out that changes to back-end source code
22
can trigger a build, reporting to Kosli and Jira
33

4-
counter=12
4+
counter=13

apps/frontend/frontend-content.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
This is just a file to test out that changes to front-end source code
22
can trigger a build, reporting to Kosli and Jira
33

4-
counter=12
4+
counter=13

0 commit comments

Comments
 (0)