Skip to content

Commit eaa5fe3

Browse files
committed
add readme and stk validate action to pipe
1 parent 661cb38 commit eaa5fe3

File tree

4 files changed

+48
-16
lines changed

4 files changed

+48
-16
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
name: STK actions quality-check
22

33
on:
4-
workflow_call:
5-
inputs:
6-
realm:
7-
description: The realm of the account.
8-
required: false
9-
type: string
10-
default: "stackspot"
11-
secrets:
12-
stk-client-id:
13-
required: true
14-
stk-client-secret:
15-
required: true
4+
pull_request:
165

176
jobs:
187
stackspot-runtime-v2:
@@ -24,8 +13,13 @@ jobs:
2413
LC_ALL: C.UTF-8
2514
PYTHONIOENCODING: utf-8
2615
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
2720
- run: sudo apt update && sudo apt install -y curl unzip git jq
2821
name: install dependencies
22+
2923
- name: Setup STK CLI
3024
run: |
3125
curl \
@@ -39,8 +33,14 @@ jobs:
3933
https://stk.stackspot.com/installer/linux/stk.deb
4034
sudo dpkg --install /tmp/stk.deb || echo installed
4135
rm --force /tmp/stk.deb
36+
4237
- name: Show STK CLI version
4338
run: $HOME/.stk/bin/stk --version
39+
4440
- name: Login StackSpot
4541
run: |
46-
$HOME/.stk/bin/stk login -id ${{ secrets.stk-client-id }} -key ${{ secrets.stk-client-secret }} -r ${{ inputs.realm }}
42+
$HOME/.stk/bin/stk login -id ${{ secrets.IDP_STK_CLIENT_ID }} -key ${{ secrets.IDP_STK_CLIENT_SECRET }} -r stackspot
43+
44+
- name: Validate main action
45+
run: |
46+
$HOME/.stk/bin/stk validate action

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,33 @@ Before using the actions in this repository, ensure that you have the following
1111

1212
* StackSpot CLI installed and configured.
1313

14-
14+
## How to Use
15+
16+
### Deploy
17+
18+
```bash
19+
stk run action <path-where-u-cloned-the-repository> \
20+
--workflow_type deploy \
21+
--environment "<environment>" \
22+
--version_tag "<version-tag>" \
23+
--repository_name "<repository-name>" \
24+
--client_id "<stackspot-client-id>" \
25+
--client_key "<stackspot-client-key>" \
26+
--client_realm "<stackspot-client-realm>" \
27+
--aws_access_key_id "<aws-access-key-id>" \
28+
--aws_secret_access_key "<aws-secret-access-key>" \
29+
--aws_session_token "<aws-session-token>" \
30+
--tf_state_bucket_name "<tf_state_bucket>" \
31+
--iac_bucket_name "<iac_bucket_name>" \
32+
--tf_state_region "<aws-region>" \
33+
--iac_region "<aws-region>" \
34+
--aws_region "<aws-region>"
35+
```
36+
37+
### Cancel
38+
39+
```bash
40+
stk run action <path-where-u-cloned-the-repository> \
41+
--workflow_type cancel \
42+
--run_id "<run_id>"
43+
```

action.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ spec:
1313
inputs:
1414
- label: Workflow type
1515
name: workflow_type
16-
type: text
16+
type: select
17+
items:
18+
- deploy
19+
- cancel
1720
required: true
1821
python:
1922
workdir: .

script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def cancel_deploy_run(run_action: RunAction):
4242

4343

4444
def run(metadata):
45-
workflows = dict(deploy=deploy_workflow, cancel_deploy=cancel_deploy_run)
45+
workflows = dict(deploy=deploy_workflow, cancel=cancel_deploy_run)
4646
run_action = RunAction(metadata)
4747
workflow_runner = workflows.get(metadata.inputs["workflow_type"])
4848
workflow_runner and workflow_runner(run_action=run_action)

0 commit comments

Comments
 (0)