-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new make target that provisions dagger-ci declaratively
While at it, add help make target & make it the default. This explains all make targets. Run `make help` to see it in action 😉 dagger-ci-pr1499-2022-01-26 API token was added as an AGE secret. It can be accessed only by the intended recipients are able to decrypt it with their private SSH keys. echo "TOKEN" | age -R .age.recipients.txt -o .do.dagger-ci-pr1499-2022-01-26.age Do not assume that /bin/true exists on hosts running Docker. Use "true" and let the system resolve the path. Re-enable all ssh Universe tests. Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
- Loading branch information
Showing
12 changed files
with
233 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,92 @@ | ||
GIT_REVISION := $(shell git rev-parse --short HEAD) | ||
|
||
.PHONY: all | ||
all: dagger | ||
SHELL := bash# we want bash behaviour in all shell invocations | ||
|
||
# https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences | ||
BOLD := \033[1m | ||
NORMAL := \033[0m | ||
GREEN := \033[1;32m | ||
|
||
XDG_CONFIG_HOME ?= $(CURDIR)/.config | ||
export XDG_CONFIG_HOME | ||
.DEFAULT_GOAL := help | ||
HELP_TARGET_DEPTH ?= \# | ||
.PHONY: help | ||
help: # Show how to get started & what targets are available | ||
@printf "This is a list of all the make targets that you can run, e.g. $(BOLD)make dagger$(NORMAL) - or $(BOLD)m dagger$(NORMAL)\n\n" | ||
@awk -F':+ |$(HELP_TARGET_DEPTH)' '/^[0-9a-zA-Z._%-]+:+.+$(HELP_TARGET_DEPTH).+$$/ { printf "$(GREEN)%-20s\033[0m %s\n", $$1, $$3 }' $(MAKEFILE_LIST) | sort | ||
@echo | ||
|
||
GIT_REVISION := $(shell git rev-parse --short HEAD) | ||
.PHONY: dagger | ||
dagger: | ||
dagger: # Build a dev dagger binary | ||
CGO_ENABLED=0 go build -o ./cmd/dagger/ -ldflags '-s -w -X go.dagger.io/dagger/version.Revision=$(GIT_REVISION)' ./cmd/dagger/ | ||
|
||
.PHONY: dagger-debug | ||
dagger-debug: | ||
dagger-debug: # Build a debug version of the dev dagger binary | ||
go build -race -o ./cmd/dagger/dagger-debug -ldflags '-X go.dagger.io/dagger/version.Revision=$(GIT_REVISION)' ./cmd/dagger/ | ||
|
||
.PHONY: install | ||
install: dagger # Build & install a dev dagger binary | ||
go install ./cmd/dagger | ||
|
||
.PHONY: test | ||
test: | ||
test: # Run all tests | ||
go test -race -v ./... | ||
|
||
.PHONY: golint | ||
golint: | ||
golint: # Go lint | ||
golangci-lint run --timeout 3m | ||
|
||
.PHONY: cuefmt | ||
cuefmt: | ||
cuefmt: # Format all cue files | ||
find . -name '*.cue' -not -path '*/cue.mod/*' -print | time xargs -n 1 -P 8 cue fmt -s | ||
|
||
.PHONY: cuelint | ||
cuelint: cuefmt | ||
cuelint: cuefmt # Lint and format all cue files | ||
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)" | ||
|
||
.PHONY: shellcheck | ||
shellcheck: | ||
shellcheck: # Run shellcheck | ||
shellcheck $$(find . -type f \( -iname \*.bats -o -iname \*.bash -o -iname \*.sh \) -not -path "*/node_modules/*" -not -path "*/bats-*/*") | ||
|
||
.PHONY: lint | ||
lint: shellcheck cuelint golint docslint | ||
lint: shellcheck cuelint golint docslint # Lint everything | ||
|
||
.PHONY: integration | ||
integration: core-integration universe-test doc-test | ||
integration: core-integration universe-test doc-test # Run all integration tests | ||
|
||
.PHONY: core-integration | ||
core-integration: dagger-debug | ||
core-integration: dagger-debug # Run core integration tests | ||
yarn --cwd "./tests" install | ||
DAGGER_BINARY="$(shell pwd)/cmd/dagger/dagger-debug" yarn --cwd "./tests" test | ||
|
||
.PHONY: universe-test | ||
universe-test: dagger-debug | ||
universe-test: dagger-debug # Run universe tests | ||
yarn --cwd "./universe" install | ||
DAGGER_BINARY="$(shell pwd)/cmd/dagger/dagger-debug" yarn --cwd "./universe" test | ||
|
||
.PHONY: europa-universe-test | ||
europa-universe-test: dagger-debug | ||
europa-universe-test: dagger-debug # Run Europa universe tests | ||
yarn --cwd "./pkg/universe.dagger.io" install | ||
DAGGER_BINARY="$(shell pwd)/cmd/dagger/dagger-debug" yarn --cwd "./pkg/universe.dagger.io" test | ||
|
||
.PHONY: doc-test | ||
doc-test: dagger-debug | ||
doc-test: dagger-debug # Test docs | ||
yarn --cwd "./docs/learn/tests" install | ||
DAGGER_BINARY="$(shell pwd)/cmd/dagger/dagger-debug" yarn --cwd "./docs/learn/tests" test | ||
|
||
.PHONY: install | ||
install: dagger | ||
go install ./cmd/dagger | ||
|
||
.PHONY: docs | ||
docs: dagger | ||
docs: dagger # Generate docs | ||
./cmd/dagger/dagger doc --output ./docs/reference --format md | ||
|
||
.PHONY: docslint | ||
docslint: docs | ||
docslint: docs # Generate & lint docs | ||
@test -z "$$(git status -s . | grep -e "^ M" | grep docs/reference | cut -d ' ' -f3 | tee /dev/stderr)" | ||
|
||
.PHONY: web | ||
web: | ||
web: # Run the website locally | ||
yarn --cwd "./website" install | ||
yarn --cwd "./website" start | ||
|
||
.PHONY: todo | ||
todo: # Find all TODO items | ||
grep -r -A 1 "TODO:" $(CURDIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://github.com/aluzzardi.keys | ||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdUetLJMkr0Wro7RBRw/AXAx2iFocPgneGe3DHOZ13l | ||
# https://github.com/gerhard.keys | ||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJrIgA2e197dXRzdNKIaI1XZxEpcPMh4kF5xRx/BCU+D | ||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTneuqI8M7q6F/sWEjZcpnHPN4BkerHtTtolZQdeIgP | ||
# https://github.com/grouville.keys | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrh+TE4jbmB/JvCkIA7aZEiuzzOlqN/Vw6y7Y7Vb1T+/vE5ki7n6JRqvPso01mhiXffnFFvyRrgGy/0KY60ZJEglbxcUNdCueq9AcITtrlgEt6Keq8UyuNqfMsEGQ5HUruO+nZxbFD7RxeXLhvrOF17W/yemLiPkZbHx73lHhxWbvHzxVOVGxMJricvG4utULOuRH63VZpov0r0/jd6H8NytNPXWK6dDXyaqQF/CQd45p6TKfn4dyIIewE+Nhc5s8iRXUatzx+6YaN5cWG3MtX0zSxYulclV1pDlk1PBlGm5ja2Ma7s1XwOzqPbowk3UkOVThOlvixaX1PNnyOGKSn | ||
# https://github.com/jlongtine.keys | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwayLK5Ux8bdbY0weVGHVpKX+fyN/vx8HYuiJq9XHLkB6SKrBstAwIuDhhquMrY/oLJiPzevB1AI+KthlAmjUXOGE90KSXTkIfOVwSEhcF6RjgzlZrIKQlI+WhmBxuZK93B8wkNV5RsmtMY3aKBAmoRVzDlBLpGRknzUx2VpBIop1JuCVlB3mFK0TJruz631UVsXb1vsVxkVzKQC4GYnF7rAWKCxDRuHaU6QDQ5S95SQAoD/DNQZWm2IPEX+RGIkbFMG0EJQpU46SlPog+XEDarm1MnhIUmnscdV6duASQAd/HdqckL1oIcrYqgx1x6tFab9/UF4Ieiazay7EGaMqLsVYE/im+mVWUOnrHfySlHNkVc9PikAbsxN1m5RSAK0luSIMOX4rHrNRZWPGPookyfZl+G2Ub7OBCI8VkwVgg4WvUB5yJ52x+3liKKmetJ/gc7yxrjogt28p0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TUPZr6D23nRnFkBnC1G6DwHL64eW0lkfPeoS7+Vb09cyP3GifHkKxP0JiBqmRt7KmtCDcIwCEUP8oGV3fCZTOMHNVMtaucehS7kmJUq/VGhk+soPgyb4Ii/7I2XUm1eCoAlUyJz8qfF7xDyAGfZWu/et5ggVl3UCj47Gi3z3+s02enSCdpPSuskm+qCmNdor6ThKSe5PjAuiwXIdhtziDb1DVPRKaaXapHVV3RWuO0tjbb9bJ1B5JvE+6mdVaCg6PBwMJcY9NcDO3xx6ATxJ9Bvg53WxogKdSjqYMhCPsGd08/PihEyWe/pXWDCFsg5hbmKqsB5p857nsLbxjmW9M8EM/Ti2j5X+PBh7H76KC324U= | ||
# https://github.com/talentedmrjones.keys | ||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII4t9Xg9prIa9COG7t19FcNW5pordCM/W+x9le+NcGJm |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
SHELL := bash# we want bash behaviour in all shell invocations | ||
PLATFORM := $(shell uname) | ||
platform := $(shell uname | tr A-Z a-z) | ||
architecture := $(shell uname -m) | ||
ifeq ($(architecture),x86_64) | ||
architecture_alt := amd64 | ||
endif | ||
|
||
# https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences | ||
BOLD := \033[1m | ||
NORMAL := \033[0m | ||
RED := \033[1;31m | ||
GREEN := \033[1;32m | ||
|
||
LOCAL_BIN := $(CURDIR)/bin | ||
$(LOCAL_BIN): | ||
mkdir -p $(LOCAL_BIN) | ||
|
||
XDG_CONFIG_HOME ?= $(CURDIR)/.config | ||
export XDG_CONFIG_HOME | ||
.DEFAULT_GOAL := help | ||
HELP_TARGET_DEPTH ?= \# | ||
.PHONY: help | ||
help: # Show how to get started & what targets are available | ||
@printf "\nIf this is your first time running this, remember to run: $(BOLD)make .env && source .env$(NORMAL)\n" | ||
@printf "This is a list of all the make targets that you can run, e.g. $(BOLD)make dagger$(NORMAL) - or $(BOLD)m dagger$(NORMAL)\n\n" | ||
@awk -F':+ |$(HELP_TARGET_DEPTH)' '/^[0-9a-zA-Z._%-]+:+.+$(HELP_TARGET_DEPTH).+$$/ { printf "$(GREEN)%-20s\033[0m %s\n", $$1, $$3 }' $(MAKEFILE_LIST) | sort | ||
@echo | ||
|
||
.PHONY: env | ||
env:: # Print all env variables | ||
@echo 'alias m=make' | ||
@echo 'export PATH="$(LOCAL_BIN):$$PATH"' | ||
@echo 'export XDG_CONFIG_HOME="$(XDG_CONFIG_HOME)"' | ||
|
||
.env: # Create the .env file - 💡 use the -B flag to re-create | ||
$(MAKE) --no-print-directory env > .env | ||
|
||
# Every system has curl installed here: | ||
CURL ?= /usr/bin/curl | ||
|
||
AGE := $(LOCAL_BIN)/age | ||
AGE_RELEASES := https://github.com/FiloSottile/age/releases | ||
AGE_VERSION := 1.0.0 | ||
AGE_BIN_DIR := $(LOCAL_BIN)/age-v$(AGE_VERSION)-$(platform)-$(architecture_alt) | ||
AGE_URL := $(AGE_RELEASES)/download/v$(AGE_VERSION)/$(notdir $(AGE_BIN_DIR)).tar.gz | ||
AGE := $(AGE_BIN_DIR)/age/age | ||
$(AGE): | $(CURL) $(LOCAL_BIN) | ||
$(CURL) --progress-bar --fail --location --output $(AGE_BIN_DIR).tar.gz "$(AGE_URL)" | ||
mkdir -p $(AGE_BIN_DIR) && tar zxf $(AGE_BIN_DIR).tar.gz -C $(AGE_BIN_DIR) | ||
touch $(AGE) | ||
chmod +x $(AGE) | ||
$(AGE) --version | grep $(AGE_VERSION) | ||
ln -sf $(AGE) $(LOCAL_BIN)/age | ||
.PHONY: age | ||
age: $(AGE) | ||
|
||
define get_github_keys_for_age_recipient | ||
@printf "Configuring $(BOLD)$(1)$(NORMAL) as an age recipient...\n" | ||
@echo "# $(1)" >> $(@) | ||
@$(CURL) --silent --fail --location $(1) >> $(@) | ||
endef | ||
.age.recipients.txt: | $(CURL) # Generate all AGE recipients from GitHub keys | ||
$(call get_github_keys_for_age_recipient,https://github.com/aluzzardi.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/gerhard.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/grouville.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/jlongtine.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/samalba.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/shykes.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/slumbering.keys) | ||
$(call get_github_keys_for_age_recipient,https://github.com/talentedmrjones.keys) | ||
|
||
DOCTL := $(LOCAL_BIN)/age | ||
DOCTL_RELEASES := https://github.com/digitalocean/doctl/releases | ||
DOCTL_VERSION := 1.69.0 | ||
DOCTL_BIN_DIR := $(LOCAL_BIN)/doctl-$(DOCTL_VERSION)-$(platform)-$(architecture_alt) | ||
DOCTL_URL := $(DOCTL_RELEASES)/download/v$(DOCTL_VERSION)/$(notdir $(DOCTL_BIN_DIR)).tar.gz | ||
DOCTL := $(DOCTL_BIN_DIR)/doctl | ||
$(DOCTL): | $(CURL) $(LOCAL_BIN) | ||
$(CURL) --progress-bar --fail --location --output $(DOCTL_BIN_DIR).tar.gz "$(DOCTL_URL)" | ||
mkdir -p $(DOCTL_BIN_DIR) && tar zxf $(DOCTL_BIN_DIR).tar.gz -C $(DOCTL_BIN_DIR) | ||
touch $(DOCTL) | ||
chmod +x $(DOCTL) | ||
$(DOCTL) version | grep $(DOCTL_VERSION) | ||
ln -sf $(DOCTL) $(LOCAL_BIN)/doctl | ||
.PHONY: doctl | ||
doctl: $(DOCTL) | ||
ifndef DIGITALOCEAN_ACCESS_TOKEN | ||
@printf "\n$(RED)DIGITALOCEAN_ACCESS_TOKEN $(BOLD)env var is missing$(NORMAL)\n" | ||
@printf "\nIf your private SSH key is in the $(BOLD).age.recipients.txt$(NORMAL) file, you can do the following:\n" | ||
@printf "$(BOLD)export DIGITALOCEAN_ACCESS_TOKEN=\$$(age -d -i ~/.ssh/$(GREEN)YOUR_SSH_PRIVATE_KEY$(NORMAL)$(BOLD) .do.dagger-ci-pr1499-2022-01-26.age)$(NORMAL)\n" | ||
@printf "\nReplace $(BOLD)$(GREEN)YOUR_SSH_PRIVATE_KEY$(NORMAL) with the name of your private SSH key\n\n" | ||
@exit 1 | ||
endif | ||
|
||
DAGGER_CI_NAME ?= dagger-ci-2022-01-26 | ||
.PHONY: dagger-ci | ||
dagger-ci: | $(AGE) doctl # Create dagger-ci | ||
$(DOCTL) compute droplet create \ | ||
--image debian-11-x64 \ | ||
--size s-1vcpu-1gb-intel \ | ||
--region nyc1 \ | ||
--enable-monitoring \ | ||
--ssh-keys 32985130,32968299,32835944,23961075,23698535 \ | ||
--user-data-file ./dagger-ci.cloudinit \ | ||
$(DAGGER_CI_NAME) | ||
|
||
.PHONY: dagger-ci-ssh | ||
dagger-ci-ssh: | $(AGE) doctl # SSH into dagger-ci | ||
$(DOCTL) compute ssh $(DAGGER_CI_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#cloud-config | ||
write_files: | ||
- path: /etc/nixos/host.nix | ||
permissions: '0644' | ||
content: | | ||
{pkgs, ...}: | ||
{ | ||
environment.systemPackages = with pkgs; [ | ||
git | ||
htop | ||
nix-diff | ||
nixfmt | ||
nvd | ||
tmux | ||
vim | ||
]; | ||
services.do-agent.enable = true; | ||
virtualisation.docker.package = pkgs.docker_20_10; | ||
virtualisation.docker.enable = true; | ||
virtualisation.docker.autoPrune.enable = true; | ||
virtualisation.docker.autoPrune.dates = "daily"; | ||
users.users.root.openssh.authorizedKeys.keys = [ | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAl40j8zO5APwryoo8Ai0GiHkKWPA6MxPPVjEB6Rc1bm dagger-ci@2022_01_26" | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHUK9LTCmlmqHQahsqtUTTWfuKkdxrh80hkpasdI+PEo dagger-ci-pass@2022_01_26" | ||
]; | ||
} | ||
runcmd: | ||
- curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=digitalocean NIXOS_IMPORT=./host.nix NIX_CHANNEL=nixos-21.11 bash 2>&1 | tee /tmp/nixos-infect.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.