Skip to content

Commit 44a32d7

Browse files
committed
Initial Commit
1 parent 994e478 commit 44a32d7

4 files changed

Lines changed: 73 additions & 0 deletions

File tree

.cloud66/cx/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM cloud66/cx:latest
2+
3+
LABEL "com.github.actions.name"="Cloud 66 GitHub Action"
4+
LABEL "com.github.actions.description"="GitHub Action that allows you to perform Cloud 66 toolbelt operations when envoked."
5+
LABEL "com.github.actions.icon"="upload-cloud"
6+
LABEL "com.github.actions.color"="green"
7+
LABEL "repository"="http://github.com/cloud66/cloud66-actions"
8+
LABEL "homepage"="http://github.com/actions/cloud66"
9+
LABEL "maintainer"="Cloud66 <https://www.cloud66.com/>"
10+
11+
ADD entrypoint.sh /
12+
ENTRYPOINT ["/entrypoint.sh"]

.cloud66/cx/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
4+
sh -c "cx $*"

.github/main.workflow

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
workflow "New workflow" {
2+
on = "push"
3+
resolves = ["cloud66"]
4+
}
5+
6+
action "cloud66" {
7+
uses = "./.cloud66/cx"
8+
}
9+

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# GitHub Actions for Cloud 66 toolbelt #
2+
This repository contains GitHub Actions for [Cloud 66 toolbelt](https://github.com/cloud66-oss/cx), which would allow users to perform common tasks available through cx (such as deployment), using GitHub Actions.
3+
4+
# Usage #
5+
6+
Below have been provided two example workflows, which demonstrate the two ways in which Cloud 66 toolbelt commands can be passed to the Cloud 66 GitHub Action. Both result in redeployment of a Cloud 66 stack, named "my_stack".
7+
8+
The first option is to provide the name of the stack as an environment variable and to pass the cx command as an argument, containing the name of the environment variable, as can be seen below:
9+
10+
```
11+
workflow "New workflow" {
12+
on = "push"
13+
resolves = ["cloud66"]
14+
}
15+
16+
action "cloud66" {
17+
uses = "./.cloud66/cx"
18+
secrets = ["CLOUD66_TOKEN"]
19+
args = "redeploy --stack CLOUD66_STACK -y --listen"
20+
env = {
21+
CLOUD66_STACK = "my-stack"
22+
}
23+
}
24+
```
25+
The second option is to pass the cx command and the name of the stack together as an argument. This would look like this:
26+
```
27+
workflow "New workflow" {
28+
on = "push"
29+
resolves = ["cloud66"]
30+
}
31+
32+
action "cloud66" {
33+
uses = "./.cloud66/cx"
34+
args = "redeploy --stack my-stack -y --listen"
35+
secrets = ["CLOUD66_TOKEN"]
36+
}
37+
```
38+
39+
## Secrets ##
40+
Both options would need the content of the cx token file to be passed as a secret. This would enable cx. The content can be accessed by running the ```cx dump-token | base64``` command on your local device. The result can then be used as a value of a secret with key ```CLOUD66_TOKEN```. Note that the name of the secret cannot be anything else, since cx will not recognise it.
41+
42+
## Environment Variables ##
43+
The use of environment variables is a matter of personal choice, since anything that is passed as an environment variable, can also be directly provided in the arguments part.
44+
45+
In this case, this is ```CLOUD66_STACK = "my-stack"``` in the first example and there is no environment variable in the second example.
46+
47+
# License #
48+
See LICENSE

0 commit comments

Comments
 (0)