Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
validate makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat authored Jan 22, 2024
1 parent c454bdc commit 8aabd6c
Showing 1 changed file with 50 additions and 54 deletions.
104 changes: 50 additions & 54 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,83 @@ DOCKER_IMAGE_NAME := "ghcr.io/${KONDUCTOR_NAME}:latest"
# This section provides a default help message displaying all available commands
help:
@echo "Available commands:"
@echo " devcontainer-update Update the .github/devcontainer submodule"
@echo " pulumi-login Log in to Pulumi"
@echo " esc-run Run a Pulumi ESC environment"
@echo " pulumi-up Deploy Pulumi infrastructure"
@echo " act Install the GitHub 'gh-act' extension"
@echo " login Log in to Pulumi"
@echo " esc-env Run a Pulumi ESC environment"
@echo " up Deploy Pulumi infrastructure"
@echo " kind Deploy a local kubernetes cluster using Kind Kubernetes-in-Docker"
@echo " act Test GitHub Actions locally"
@echo " devcontainer Update the .github/devcontainer submodule"
@echo " test Run all tests"

# --- Docker Build ---
# Build the Docker image
docker-build:
@echo "Building Docker image..."
clear
docker build --progress plain --pull --build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" --tag ${DOCKER_IMAGE_NAME} -f ./docker/Dockerfile ./docker
@echo "Docker image built."

# --- Docker Build & Push ---
# Build the Docker image
docker-build-push:
@echo "Building Docker image & pushing to ${DOCKER_IMAGE_NAME}..."
clear
docker build --progress plain --push --pull --tag ${DOCKER_IMAGE_NAME} -f ./docker/Dockerfile ./docker
@echo "Docker published to ${DOCKER_IMAGE_NAME}..."

# --- GitHub Actions ---
# Install & Run the GitHub 'gh-act' extension for local testing of GitHub Actions
act:
@echo "Test Github Workflows."
gh act -s GITHUB_TOKEN=${GITHUB_TOKEN} -s ACTIONS_RUNTIME_TOKEN=${GITHUB_TOKEN} -s GHA_GITHUB_TOKEN=${GITHUB_TOKEN}
@echo "Github Workflow Complete."

# --- Pulumi Commands ---
# Log in to Pulumi
pulumi-login:
login:
@echo "Logging in to Pulumi..."
direnv allow
pulumi login
@echo "Login successful."

# Deploy Pulumi infrastructure
pulumi-up:
@echo "Deploying Pulumi infrastructure..."
pulumi up --stack $(PULUMI_STACK)
@echo "Deployment complete."

# Run a Pulumi ESC environment
pulumi-esc-env:
esc-env:
@echo "Running Pulumi ESC environment..."
# Replace the below command with the actual command to run the Pulumi ESC environment
pulumi esc env open --stack $(PULUMI_STACK)
@echo "Pulumi ESC environment running."

# --- Devcontainer Management ---
# Update the .github/devcontainer submodule
update-devcontainer:
@echo "Updating .github/devcontainer submodule..."
git submodule update --init --recursive .github/devcontainer
@echo "Update complete."

# --- Testing ---
# Add your testing scripts here
test:
@echo "Running tests..."
# Add commands to run your tests
@echo "Testing complete."
# Deploy Pulumi infrastructure
up:
@echo "Deploying Pulumi infrastructure..."
clear
pulumi up --stack $(PULUMI_STACK)
@echo "Deployment complete."

# --- Kind ---
# Kind Create Cluster
kind:
@echo "Creating Kind Cluster..."
mkdir .kube
docker volume create cilium-worker-n01
docker volume create cilium-worker-n02
docker volume create cilium-control-plane-n01
kind create cluster --config hack/kind.yaml
direnv allow
kind create cluster
kind get kubeconfig > $KUBECONFIG
kubectl get po -A
@echo "Kind Cluster Created."

# --- GitHub Actions ---
# Install & Run the GitHub 'gh-act' extension for local testing of GitHub Actions
act:
@echo "Test Github Workflows."
clear
act -s GITHUB_TOKEN=${GITHUB_TOKEN} -s ACTIONS_RUNTIME_TOKEN=${GITHUB_TOKEN} -s GHA_GITHUB_TOKEN=${GITHUB_TOKEN}
@echo "Github Workflow Complete."

# --- Docker Build ---
# Build the Docker image
build:
@echo "Building Docker image..."
clear
docker build --progress plain --pull --build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" --tag ${DOCKER_IMAGE_NAME} -f ./docker/Dockerfile ./docker
@echo "Docker image built."

# --- Docker Build & Push ---
# Build the Docker image
build-push:
@echo "Building Docker image & pushing to ${DOCKER_IMAGE_NAME}..."
clear
docker build --progress plain --push --pull --tag ${DOCKER_IMAGE_NAME} -f ./docker/Dockerfile ./docker
@echo "Docker published to ${DOCKER_IMAGE_NAME}..."

# --- Default Command ---
devcontainer::
git submodule update --init --recursive .github/devcontainer
git submodule update --remote --merge .github/devcontainer
rsync -av .github/devcontainer/devcontainer/* .devcontainer

# --- Testing ---
# Add your testing scripts here
test:
@echo "Running tests..."
# Add commands to run your tests
@echo "Testing complete."

# --- Default Command ---
# Default command when running 'make' without arguments
all: help

0 comments on commit 8aabd6c

Please sign in to comment.