Skip to content

Commit

Permalink
add drone ci demo
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 committed Jan 20, 2021
1 parent 02ef9bf commit 59142f5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ demo-configfile:
demo-tilt:
scripts/tilt.sh

demo-drone:
scripts/drone.sh

prep:
scripts/prep.sh
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

- [`docker`](https://docs.docker.com/get-docker/)
- [`k3d >= v4.0.0`](https://k3d.io/#installation)
- (optional) [`tilt`](https://docs.tilt.dev/install.html)
- [`kubens`](/~https://github.com/ahmetb/kubectx) callable via the `kubens` binary
- [`chromium`](https://www.chromium.org/Home) callable via the `chromium` binary
- (optional) [`tilt`](https://docs.tilt.dev/install.html)
- (optional) [`drone`](https://docs.drone.io/cli/install/)

## Resources

Expand All @@ -18,7 +19,8 @@
## Run

- Preparation (attention: clears all docker settings!): `make prep`
- Full k3d lifecycle and usage demo: `make demo`
- Multi-Server Setup demo: `make demo-multiserver`
- Config File Demo: `make demo-configfile`
- Demo with Tilt: `make demo-tilt`
- Demo: Full k3d lifecycle and usage with a Python App using hot-reloading of code: `make demo`
- Demo: Multi-Server Setup: `make demo-multiserver`
- Demo: Creating a cluster from a config file: `make demo-configfile`
- Demo: Using k3d with a managed registry and Tilt for app-reloading: `make demo-tilt`
- Demo: Useing k3d as a service in a Drone CI pipeline: `make demo-drone`
14 changes: 14 additions & 0 deletions scripts/drone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
[ -d "$CURR_DIR" ] || { echo "FATAL: no current dir (maybe running in zsh?)"; exit 1; }

# shellcheck source=./common.sh
source "$CURR_DIR/common.sh"

configfile=./ci/k3d-drone.yaml

section "Running Drone pipeline (./.drone.yml, which uses a k3d config)"
log "INFO: This will create a kubeconfig file in your workspace, which will be owned by root (as the Drone CI containers run as root)!\n"
printf "${CYA}********************${END}\n# k3d config file used by Drone CI\n$(cat $configfile)\n${CYA}********************${END}\n"
info_pause_exec "Running drone locally (using docker)" "drone exec --pipeline=main --trusted"

0 comments on commit 59142f5

Please sign in to comment.