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

Commit

Permalink
layout redesign for modular support
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat authored Jan 22, 2024
1 parent f90507a commit 84e701c
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 99 deletions.
1 change: 0 additions & 1 deletion .devcontainer.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ~$ gh extension install nektos/gh-act
# ~$ gh act --env-file .env -s GITHUB_TOKEN=$GITHUB_TOKEN -s PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN

name: Pulumi Devcontainer Build Status
name: Pulumi Devcontainer Build
on:
workflow_dispatch:
push:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.pulumi/*
.kube/*
frontmatter.json
94 changes: 94 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# --- Global Variables ---
PULUMI_STACK := echo ${GITHUB_REPOSITORY} | awk -F '[/]' '{print $2}'
GITHUB_REPOSITORY_STRING := $(shell echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]')
KONDUCTOR_NAME ?= $(if ${GITHUB_REPOSITORY_STRING},${GITHUB_REPOSITORY_STRING},pulumi/devcontainer)
DOCKER_IMAGE_NAME := "ghcr.io/${KONDUCTOR_NAME}:latest"

# --- Help ---
# 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 " 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:
@echo "Logging in to Pulumi..."
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:
@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."

# --- 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
@echo "Kind Cluster Created."

# --- Default Command ---
devcontainer::
git submodule update --init --recursive .github/devcontainer
git submodule update --remote --merge .github/devcontainer
cp .devcontainer/devcontainer.json .devcontainer.json

# --- Default Command ---
# Default command when running 'make' without arguments
all: help
5 changes: 0 additions & 5 deletions Makefile.example

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[![License](https://img.shields.io/github/license/usrbinkat/iac-mesh-pac)]() [![Pulumi](https://img.shields.io/badge/pulumi-v3.102.0-blueviolet)](https://www.pulumi.com/docs/get-started/install/) [![Kubectl](https://img.shields.io/badge/kubectl-v1.26.13-blueviolet)](https://kubernetes.io/docs/tasks/tools/install-kubectl/) [![Docker](https://img.shields.io/badge/docker-v25.0.0-blueviolet)](https://docs.docker.com/get-docker/) [![Kind](https://img.shields.io/badge/kind-v0.20.0-blueviolet)](https://kind.sigs.k8s.io/docs/user/quick-start/) [![Helm](https://img.shields.io/badge/helm-v3.14.0-blueviolet)](https://helm.sh/docs/intro/install/)

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/pulumi/devcontainer?quickstart=1)

[![Pulumi Devcontainer Build Status](https://github.com/pulumi/devcontainer/actions/workflows/build.yaml/badge.svg)](https://github.com/pulumi/devcontainer/actions/workflows/build.yaml)

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/pulumi/devcontainer?quickstart=1)

This is a [Github Template Repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) which provides a Pulumi [Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) together with GitOps ready boilerplate for quickly starting new Pulumi IaC projects.

The Pulumi [Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) is designed with deep [VS Code](https://code.visualstudio.com) and [Github Codespaces](https://github.com/features/codespaces) integration to streamline a common Pulumi IaC and Provider development environment. dependencies and prerequisites as much as possible using [Dev Containers](https://containers.dev/) to prepare your development environment, or even just run your development directly in the browser with [Github CodeSpaces](https://github.com/features/codespaces).
Expand Down
87 changes: 0 additions & 87 deletions containers/kind/devcontainer.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions frontmatter.json

This file was deleted.

0 comments on commit 84e701c

Please sign in to comment.