-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand actions to support Build, Deploy, Run, and Promote (#1)
- Loading branch information
1 parent
7ebe816
commit 9f3bc57
Showing
21 changed files
with
356 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#Github deployer for Convox | ||
|
||
This action allows you to build and deploy apps on Convox | ||
|
||
## Usage | ||
|
||
### Secrets | ||
|
||
### Environment Variables | ||
# Github Actions for Convox | ||
|
||
This repository contains a set of Github Actions to be used with the [Convox](https://convox.com) Platform. If you [Install a Convox Rack](https://github.com/convox/installer) using the cloud provider of your choice and create a [convox.yml](https://docs.convox.com/application/convox-yml) to describe your application and its dependencies you can use these actions to create a complete CI/CD pipeline | ||
|
||
## Actions | ||
### [convox/actions/login](./login) | ||
Authenticates your Convox account You should run this action as the first step in your workflow | ||
### [convox/actions/deploy](./deploy) | ||
Builds and Promotes and App in one step | ||
### [convox/actions/build](./build) | ||
Builds an App and creates a release which can be promoted later | ||
### [convox/actions/run](./run) | ||
Runs a command (such as a migration) using a previously built release before or after it is promoted | ||
### [convox/actions/promote](./promote) | ||
Promotes a release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
LABEL version="1.0.0" | ||
LABEL repository="https://github.com/convox/actions/build" | ||
LABEL homepage="https://convox.com/convox" | ||
LABEL maintainer="Convox <[email protected]>" | ||
|
||
LABEL "com.github.actions.name"="Convox Build" | ||
LABEL "com.github.actions.description"="Build an app to deploy on Convox" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
RUN apt-get -qq update && apt-get -qq -y install curl | ||
|
||
RUN curl -L https://convox.com/cli/linux/convox -o /tmp/convox \ | ||
&& mv /tmp/convox /usr/local/bin/convox \ | ||
&& chmod 755 /usr/local/bin/convox | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Convox Build Action | ||
This Action [builds](https://docs.convox.com/deployment/builds) an app based on a [convox.yml](https://docs.convox.com/application/convox-yml) so that app can be deployed on Convox | ||
|
||
## Inputs | ||
### `rack` | ||
**Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) you wish to build against. | ||
### `app` | ||
**Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to build. | ||
## Outputs | ||
### `release` | ||
The ID of the release that is created when the build completes. | ||
## Example usage | ||
``` | ||
uses: convox/actions/build@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Convox Build | ||
description: Build a Convox app | ||
author: Convox | ||
inputs: | ||
rack: | ||
description: Convox Rack name | ||
required: true | ||
app: | ||
description: Convox app name | ||
required: true | ||
outputs: | ||
release: | ||
description: Release ID of the created build | ||
runs: | ||
using: docker | ||
image: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
echo "Building" | ||
export CONVOX_RACK=$INPUT_RACK | ||
release=$(convox build --app $INPUT_APP --id) | ||
echo ::set-output name=release::$release | ||
echo ::set-env name=RELEASE::$release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
FROM ubuntu:18.04 | ||
|
||
LABEL version="0.1.0" | ||
LABEL repository="http://github.com/convox.actions" | ||
LABEL version="1.0.0" | ||
LABEL repository="https://github.com/convox/actions/deploy" | ||
LABEL homepage="https://convox.com/convox" | ||
LABEL maintainer="Convox <[email protected]>" | ||
|
||
LABEL "com.github.actions.name"="Convox Deploy" | ||
LABEL "com.github.actions.description"="Deploy an app to Convox" | ||
LABEL "com.github.actions.description"="Build and Deploy an app to Convox in one step" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Convox Deploy Action | ||
This Action [Deploys](https://docs.convox.com/introduction/getting-started#deploy-your-application) an app based on a [convox.yml](https://docs.convox.com/application/convox-yml) to Convox. The Deploy action performs the functions of combining the [Build](../build) and [Promote](../promote) actions but in a single step. | ||
|
||
## Inputs | ||
### `rack` | ||
**Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) you wish to deploy to. | ||
### `app` | ||
**Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to deploy to. | ||
|
||
## Example usage | ||
``` | ||
uses: convox/actions/deploy@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Convox Deploy | ||
description: Build and Deploy a Convox app in a single step | ||
author: Convox | ||
inputs: | ||
rack: | ||
description: Convox Rack name | ||
required: true | ||
app: | ||
description: Convox app name | ||
required: true | ||
password: | ||
description: Convox deploy key value | ||
required: false | ||
host: | ||
description: Convox Console host address | ||
required: false | ||
default: console.convox.com | ||
runs: | ||
using: docker | ||
image: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#!/bin/sh | ||
if [ -z "$CONVOX_PASSWORD"] | ||
echo "Deploying" | ||
if [ -n "$INPUT_PASSWORD" ] | ||
then | ||
echo "Convox password must be set" | ||
else | ||
echo "Deploying" | ||
export CONVOX_HOST=$INPUT_CONVOX_HOST | ||
export CONVOX_RACK=$INPUT_CONVOX_RACK | ||
convox deploy --app $INPUT_CONVOX_APP | ||
fi | ||
export CONVOX_PASSWORD=$INPUT_PASSWORD | ||
fi | ||
if [ -n "$INPUT_HOST" ] | ||
then | ||
export CONVOX_HOST=$INPUT_HOST | ||
fi | ||
export CONVOX_RACK=$INPUT_RACK | ||
convox deploy --app $INPUT_APP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
LABEL version="1.0.0" | ||
LABEL repository="https://github.com/convox/actions/login" | ||
LABEL homepage="https://convox.com/convox" | ||
LABEL maintainer="Convox <[email protected]>" | ||
|
||
LABEL "com.github.actions.name"="Convox Login" | ||
LABEL "com.github.actions.description"="Authenticates with your Convox account" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
RUN apt-get -qq update && apt-get -qq -y install curl | ||
|
||
RUN curl -L https://convox.com/cli/linux/convox -o /tmp/convox \ | ||
&& mv /tmp/convox /usr/local/bin/convox \ | ||
&& chmod 755 /usr/local/bin/convox | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Convox Login Action | ||
This Action authenticates your Convox [Deploy Key](https://docs.convox.com/console/deploy-keys). You should perform this action as the first step before any other Convox actions. | ||
|
||
## Inputs | ||
### `password` | ||
**Required** The value of your [Convox Deploy Key](https://docs.convox.com/console/deploy-keys) | ||
### `host` | ||
**Optional** The host name of your [Convox Console](https://docs.convox.com/introduction/console). This defaults to `console.convox.com` and only needs to be overwritten if you have a [self-hosted console](https://docs.convox.com/reference/hipaa-compliance#run-a-private-convox-console) | ||
|
||
## Example usage | ||
``` | ||
uses: convox/actions/login@v1 | ||
with: | ||
password: ${{ secrets.CONVOX_DEPLOY_KEY }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Convox Login | ||
description: Login to Convox | ||
author: Convox | ||
inputs: | ||
password: | ||
description: Convox deploy key value | ||
required: true | ||
host: | ||
description: Convox Console host address | ||
required: false | ||
default: console.convox.com | ||
runs: | ||
using: docker | ||
image: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
echo "Setting login credentials" | ||
echo ::set-env name=CONVOX_PASSWORD::$INPUT_PASSWORD | ||
echo ::set-env name=CONVOX_HOST::$INPUT_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
LABEL version="1.0.0" | ||
LABEL repository="https://github.com/convox/actions/promote" | ||
LABEL homepage="https://convox.com/convox" | ||
LABEL maintainer="Convox <[email protected]>" | ||
|
||
LABEL "com.github.actions.name"="Convox Promote" | ||
LABEL "com.github.actions.description"="Promote a release" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
RUN apt-get -qq update && apt-get -qq -y install curl | ||
|
||
RUN curl -L https://convox.com/cli/linux/convox -o /tmp/convox \ | ||
&& mv /tmp/convox /usr/local/bin/convox \ | ||
&& chmod 755 /usr/local/bin/convox | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Convox Promote Action | ||
This Action [Promotes](https://docs.convox.com/deployment/releases#promoting-a-release) a previously built app to Convox. You will typically need to perform the [Build](../build) action prior to running this action. | ||
|
||
## Inputs | ||
### `rack` | ||
**Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) you wish to deploy to. | ||
### `app` | ||
**Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to deploy. | ||
### `release` | ||
**Optional** The ID of the [release](https://docs.convox.com/deployment/releases) you wish to promote. If you have run a [Build](../build) action as a previous step this step will promote the release created by that build step by default. You only need to set the release if you have not run a build step first or you wish to override the release id from the build step | ||
|
||
## Example usage | ||
``` | ||
steps: | ||
- name: login | ||
uses: convox/actions/login@v1 | ||
with: | ||
password: ${{ secrets.CONVOX_DEPLOY_KEY }} | ||
- name: build | ||
id: build | ||
uses: convox/actions/build@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
- name: promote | ||
uses: convox/actions/promote@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Convox Promote | ||
description: Promote a release | ||
author: Convox | ||
inputs: | ||
rack: | ||
description: Convox Rack name | ||
required: true | ||
app: | ||
description: Convox app name | ||
required: true | ||
release: | ||
description: ID of the release to promote. Only needed if you have not run a build step first or you wish to override the release id from the build | ||
required: false | ||
runs: | ||
using: docker | ||
image: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
#!/bin/sh | ||
if [ -n "$INPUT_RELEASE" ] | ||
then | ||
export RELEASE=$INPUT_RELEASE | ||
fi | ||
if [ -z "$RELEASE" ] | ||
then | ||
echo "Release must either be passed as input or set by running a build step" | ||
exit 1 | ||
else | ||
echo "Promoting Release $RELEASE" | ||
export CONVOX_RACK=$INPUT_RACK | ||
convox releases promote $RELEASE --app $INPUT_APP | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
LABEL version="1.0.0" | ||
LABEL repository="https://github.com/convox/actions/run" | ||
LABEL homepage="https://convox.com/convox" | ||
LABEL maintainer="Convox <[email protected]>" | ||
|
||
LABEL "com.github.actions.name"="Convox Run" | ||
LABEL "com.github.actions.description"="Run a command" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
RUN apt-get -qq update && apt-get -qq -y install curl | ||
|
||
RUN curl -L https://convox.com/cli/linux/convox -o /tmp/convox \ | ||
&& mv /tmp/convox /usr/local/bin/convox \ | ||
&& chmod 755 /usr/local/bin/convox | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Convox Run Action | ||
This Action runs a [One-off Command](https://docs.convox.com/management/one-off-commands) using a specific release of an app on Convox. A typical use case of this action would be to run migrations or a similar pre-deploy or post-deploy command. | ||
|
||
## Inputs | ||
### `rack` | ||
**Required** The name of the [Convox Rack](https://docs.convox.com/introduction/rack) containing the app you wish to run the command against | ||
### `app` | ||
**Required** The name of the [app](https://docs.convox.com/deployment/creating-an-application) you wish to run the command against | ||
### `service` | ||
**Required** The name of the [service](https://docs.convox.com/application/services) to run the command against | ||
### `command` | ||
**Required** The command you wish to run | ||
### `release` | ||
**Optional** The ID of the [release](https://docs.convox.com/deployment/releases) you wish to run the command against. This ID is output as `release` by the [Build](../build) action. Only needed if you have not run a build step first or you wish to override the release id from the build step | ||
## Example usage | ||
``` | ||
steps: | ||
- name: login | ||
uses: convox/actions/login@v1 | ||
with: | ||
password: ${{ secrets.CONVOX_DEPLOY_KEY }} | ||
- name: build | ||
id: build | ||
uses: convox/actions/build@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
- name: run | ||
uses: convox/actions/run@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
service: web | ||
command 'rake db:migrate' | ||
- name: promote | ||
uses: convox/actions/promote@v1 | ||
with: | ||
rack: staging | ||
app: myapp | ||
``` |
Oops, something went wrong.