-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (75 loc) · 2.45 KB
/
action.yml
File metadata and controls
81 lines (75 loc) · 2.45 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
name: "Octelium"
description: "Connect to Octelium Clusters from Github Action workflows"
branding:
icon: "check"
color: "black"
inputs:
domain:
description: "Your Octelium Cluster domain"
required: true
auth-token:
description: "Authentication token"
dev:
description: "Dev mode"
insecure-tls:
description: "Insecure TLS mode"
wait:
description: "Wait in seconds after connecting"
default: "4"
args:
description: "The arguments of the octelium-connect command"
assertion-idp:
description: "The name of the OIDC assertion IdentityProvider"
assertion-aud:
description: "Override the assertion audience"
command:
description: "Invoke an Octelium command. By default it connects to the Cluster"
required: true
default: "connect"
runs:
using: "composite"
steps:
- name: Install in Linux/MacOS
if: inputs.command == 'connect' && (runner.os == 'Linux' || runner.os == 'macOS')
shell: bash
run: |
curl -H "User-Agent: octelium-github-actions" -fsSL https://octelium.com/install.sh | bash
octelium version
- name: Install in Windows
if: inputs.command == 'connect' && runner.os == 'Windows'
shell: powershell
run: |
iwr https://octelium.com/install.ps1 -useb | iex
- name: Run in Linux/MacOS
if: inputs.command == 'connect' && (runner.os == 'Linux' || runner.os == 'macOS')
shell: bash
env:
OCTELIUM_DOMAIN: ${{ inputs.domain }}
OCTELIUM_AUTH_TOKEN: ${{ inputs.auth-token }}
OCTELIUM_DEV: ${{ inputs.dev }}
OCTELIUM_INSECURE_TLS: ${{ inputs.insecure-tls }}
OCTELIUM_LOGOUT: "true"
run: |
CMD="sudo -E octelium connect"
if [ -n "${{ inputs.assertion-idp }}" ]; then
if [ -n "${{ inputs.assertion-aud }}" ]; then
CMD="$CMD --assertion ${{ inputs.assertion-idp }}:github-actions:${{ inputs.assertion-aud }}"
else
CMD="$CMD --assertion ${{ inputs.assertion-idp }}:github-actions"
fi
fi
if [ -n "${{ inputs.args }}" ]; then
CMD="$CMD ${{ inputs.args }}"
fi
echo "Running: $CMD"
$CMD &
sleep ${{ inputs.wait }}
- name: Logout
if: inputs.command == 'logout'
shell: bash
env:
OCTELIUM_DOMAIN: ${{ inputs.domain }}
OCTELIUM_DEV: ${{ inputs.dev }}
OCTELIUM_INSECURE_TLS: ${{ inputs.insecure-tls }}
run: |
octelium logout