Skip to content

Commit 237907e

Browse files
committed
Initial checkin
0 parents  commit 237907e

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.project

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Solsta Launch Files Action for GitHub
2+
3+
This project is a GitHub Action that uses Solid State Networks tools and services to assign launch files and arguments to a Solsta environment.
4+
5+
The action is compatible with Windows, Linux, and OSX runners. Windows self-hosted runners require git-bash (https://git-scm.com/) in the %PATH%.
6+
7+
## Variables
8+
9+
* **solsta_client_id:** Client ID to authenticate usage of Solid State Networks console tools
10+
* **solsta_client_secret:** Secret Key to authenticate usage of Solid State Networks console tools
11+
* **console_version:** Version of Solsta Console Tools to use
12+
* **scripts_version:** Version of Solsta Deploy Scripts to use
13+
* **target_product:** Target product to cleanup (case-sensitive)
14+
* **target_env:** Target environment for launch files (case-sensitive)
15+
* **launch_file1:** Up to 10 launch file entry names, paths, and arguments, format for each row is ("entry name" "path" "arg1 arg2 ...")
16+
17+
## Using
18+
19+
Here is an example YAML Fragment in the steps section of a build:
20+
21+
```yaml
22+
steps:
23+
- name: Launch Files CDN data for a Product and location
24+
uses: snxd/deploy-github-launchfiles-action@v2
25+
with:
26+
console_version: '6.1.2.51'
27+
target_product: 'Emutil'
28+
scripts_version: '3.7.24'
29+
solsta_client_id: ${{ secrets.SNXD_CLIENT_ID }}
30+
solsta_client_secret: ${{ secrets.SNXD_CLIENT_SECRET }}
31+
launch_files1: '("Entry Name 1" "/path/to/exec" "arg1 arg2 ...")'
32+
launch_files2: '("Entry Name 2" "/path/to/exec" "arg1 arg2 ...")'
33+
```
34+
35+
## License
36+
(C) 2022 Solid State Networks, LLC. All Rights Reserved.

action.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Solsta Launch Files Action
2+
description: Configure Launch Files for an environment
3+
inputs:
4+
solsta_client_id:
5+
description: Client ID to authenticate usage of Solid State Networks console tools
6+
required: true
7+
default: ""
8+
solsta_client_secret:
9+
description: Secret Key to authenticate usage of Solid State Networks console tools
10+
required: true
11+
default: ""
12+
console_version:
13+
description: Version of Solsta Console Tools to use
14+
required: true
15+
default: "6.1.2.51"
16+
scripts_version:
17+
description: Version of Solsta Deploy Scripts to use
18+
required: true
19+
default: "3.7.24"
20+
target_product:
21+
description: Target product containing the environment (case-sensitive)
22+
required: true
23+
target_env:
24+
description: Target environment for launch files (case-sensitive)
25+
required: true
26+
launch_file1:
27+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
28+
required: true
29+
launch_file2:
30+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
31+
required: false
32+
launch_file3:
33+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
34+
required: false
35+
launch_file4:
36+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
37+
required: false
38+
launch_file5:
39+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
40+
required: false
41+
launch_file6:
42+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
43+
required: false
44+
launch_file7:
45+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
46+
required: false
47+
launch_file8:
48+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
49+
required: false
50+
launch_file9:
51+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
52+
required: false
53+
launch_file10:
54+
description: Launch file path and argument, format is ("entry name" "path" "arg1 arg2 ...")
55+
required: false
56+
57+
outputs:
58+
result:
59+
description: The state of the action, if processes completed successfully
60+
61+
runs:
62+
using: 'composite'
63+
steps:
64+
- name: Solsta setup
65+
uses: snxd/deploy-github-setup-action@v2
66+
with:
67+
solsta_client_id: ${{ inputs.solsta_client_id }}
68+
solsta_client_secret: ${{ inputs.solsta_client_secret }}
69+
console_version: ${{ inputs.console_version }}
70+
scripts_version: ${{ inputs.scripts_version }}
71+
72+
- name: Do Deploy
73+
shell: bash
74+
working-directory: solsta_work
75+
run: |
76+
# Build the launch files arguments
77+
SOLSTA_EXTRA=""
78+
for i in 1 2 3 4 5 6 7 8 9 10 ; do
79+
VARNAME=${{ iinputs.launch_file ))$i
80+
eval SOLSTA_LAUNCH_ENTRY=${!VARNAME}
81+
if ["$SOLSTA_LAUNCH_ENTRY" != "" ] ; then
82+
SOLSTA_EXTRA="$SOLSTA_EXTRA --launch_name=\"${SOLSTA_LAUNCH_ENTRY[0]}\" --launch_executable=\"${SOLSTA_LAUNCH_ENTRY[1]}\" --launch_arguments=\"${SOLSTA_LAUNCH_ENTRY[2]}\" "
83+
fi
84+
done
85+
# Run the script that assigns the launch files to the environment
86+
echo extra = $SOLSTA_EXTRA
87+
python manifest.py --debug_network --console_credentials=client_credentials.json --console_directory=solsta_console/${{ inputs.console_version }}/console/ --product_name="${{ inputs.target_product }}" --env_name="${{ inputs.target_env }}" $SOLSTA_EXTRA
88+
89+
branding:
90+
icon: "download-cloud"
91+
color: "yellow"

0 commit comments

Comments
 (0)