Skip to content

Commit

Permalink
Prep for docs pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kgaughan committed Sep 21, 2024
1 parent 82bbe71 commit a40b855
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: true

- run: |
make mock
make mocks
- uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*.zip
.DS_Store
*.bak
/site
63 changes: 53 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,62 @@
VERSION:=unknown
NAME:=gcredstash

all: gcredstash
SOURCE:=$(wildcard internal/*.go internal/*/*.go cmd/*/*.go)
DOCS:=$(wildcard docs/*.md mkdocs.yml)

gcredstash:
CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w -X github.com/kgaughan/gcredstash/internal.Version=$(VERSION)" -tags netgo -o $@ ./cmd/$@
.PHONY: build
build: go.mod $(NAME)

test:
go test -cover -v ./...
.PHONY: tidy
tidy: go.mod fmt

.PHONY: clean
clean:
rm -rf gcredstash *.gz *.zip dist/
rm -rf $(NAME) dist site

$(NAME): $(SOURCE) go.sum
CGO_ENABLED=0 go build -v -tags netgo -trimpath -ldflags '-s -w' -o $@ ./cmd/$@

.PHONY: update
update:
go get -u ./...
go mod tidy

go.sum: go.mod
go mod verify
@touch go.sum

go.mod: $(SOURCE)
go mod tidy

.PHONY: fmt
fmt:
go fmt ./...

.PHONY: lint
lint:
go vet ./...

mock:
.PHONY: serve-docs
serve-docs: .venv
.venv/bin/mkdocs serve

.PHONY: docs
docs: .venv $(DOCS)
.venv/bin/mkdocs build

.venv: requirements.txt
uv venv
uv pip install -r requirements.txt

%.txt: %.in
uv pip compile $< > $@

.PHONY: tests
tests:
go test -cover -v ./...

.PHONY: mocks
mocks:
go install go.uber.org/mock/[email protected]
mockgen -package mockaws -destination internal/mockaws/dynamodbmock.go github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface DynamoDBAPI
mockgen -package mockaws -destination internal/mockaws/kmsmock.go github.com/aws/aws-sdk-go/service/kms/kmsiface KMSAPI

.PHONY: all test clean mock
26 changes: 26 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Commands

```
gcredstash manages credentials using AWS Key Management Service (KMS) and DynamoDB
Usage:
gcredstash [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
delete Delete a credential from the store
get Get a credential from the store
getall Get all credentials from the store
help Help about any command
list List credentials and their version
put Put a credential into the store
setup Setup the credential store
template Parse a template file with credentials
Flags:
-h, --help help for gcredstash
-t, --table string DynamoDB table to use for credential storage (default "credential-store")
-v, --version version for gcredstash
Use "gcredstash [command] --help" for more information about a command.
```
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello. world!
13 changes: 13 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
site_name: gcredstash
repo_url: https://github.com/kgaughan/gcredstash/
theme:
name: material

markdown_extensions:
admonition: {}
attr_list: {}

nav:
- commands.md
- configuration.md
3 changes: 3 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdocs
mkdocs-material
mkdocs-awesome-pages-plugin
84 changes: 84 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in
babel==2.16.0
# via mkdocs-material
bracex==2.5
# via wcmatch
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via mkdocs
colorama==0.4.6
# via mkdocs-material
ghp-import==2.1.0
# via mkdocs
idna==3.10
# via requests
jinja2==3.1.4
# via
# mkdocs
# mkdocs-material
markdown==3.7
# via
# mkdocs
# mkdocs-material
# pymdown-extensions
markupsafe==2.1.5
# via
# jinja2
# mkdocs
mergedeep==1.3.4
# via
# mkdocs
# mkdocs-get-deps
mkdocs==1.6.1
# via
# -r requirements.in
# mkdocs-awesome-pages-plugin
# mkdocs-material
mkdocs-awesome-pages-plugin==2.9.3
# via -r requirements.in
mkdocs-get-deps==0.2.0
# via mkdocs
mkdocs-material==9.5.36
# via -r requirements.in
mkdocs-material-extensions==1.3.1
# via mkdocs-material
natsort==8.4.0
# via mkdocs-awesome-pages-plugin
packaging==24.1
# via mkdocs
paginate==0.5.7
# via mkdocs-material
pathspec==0.12.1
# via mkdocs
platformdirs==4.3.6
# via mkdocs-get-deps
pygments==2.18.0
# via mkdocs-material
pymdown-extensions==10.9
# via mkdocs-material
python-dateutil==2.9.0.post0
# via ghp-import
pyyaml==6.0.2
# via
# mkdocs
# mkdocs-get-deps
# pymdown-extensions
# pyyaml-env-tag
pyyaml-env-tag==0.1
# via mkdocs
regex==2024.9.11
# via mkdocs-material
requests==2.32.3
# via mkdocs-material
six==1.16.0
# via python-dateutil
urllib3==2.2.3
# via requests
watchdog==5.0.2
# via mkdocs
wcmatch==9.0
# via mkdocs-awesome-pages-plugin

0 comments on commit a40b855

Please sign in to comment.