Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: beastawakens/action-convox-multi-slim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.15
Choose a base ref
...
head repository: beastawakens/action-convox-multi-slim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 7 commits
  • 6 files changed
  • 1 contributor

Commits on Oct 7, 2024

  1. Release v1.0.16

    beastawakens committed Oct 7, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    eaca627 View commit details
  2. Release v1.0.17

    beastawakens committed Oct 7, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    f5c48b1 View commit details

Commits on Nov 2, 2024

  1. Release v1.0.18

    beastawakens committed Nov 2, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    db749f0 View commit details
  2. Release v1.0.19

    beastawakens committed Nov 2, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    d73a2df View commit details

Commits on Nov 6, 2024

  1. Release v1.0.20

    beastawakens committed Nov 6, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    52e0fc2 View commit details

Commits on Dec 14, 2024

  1. Release v1.0.21

    beastawakens committed Dec 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    398faf1 View commit details

Commits on Dec 16, 2024

  1. Release v1.0.22

    beastawakens committed Dec 16, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    beastawakens Ed Fricker
    Copy the full SHA
    78a9df8 View commit details
Showing with 71 additions and 4 deletions.
  1. +1 −1 Dockerfile
  2. +13 −1 action.yml
  3. +18 −0 entrypoint-find-release.sh
  4. +29 −0 entrypoint-get-scale.sh
  5. +4 −2 entrypoint-run.sh
  6. +6 −0 entrypoint.sh
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

LABEL version="v1.0.15"
LABEL version="v1.0.22"
LABEL repository="https://github.com/beastawakens/action-convox-multi-slim"
LABEL homepage="https://convox.com/"
LABEL maintainer="Beast Awakens <me@beastawakens.com>"
14 changes: 13 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@ inputs:
- create
- deploy
- destroy
- find-release
- get-scale
- login
- login-user
- promote
@@ -56,6 +58,16 @@ inputs:
outputs:
release:
description: Release ID of the created build
desired:
description: Count of desired instances
running:
description: Count of running instances
cpu:
description: CPU scale value
memory:
description: Memory scale value
scaling_event:
description: Boolean value to indicate if a scaling event is in progress
runs:
using: 'docker'
image: 'docker://beastawakens/action-convox-multi-slim:v1.0.15'
image: 'docker://beastawakens/action-convox-multi-slim:v1.0.22'
18 changes: 18 additions & 0 deletions entrypoint-find-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
#!/bin/sh
if [ -n "$INPUT_DESCRIPTION" ]
then
export DESCRIPTION=$INPUT_DESCRIPTION
fi
if [ -z "$DESCRIPTION" ]
then
echo "Description must be passed as input"
exit 1
else
echo "Finding first release with description $DESCRIPTION for $INPUT_APP on $INPUT_RACK"
export CONVOX_RACK=$INPUT_RACK
release=$(convox releases $RELEASE --app $INPUT_APP --limit 100 | grep $DESCRIPTION | awk 'NR==1 {print $1}')
fi

echo "RELEASE=$release" >> $GITHUB_OUTPUT
echo "RELEASE=$release" >> $GITHUB_ENV
29 changes: 29 additions & 0 deletions entrypoint-get-scale.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

echo "Retrieving scale for $INPUT_SERVICE - $INPUT_APP"
output=$(convox scale --app $INPUT_APP --rack $INPUT_RACK | awk -v service="$INPUT_SERVICE" '$1 == service {print}')

# Parse the values using awk
desired=$(echo "$output" | awk '{print $2}')
running=$(echo "$output" | awk '{print $3}')
cpu=$(echo "$output" | awk '{print $4}')
memory=$(echo "$output" | awk '{print $5}')

# If the desired value is different from the running value, set SCALING_EVENT to true
if [ "$desired" -ne "$running" ]
then
echo "SCALING_EVENT=true" >> $GITHUB_OUTPUT
echo "SCALING_EVENT=true" >> $GITHUB_ENV
else
echo "SCALING_EVENT=false" >> $GITHUB_OUTPUT
echo "SCALING_EVENT=false" >> $GITHUB_ENV
fi

echo "DESIRED=$desired" >> $GITHUB_OUTPUT
echo "DESIRED=$desired" >> $GITHUB_ENV
echo "RUNNING=$running" >> $GITHUB_OUTPUT
echo "RUNNING=$running" >> $GITHUB_ENV
echo "CPU=$cpu" >> $GITHUB_OUTPUT
echo "CPU=$cpu" >> $GITHUB_ENV
echo "MEMORY=$memory" >> $GITHUB_OUTPUT
echo "MEMORY=$memory" >> $GITHUB_ENV
6 changes: 4 additions & 2 deletions entrypoint-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
set -x

if [ -n "$INPUT_RELEASE" ]
then
export RELEASE=$INPUT_RELEASE
@@ -8,8 +10,8 @@ export CONVOX_RACK=$INPUT_RACK
if [ -n "$RELEASE" ]
then
echo "Running command on $INPUT_SERVICE - $INPUT_APP for the release $RELEASE"
convox run $INPUT_SERVICE "$INPUT_COMMAND" --release $RELEASE --app $INPUT_APP --rack $INPUT_RACK | tee /dev/stdout
convox run $INPUT_SERVICE "$INPUT_COMMAND" --release $RELEASE --app $INPUT_APP --rack $INPUT_RACK 2>&1 | tee /dev/stdout
else
echo "Running command on $INPUT_SERVICE - $INPUT_APP for the latest release"
convox run $INPUT_SERVICE "$INPUT_COMMAND" --app $INPUT_APP --rack $INPUT_RACK | tee /dev/stdout
convox run $INPUT_SERVICE "$INPUT_COMMAND" --app $INPUT_APP --rack $INPUT_RACK 2>&1 | tee /dev/stdout
fi
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -20,6 +20,12 @@ case "$value" in
"destroy")
/entrypoint-destroy.sh
;;
"find-release")
/entrypoint-find-release.sh
;;
"get-scale")
/entrypoint-get-scale.sh
;;
"login")
/entrypoint-login.sh
;;