-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathaction.yml
More file actions
51 lines (42 loc) · 1.31 KB
/
action.yml
File metadata and controls
51 lines (42 loc) · 1.31 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
# Control Plane GitHub Action
name: 'Setup Environment'
description: 'Sets up Ruby, installs Control Plane CLI, cpflow gem, and sets up the default profile'
inputs:
token:
description: 'Control Plane token'
required: true
org:
description: 'Control Plane organization'
required: true
runs:
using: 'composite'
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.6'
- name: Install Control Plane CLI and cpflow gem
shell: bash
run: |
sudo npm install -g @controlplane/cli@3.3.1
cpln --version
gem install cpflow -v 4.1.1
cpflow --version
- name: Setup Control Plane Profile
shell: bash
run: |
TOKEN="${{ inputs.token }}"
ORG="${{ inputs.org }}"
if [ -z "$TOKEN" ]; then
echo " Error: Control Plane token not provided"
exit 1
fi
if [ -z "$ORG" ]; then
echo " Error: Control Plane organization not provided"
exit 1
fi
echo "Setting up Control Plane profile..."
echo "Organization: $ORG"
cpln profile update default --org "$ORG" --token "$TOKEN"
echo "Setting up Docker login for Control Plane registry..."
cpln image docker-login --org "$ORG"