Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ jobs:
kubectl describe pods -n k8dev-system -l app.kubernetes.io/name=ingress-nginx-controller
exit 1
}

k8dev install

k8dev create www.domain.dev
k8dev start www.domain.dev
k8dev stop www.domain.dev
k8dev uninstall
echo "yes" | k8dev uninstall

- name: Cleanup
if: always()
Expand Down
27 changes: 5 additions & 22 deletions k8dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,37 +86,20 @@ handle_dependencies() {
local force_update=${1:-false}
local chart_lock="${CHART_DIR}/Chart.lock"
local chart_yaml="${CHART_DIR}/Chart.yaml"
local last_update_mac
local last_update_linux
local last_update
local current_time
local time_diff

if [[ -f "${chart_lock}" ]]; then
last_update_mac=$(stat -f %m "${chart_lock}" 2>/dev/null)
last_update_linux=$(stat -c %Y "${chart_lock}" 2>/dev/null)
last_update=${last_update_mac:-$last_update_linux}

if [[ -n "${last_update}" ]]; then
current_time=$(date +%s)
time_diff=$((current_time - last_update))

if [[ "$force_update" == "true" ]] || [[ $time_diff -gt 86400 ]]; then
output info "Updating Helm repositories..."
helm repo update || output error "Failed to update Helm repositories"
else
output info "Skipping repository update (less than 24h since last update)"
fi
else
output info "Could not determine Chart.lock timestamp, updating repositories..."
if "$force_update" || find "${chart_lock}" -mtime +0 >/dev/null 2>&1; then
output info "Updating Helm repositories..."
helm repo update || output error "Failed to update Helm repositories"
else
output info "Skipping repository update (less than 24h since last update)"
fi
else
output info "No Chart.lock found, updating repositories..."
helm repo update || output error "Failed to update Helm repositories"
fi

if [ ! -d "${CHART_DIR}/charts" ] || [ ! -f "${chart_lock}" ]; then
if [ ! -d "${CHART_DIR}/charts" ] || [ -z "$(ls -A "${CHART_DIR}/charts" 2>/dev/null)" ] || [ ! -f "${chart_lock}" ]; then
output info "Initial dependency build required..."
helm dependency build "${CHART_DIR}" || output error "Failed to build dependencies"
elif [ "${chart_yaml}" -nt "${chart_lock}" ]; then
Expand Down