Skip to content

Commit 67682e5

Browse files
committed
Release v2.0.0-beta1
1 parent 52bcf3c commit 67682e5

23 files changed

Lines changed: 503 additions & 185 deletions

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
- name: Release
18-
uses: softprops/action-gh-release@v1
18+
uses: softprops/action-gh-release@v2
1919
with:
2020
generate_release_notes: true

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
*.bak
1+
*.bak
2+
.DS_Store
3+
.idea/
4+
.vscode/

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:22.04
22

3-
LABEL version="v1.0.39"
3+
LABEL version="v2.0.0-beta1"
44
LABEL repository="https://github.com/beastawakens/action-convox-multi-slim"
55
LABEL homepage="https://convox.com/"
66
LABEL maintainer="Beast Awakens <me@beastawakens.com>"
@@ -17,4 +17,5 @@ RUN curl -L https://github.com/convox/convox/releases/latest/download/convox-lin
1717
&& chmod 755 /usr/local/bin/convox
1818

1919
COPY entrypoint* /
20+
COPY lib/ /lib/
2021
ENTRYPOINT ["/entrypoint.sh"]

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
.PHONY: release
22

3+
DOCKER_REPO := beastawakens/action-convox-multi-slim
4+
35
release:
6+
ifndef VERSION
7+
$(error VERSION is not set. Usage: VERSION=v1.x.x make release)
8+
endif
49
@echo "Checking Docker daemon status..."
510
@docker info > /dev/null 2>&1 || { echo "Error: Docker daemon is not running. Please start Docker first."; exit 1; }
611
@echo "Checking Docker Hub login status..."
712
@test -f ~/.docker/config.json && cat ~/.docker/config.json | grep -q "index.docker.io" || { echo "Error: Not logged into Docker Hub. Please run 'docker login' first."; exit 1; }
8-
@echo "Docker checks passed. Proceeding with release..."
9-
sed -i'.bak' 's/\(image:.*:\)[^'\'']*/\1$(VERSION)/' action.yml
10-
sed -i'.bak' 's/\(LABEL version=\)"[^"]*"/\1"'${VERSION}\"'/' Dockerfile
13+
@echo "Docker checks passed. Proceeding with release $(VERSION)..."
14+
@echo "$(VERSION)" > VERSION
15+
sed -i'.bak' 's|\(image:.*:\)[^'\'']*|\1$(VERSION)|' action.yml
16+
sed -i'.bak' 's|\(LABEL version=\)"[^"]*"|\1"$(VERSION)"|' Dockerfile
1117
git commit -am "Release $(VERSION)"
12-
docker buildx build --platform linux/amd64 --push . -t beastawakens/action-convox-multi-slim:$(VERSION)
18+
docker buildx build --platform linux/amd64 --push . -t $(DOCKER_REPO):$(VERSION)
1319
git tag $(VERSION) -s -m $(VERSION) --force
1420
git push origin refs/tags/$(VERSION) --force
1521
git push

README.md

Lines changed: 303 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,313 @@
11
# action-convox-multi-slim
2-
Multiple convox actions in one slim docker image
32

4-
## Instructions for creating a new version
3+
Multiple Convox CLI commands in one slim Docker-based GitHub Action. Instead of using separate actions for each Convox operation, this single action supports 16 commands through the `action` input, reducing workflow boilerplate.
54

6-
Make changes as appropriate
5+
## Supported Actions
76

8-
Ensure docker daemon is running and you're logged into docker hub.
7+
`login` · `login-user` · `build` · `build-migrate` · `deploy` · `create` · `destroy` · `promote` · `rollback` · `run` · `scale` · `get-scale` · `env-set` · `find-release` · `get-rack-param` · `rack-param`
8+
9+
## Quick Start
10+
11+
```yaml
12+
# Step 1: Login to Convox (required before any other action)
13+
- uses: beastawakens/action-convox-multi-slim@v1
14+
with:
15+
action: login
16+
password: ${{ secrets.CONVOX_PASSWORD }}
17+
18+
# Step 2: Build your app
19+
- uses: beastawakens/action-convox-multi-slim@v1
20+
id: build
21+
with:
22+
action: build
23+
rack: my-rack
24+
app: my-app
25+
description: "Build ${{ github.sha }}"
26+
27+
# Step 3: Promote the release
28+
- uses: beastawakens/action-convox-multi-slim@v1
29+
with:
30+
action: promote
31+
rack: my-rack
32+
app: my-app
33+
release: ${{ steps.build.outputs.RELEASE }}
34+
```
35+
36+
## Inputs
37+
38+
| Input | Description | Required | Default |
39+
|-------|-------------|----------|---------|
40+
| `action` | Convox command to run (see supported actions above) | Yes | — |
41+
| `password` | Convox deploy key | For `login` | — |
42+
| `host` | Convox Console host address | No | `console.convox.com` |
43+
| `token` | Convox Console token | For `login-user` | — |
44+
| `rack` | Convox Rack name | For most actions | — |
45+
| `app` | Convox app name | For most actions | — |
46+
| `destinationApp` | Destination app name | For `build-migrate` | — |
47+
| `destinationRack` | Destination rack name | For `build-migrate` | — |
48+
| `description` | Build description | No | — |
49+
| `cached` | Use Docker cache during build | No | `true` |
50+
| `manifest` | Custom path for convox.yml | No | — |
51+
| `paramName` | Rack parameter name | For `get-rack-param`, `rack-param` | — |
52+
| `paramValue` | Rack parameter value | For `rack-param` | — |
53+
| `release` | Release ID (auto-detected from prior build step if omitted) | For `promote`, `rollback` | — |
54+
| `service` | Service name | For `run`, `scale`, `get-scale` | — |
55+
| `command` | Command to run | For `run` | — |
56+
| `count` | Instance count to scale to | For `scale` | — |
57+
| `env` | Env vars as `key1=value1 key2=value2` | For `env-set` | — |
58+
59+
## Outputs
60+
61+
| Output | Description | Set by |
62+
|--------|-------------|--------|
63+
| `RELEASE` | Release ID of the created build | `build`, `build-migrate`, `find-release` |
64+
| `DESIRED` | Count of desired instances | `get-scale` |
65+
| `RUNNING` | Count of running instances | `get-scale` |
66+
| `CPU` | CPU scale value | `get-scale` |
67+
| `MEMORY` | Memory scale value | `get-scale` |
68+
| `SCALING_EVENT` | `true` if desired ≠ running | `get-scale` |
69+
| `RUNNING_PROCESSES` | Count of running processes | `get-scale` |
70+
| `PENDING_PROCESSES` | Count of pending processes | `get-scale` |
71+
| `UNHEALTHY_PROCESSES` | Count of unhealthy processes | `get-scale` |
72+
| `PARAM_VALUE` | Rack parameter value | `get-rack-param` |
73+
74+
## Action-by-Action Usage
75+
76+
### login
77+
78+
Stores Convox credentials for subsequent steps. Must be called before any other action.
79+
80+
```yaml
81+
- uses: beastawakens/action-convox-multi-slim@v1
82+
with:
83+
action: login
84+
password: ${{ secrets.CONVOX_PASSWORD }}
85+
host: console.convox.com # optional
86+
```
87+
88+
### login-user
89+
90+
Authenticates an interactive user via token.
91+
92+
```yaml
93+
- uses: beastawakens/action-convox-multi-slim@v1
94+
with:
95+
action: login-user
96+
token: ${{ secrets.CONVOX_TOKEN }}
97+
```
98+
99+
### build
100+
101+
Builds the app and returns the release ID.
102+
103+
```yaml
104+
- uses: beastawakens/action-convox-multi-slim@v1
105+
id: build
106+
with:
107+
action: build
108+
rack: my-rack
109+
app: my-app
110+
description: "Build ${{ github.sha }}"
111+
cached: true # optional, default true
112+
manifest: convox.yml # optional
113+
```
114+
115+
### deploy
116+
117+
Builds and deploys in a single operation (waits for completion).
118+
119+
```yaml
120+
- uses: beastawakens/action-convox-multi-slim@v1
121+
with:
122+
action: deploy
123+
rack: my-rack
124+
app: my-app
125+
description: "Deploy ${{ github.sha }}"
126+
```
127+
128+
### build-migrate
129+
130+
Exports a build from one app/rack and imports it to another.
131+
132+
```yaml
133+
- uses: beastawakens/action-convox-multi-slim@v1
134+
with:
135+
action: build-migrate
136+
rack: source-rack
137+
app: source-app
138+
destinationRack: dest-rack
139+
destinationApp: dest-app
140+
```
141+
142+
### create
143+
144+
Creates a new Convox app.
145+
146+
```yaml
147+
- uses: beastawakens/action-convox-multi-slim@v1
148+
with:
149+
action: create
150+
rack: my-rack
151+
app: my-new-app
152+
```
153+
154+
### destroy
155+
156+
Deletes a Convox app.
157+
158+
```yaml
159+
- uses: beastawakens/action-convox-multi-slim@v1
160+
with:
161+
action: destroy
162+
rack: my-rack
163+
app: my-app
164+
```
165+
166+
### promote
167+
168+
Promotes a release to active.
169+
170+
```yaml
171+
- uses: beastawakens/action-convox-multi-slim@v1
172+
with:
173+
action: promote
174+
rack: my-rack
175+
app: my-app
176+
release: RABCDEF1234 # or auto-detected from prior build step
177+
```
178+
179+
### rollback
180+
181+
Rolls back to a previous release.
182+
183+
```yaml
184+
- uses: beastawakens/action-convox-multi-slim@v1
185+
with:
186+
action: rollback
187+
rack: my-rack
188+
app: my-app
189+
release: RABCDEF1234
190+
```
191+
192+
### run
193+
194+
Runs a one-off command against a service.
195+
196+
```yaml
197+
- uses: beastawakens/action-convox-multi-slim@v1
198+
with:
199+
action: run
200+
rack: my-rack
201+
app: my-app
202+
service: web
203+
command: "rails db:migrate"
204+
release: RABCDEF1234 # optional
205+
```
206+
207+
### scale
208+
209+
Scales a service to a specific instance count.
210+
211+
```yaml
212+
- uses: beastawakens/action-convox-multi-slim@v1
213+
with:
214+
action: scale
215+
rack: my-rack
216+
app: my-app
217+
service: web
218+
count: 3
219+
```
220+
221+
### get-scale
222+
223+
Retrieves current scale information and process status.
224+
225+
```yaml
226+
- uses: beastawakens/action-convox-multi-slim@v1
227+
id: scale-info
228+
with:
229+
action: get-scale
230+
rack: my-rack
231+
app: my-app
232+
service: web
233+
234+
- run: |
235+
echo "Desired: ${{ steps.scale-info.outputs.DESIRED }}"
236+
echo "Running: ${{ steps.scale-info.outputs.RUNNING }}"
237+
echo "Scaling: ${{ steps.scale-info.outputs.SCALING_EVENT }}"
238+
```
239+
240+
### env-set
241+
242+
Sets environment variables on an app.
243+
244+
```yaml
245+
- uses: beastawakens/action-convox-multi-slim@v1
246+
with:
247+
action: env-set
248+
rack: my-rack
249+
app: my-app
250+
env: "KEY1=value1 KEY2=value2"
251+
```
252+
253+
### find-release
254+
255+
Finds the first release matching a description.
256+
257+
```yaml
258+
- uses: beastawakens/action-convox-multi-slim@v1
259+
id: found
260+
with:
261+
action: find-release
262+
rack: my-rack
263+
app: my-app
264+
description: "target-description"
265+
```
266+
267+
### get-rack-param
268+
269+
Retrieves a rack parameter value.
270+
271+
```yaml
272+
- uses: beastawakens/action-convox-multi-slim@v1
273+
id: param
274+
with:
275+
action: get-rack-param
276+
rack: my-rack
277+
paramName: my_param
278+
279+
- run: echo "Value: ${{ steps.param.outputs.PARAM_VALUE }}"
280+
```
281+
282+
### rack-param
283+
284+
Sets a rack parameter value.
285+
286+
```yaml
287+
- uses: beastawakens/action-convox-multi-slim@v1
288+
with:
289+
action: rack-param
290+
rack: my-rack
291+
paramName: my_param
292+
paramValue: new_value
293+
```
294+
295+
## Prerequisites
296+
297+
- A Convox account with a deployed rack
298+
- A Convox deploy key (`password`) or user token (`token`)
299+
- The `login` or `login-user` action must be called before any other action in your workflow
300+
301+
## Releasing a New Version
9302

10303
```sh
11304
export VERSION=v1.x.x
12305
make release
13306
```
14307

308+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development details.
309+
310+
## License
311+
312+
[Mozilla Public License 2.0](LICENSE)
313+

0 commit comments

Comments
 (0)