Skip to content

Commit

Permalink
Add in Actions and CI (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
spjmurray authored Apr 16, 2024
1 parent 86fc932 commit 00c1c7f
Show file tree
Hide file tree
Showing 7 changed files with 33 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ Test a functional change:
```shell
build && restart
```

## Contribution

Be aware you need to run `shellcheck` and pass before acceptance.
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 00c1c7f

Please sign in to comment.