Skip to content

Commit

Permalink
Add in Actions and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
spjmurray committed Apr 16, 2024
1 parent 86fc932 commit 55e838c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Request
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
Static:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Shellcheck
uses: ludeeus/action-shellcheck@master
5 changes: 4 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
#
# NOTE: must be run from the compenent's root directory.

make images-kind-load VERSION=$(cat charts/$(ls charts)/Chart.yaml | yq .version)
CHART="$(ls charts)"
CHART_META="charts/${CHART}/Chart.yaml"

make images-kind-load VERSION="$(yq .version "${CHART_META}")"
3 changes: 2 additions & 1 deletion clean-images
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# Removes any dangling docker images, or which there will be many.

docker rmi $(docker images -f dangling=true | grep -e \^\< | awk '{ print $3; }')
# shellcheck disable=SC2046
docker rmi $(docker images -f dangling=true | grep -e ^\< | awk '{ print $3; }')
8 changes: 4 additions & 4 deletions deploy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# NOTE: must be run from the compenent's root directory.

# Grab the repository.
REPO=$(basename $(pwd))
REPO=$(basename "$(pwd)")

# Get the environemnt.
# TODO: getopts
Expand Down Expand Up @@ -43,7 +43,7 @@ CRDDIR="${CHARTDIR}/crds"

# Update CRDs if necessary, helm won't do this for you.
if [[ -d ${CRDDIR} ]]; then
kubectl apply -f ${CRDDIR}
kubectl apply -f "${CRDDIR}"
fi

ARGS=()
Expand All @@ -52,8 +52,8 @@ ARGS=()
VALUESFILE="${HOME}/.config/unikorn/${ENVIRONMENT}/${REPO}.yaml"

if [[ -f ${VALUESFILE} ]]; then
ARGS+=("-f" ${VALUESFILE})
ARGS+=("-f" "${VALUESFILE}")
fi

# Deploy the actual chart.
helm upgrade --install --create-namespace -n ${NAMESPACE} ${RELEASE} ${CHARTDIR} ${ARGS[@]}
helm upgrade --install --create-namespace -n ${NAMESPACE} ${RELEASE} "${CHARTDIR}" "${ARGS[@]}"
2 changes: 1 addition & 1 deletion restart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# NOTE: must be run from the compenent's root directory.

# Grab the repository.
REPO=$(basename $(pwd))
REPO=$(basename "$(pwd)")

# Do any specializations.
case ${REPO} in
Expand Down
3 changes: 2 additions & 1 deletion ui-preview
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ if [[ ! -f ${ENVFILE} ]]; then
fi

set -a
source ${ENVFILE}
# shellcheck disable=SC1090
source "${ENVFILE}"
set +a

npm run dev

0 comments on commit 55e838c

Please sign in to comment.