Git hook triggered via local commit or Gitea's one. It runs Hugo against its dedicated repository with Markdown files and related assets.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Marcell Mars 7b913ab8ee self-destructing install script for gitea 3 years ago
vendor initial commit with go vendor and compiled binary 3 years ago
README.md minor 3 years ago
go.mod initial commit with go vendor and compiled binary 3 years ago
go.sum initial commit with go vendor and compiled binary 3 years ago
install_sphook.sh self-destructing install script for gitea 3 years ago
main.go spelling error.. 3 years ago
sphook build after spelling error 3 years ago

README.md

this repo was initialized and `sphook` binary built like this:
```
go mod init main
go mod vendor
go build -o sphook .
```

the `sphook` executable in the root repo is built on linux 64bits computer. it should work on common linux x86_64 virtual server or common linux x86_64 bare metal computer.

it has hardcoded filepath for Hugo's final output directory:

```
/var/www/html/sandpoints
```

it should work for two scenarios:  
- _bare_ git repository and in our case we always run it against the `gitea` instances (git web frontend).
- _working_ git repository and in our case that's usually a git repository running on some local instance (e.g. developer's laptop)

1) in _bare_ git repository scenario it should work as a post-receive hook
2) in _working_ git repository scenario it should work as a post-commit hook

regarding scenarion `sphook` will be renamed into `.git/hooks/post-commit`, `gitea_repo.git/hooks/post-received.d/sphook` or whatever is prepared/set in `.git/hooks` directory to trigger an executable after the specific hook.

its task is simple: it takes content from `content/` directory and run `hugo` against it. it places the output into:

```
/var/www/html/sandpoints/{hugo_project_name}-{`crc32.ChecksumIEEE(git_repo_path)`}
```

it is good to check out the logs of git commit in order to find the path of that directory. once that's done logs will be placed in both:
```
/var/www/html/sandpoints/{hugo_project_name}-{`crc32.ChecksumIEEE(git_repo_path)`}/last-commit-log.txt

/var/www/html/sandpoints/{hugo_project_name}-{`crc32.ChecksumIEEE(git_repo_path)`}/_preview/last-commit-log.txt
```