Skip to content

Commit

Permalink
[Docs Site] Aligned docs with recent changes + added install/uninstal…
Browse files Browse the repository at this point in the history
…l scripts (#10)
  • Loading branch information
ZachiNachshon committed Sep 5, 2022
1 parent 2c8d4fe commit c2aaa05
Show file tree
Hide file tree
Showing 17 changed files with 698 additions and 114 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ create_tarball: ## Create a tarball from local repository
.

.PHONY: install_from_respository
install_from_respository: create_tarball ## Install a local dotfiles CLI from this repository
install_from_respository: create_tarball ## Install a local git-deps-syncer from this repository
@LOCAL_ARCHIVE_FILEPATH=$(CURDIR)/git-deps-syncer.tar.gz ./install.sh
@rm -rf $(CURDIR)/git-deps-syncer.tar.gz

.PHONY: uninstall
uninstall: ## Uninstall a local dotfiles CLI
uninstall: ## Uninstall a local git-deps-syncer
@./uninstall.sh

.PHONY: release_version_create
release_version_create: ## Create release tag in GitHub with version from resources/version.txt
release_version_create: create_tarball ## Create release tag in GitHub with version from resources/version.txt
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/release.sh' \
'action: create' \
'version_file_path: ./resources/version.txt' \
'artifact_file_path: git-deps-syncer.sh' \
'artifact_file_path: git-deps-syncer.tar.gz' \
'debug'"
@rm -rf $(CURDIR)/git-deps-syncer.tar.gz

.PHONY: release_version_delete
release_version_delete: ## Enter a tag to delete its attached release tag from GitHub
Expand All @@ -48,16 +49,16 @@ calculate_sha_by_tag: ## Enter a tag to get its SHA hash
@sh -c "'$(CURDIR)/external/shell_scripts_lib/github/sha_calculator.sh' \
'sha_source: tag' \
'repository_url: https://github.com/ZachiNachshon/git-deps-syncer' \
'asset_name: git-deps-syncer.sh'"
'asset_name: git-deps-syncer.tar.gz'"

# http://localhost:9001/git-deps-syncer/
.PHONY: serve_docs_site
serve_docs_site: ## Run a local site
serve_docs_site: ## Run a local docs site
@cd docs-site && npm run docs-serve

# http://192.168.x.xx:9001/
.PHONY: serve_docs_site_lan
serve_docs_site_lan: ## Run a local site (open for LAN)
serve_docs_site_lan: ## Run a local docs site (open for LAN)
@cd docs-site && npm run docs-serve-lan

.PHONY: test
Expand Down
51 changes: 49 additions & 2 deletions docs-site/site/content/docs/latest/about/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,57 @@ aliases:

`git-deps-syncer` is an open source project that is currently self maintained in addition to my day job, you are welcome to show your appreciation by sending me cups of coffee using the the following link as it is a known fact that it is the fuel that drives software engineering ☕

<style>
.sponsor_buttons {
display: flex;
justify-content: center;
flex-direction: row;
text-align: center;
margin-left: auto;
margin-right: auto;
padding: 2rem 0;
/* padding-top: 10%; */
gap: 10px;
width: 100%;
max-width: 80rem; }
/* margin-top: 6rem; */
@media only screen and (max-width: 56.25em) {
.sponsor_buttons {
flex-direction: column;
margin-top: 5rem; } }

.sponsor_button {
background: var(--sephia);
height: 50px;
width: 120px;
border-radius: 10px;
}
</style>

<!-- <a href="https://www.buymeacoffee.com/ZachiNachshon" target="_blank"><img src="/docs/latest/assets/img/bmc-orig.svg" height="57" width="200" alt="Buy Me A Coffee"></a> -->

<div class="sponsor_buttons">
<a href="https://github.com/sponsors/ZachiNachshon" target="_blank" alt="GitHub Sponsor">
<img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23e2216a" height="50">
</a>
<br>
<a href="https://paypal.me/ZachiNachshon/" target="_blank">
<img src="/docs/latest/assets/img/paypal-blue.svg" height="50" width="255">
</a>
<br>
<a href="https://www.buymeacoffee.com/ZachiNachshon" target="_blank">
<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=ZachiNachshon&amp;button_colour=e2216a&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" alt="Buy me a Coffee Button">
</a>
</div>

<br>

<a href="https://www.buymeacoffee.com/ZachiNachshon" target="_blank"><img src="/docs/latest/assets/img/bmc-orig.svg" height="57" width="200" alt="Buy Me A Coffee"></a>
<ul class="list-unstyled small text-muted">
<li class="mb-2">PayPal logo by <a href="https://github.com/andreostrovsky/donate-with-paypal" target="_blank">donate-with-paypal</a></li>
</ul>

## Get Involved

Get involved with `git-deps-syncer` development by [opening an issue]({{< param repo >}}/issues/new) or submitting a pull request. Read the [contribute](/docs/{{< param docs_version >}}/getting-started/contribute/) section for additional information.
Get involved with `git-deps-syncer` development by [opening an issue]({{< param repo >}}/issues/new?assignees=&labels=&template=bug_report.md&title=) or submitting a pull request. Read the [contribute](/docs/{{< param docs_version >}}/getting-started/contribute/) section for additional information.


Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ This file contains the synced git dependencies information such as url / branch
{{< /bs-table >}}

{{< callout info >}}
By default the following files/folders are being excluded from the sync action of all git repositories:<br>
`.git` `.idea` `.git-deps` `external` `.gitignore` `.DS_Store`
By default the following files / folders are being excluded from the sync action of all git repositories:<br>
`.git`, `.idea`, `.git-deps`, `external`, `.gitignore`, `.DS_Store`
{{< /callout >}}

### Dev dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,5 @@ aliases: "/docs/latest/configuration/"
{{< /bs-table >}}

{{< callout info >}}
Type `git-deps-syncer locations` to get a list of commonly used paths.
Type `git-deps-syncer config` to get a list of commonly used paths.
{{< /callout >}}

<div class="col-lg-6">
<img style="vertical-align: top;" src="/docs/latest/assets/img/config-locations.svg" width="800">
</div>
24 changes: 15 additions & 9 deletions docs-site/site/content/docs/latest/getting-started/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ The `makefile` within this repository contains numerous tasks used for project d
{{< bs-table >}}
| Task | Description |
| --- | --- |
| `release` | Create release tag in GitHub with version from resources/version.txt |
| `delete-release` | Enter a tag to delete its attached release tag from GitHub |
| `commit-to-sha-hash` | Enter a commit to get its SHA hash |
| `tag-to-sha-hash` | Enter a tag to get its SHA hash |
| `install_from_respository` | Install a local git-deps-syncer from this repository |
| `uninstall` | Uninstall a local git-deps-syncer |
| `release_version_create` | Create release tag in GitHub with version from resources/version.txt |
| `release_version_delete` | Enter a tag to delete its attached release tag from GitHub |
| `calculate_sha_by_commit_hash` | Enter a commit to get its SHA hash |
| `calculate_sha_by_tag` | Enter a tag to get its SHA hash |
| `serve_docs_site` | Run a local docs site |
| `serve_docs_site_lan` | Run a local docs site (open for LAN) |
| `test` | Run tests suite |
| `fmt` | Format shell scripts using shfmt bash style (https://github.com/mvdan/sh) |
{{< /bs-table >}}

{{< callout warning >}}
Expand Down Expand Up @@ -69,17 +75,17 @@ The `/docs-site/package.json` includes numerous tasks for developing the documen
| `npm run docs-serve-lan` | Builds and runs the documentation locally, make it available on home network<br> (for testing views on mobile phones) |
{{< /bs-table >}}

{{< callout warning >}}
When running the docs site with LAN access, make sure to update the IP address of the `docs-serve-lan` script on the `pacakge.json` file.
{{< /callout >}}

## Local documentation

Running our documentation locally requires the use of Hugo, which gets installed via the `hugo-bin` npm package. Hugo is a blazingly fast and quite extensible static site generator. Here’s how to get it started:

- Run through the [tooling setup](#tooling-setup) above to install all dependencies
- Navigate to `/docs-site` directory and run `npm install` to install local dependencies listed in `package.json`
- From `/docs-site` directory, run `npm run docs-serve` in the command line
- Open [http://localhost:9001/](http://localhost:9001/) in your browser
- Open [http://localhost:9001/git-deps-syncer](http://localhost:9001/git-deps-syncer) in your browser

Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).

## Troubleshooting

In case you encounter problems with missing dependencies, run `make align-deps`.
84 changes: 49 additions & 35 deletions docs-site/site/content/docs/latest/getting-started/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,28 @@ Alternatively, tap into the formula to have brew search capabilities on that tap

## Released Version

1. Download and install `git-deps-syncer` executable (copy & paste into a terminal):
Download and install `git-deps-syncer` executable (copy & paste into a terminal):

```bash
bash <<'EOF'
# Change Version accordingly
VERSION=0.1.0
# Create a temporary folder
download_temp_path=$(mktemp -d ${TMPDIR:-/tmp}/git-deps-syncer-temp.XXXXXX)
cwd=$(pwd)
cd ${download_temp_path}
# Download & extract
echo -e "\nDownloading git-deps-syncer to temp directory...\n"
curl -SL "https://github.com/ZachiNachshon/git-deps-syncer/releases/download/v${VERSION}/git-deps-syncer.sh"
# Create a dest directory and move the binary
echo -e "\nMoving executable to ~/.local/bin"
mkdir -p ${HOME}/.local/bin; mv git-deps-syncer.sh ${HOME}/.local/bin
# Create a dest directory and move the binary
echo "Elevating exec permissions (might prompt for password)"
chmod +x ${HOME}/.local/bin/git-deps-syncer.sh
# Add this line to your *rc file (zshrc, bashrc etc..) to make git-deps-syncer available on new sessions
echo "Exporting ~/.local/bin (make sure to have it available on PATH)"
export PATH="${PATH}:${HOME}/.local/bin"
cd ${cwd}
curl -sfLS https://raw.githubusercontent.com/ZachiNachshon/git-deps-syncer/master/install.sh | bash -
```

# Cleanup
if [[ ! -z ${download_temp_path} && -d ${download_temp_path} && ${download_temp_path} == *"git-deps-syncer-temp"* ]]; then
echo "Deleting temp directory"
rm -rf ${download_temp_path}
fi
Available installation flags:
{{< bs-table >}}
| Flag | Description |
| --- | --- |
| `VERSION` | Specify the released version to install |
| `DRY_RUN` | Run all commands in dry-run mode without file system changes |
{{< /bs-table >}}

echo -e "\nDone (type 'git-deps-syncer' for help)\n"
Example:

EOF
```bash
curl -sfLS \
https://raw.githubusercontent.com/ZachiNachshon/git-deps-syncer/master/install.sh | \
DRY_RUN=True \
VERSION=0.6.0 \
bash -
```

Alternatively, you can download a release directy from GitHub
Expand All @@ -93,3 +75,35 @@ Clone `git-deps-syncer` repository into a directory of your choice:
```bash
git clone https://github.com/ZachiNachshon/git-deps-syncer.git; cd git-deps-syncer
```

## Uninstall

Instruction to uninstall `git-deps-syncer` based on installation method.

**Homebrew**

```bash
brew remove git-deps-syncer
```

**Released Version**

```bash
curl -sfLS https://raw.githubusercontent.com/ZachiNachshon/git-deps-syncer/master/uninstall.sh | bash -
```

Available flags:
{{< bs-table >}}
| Flag | Description |
| --- | --- |
| `DRY_RUN` | Run all commands in dry-run mode without file system changes |
{{< /bs-table >}}

Example:

```bash
curl -sfLS \
https://raw.githubusercontent.com/ZachiNachshon/git-deps-syncer/master/uninstall.sh | \
DRY_RUN=True \
bash -
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ toc: true
Repositories that are using `git-deps-syncer` for managing their git dependencies as 3rd parties:

- <a href="https://github.com/ZachiNachshon/anchor" target="_blank">anchor</a>
- <a href="https://github.com/ZachiNachshon/dotfiles-cli" target="_blank">dotfiles-cli</a>
- <a href="https://github.com/ZachiNachshon/git-deps-syncer" target="_blank">git-deps-syncer</a> (dogfooding)
18 changes: 5 additions & 13 deletions docs-site/site/content/docs/latest/usage/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ The `sync` / `sync-all` commands prompts for user approval before execution, to
| `show` | Print the external git dependencies from the JSON config file |
| `clear-all` | Remove all symlinks from external folder |
| `clear [name]` | Remove a specific symlink from external folder |
| `locations` | Print locations used for config/repositories/symlinks/clone-path |
| `config` | Print config / paths / symlinks / clone-path |
| `init` | Create an empty **.git-deps** folder with a **config.json** template file |
| `update` | Update client to latest version |
| `version` | Print deps-syncer client versions |
{{< /bs-table >}}

Expand All @@ -31,18 +30,11 @@ Available flags to control commands execution.
{{< bs-table >}}
| Task | Description |
| --- | --- |
| `--save-dev` | Sync **devDependencies** local symlinks as declared on **config.json** |
| `--open-github-pr` | Open a GitHub PR for git changes after running **sync-all** |
| `--dry-run` | Run all commands in dry-run mode **without file system changes**
| `-y` | Do not prompt for approval and accept everything |
| `-h (--help)` | Show available actions and their description |
| `-v (--verbose)` | Output debug logs for deps-syncer client commands executions |
| `-s (--silent)` | Do not output logs for deps-syncer client commands executions |
| `-y` | Do not prompt for approval and accept everything |
| `--save-dev` | Sync **devDependencies** local symlinks as declared on **config.json** |
| `--open-github-pr` | Open a GitHub PR for git changes after running **sync-all** |
{{< /bs-table >}}

<br>

Example of a user prompt message upon `sync-all`:

<div class="col-lg-6">
<img style="vertical-align: top;" src="/docs/latest/assets/img/sync-all-prompt-message.svg" width="800" >
</div>
4 changes: 2 additions & 2 deletions docs-site/site/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ <h5>Projects</h5>
<h5>Community</h5>
<ul class="list-unstyled">
<li class="mb-2"><a href="{{ .Site.Params.github_org }}/git-deps-syncer/issues" target="_blank">Issues</a></li>
<!-- <li class="mb-2"><a href="https://github.com/sponsors/ZachiNachshon">Sponsorship</a></li> -->
<li class="mb-2"><a href="https://www.paypal.com/paypalme/ZachiNachshon" target="_blank">Sponsorship</a></li>
<li class="mb-2"><a href="https://github.com/sponsors/ZachiNachshon" target="_blank">Sponsorship</a></li>
<!-- <li class="mb-2"><a href="https://www.paypal.com/paypalme/ZachiNachshon" target="_blank">Sponsorship</a></li> -->
<!-- <li class="mb-2"><a href="{{ .Site.Params.slack }}">Slack</a></li> -->
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs-site/site/layouts/partials/home/masthead-followup.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3 class="fw-semibold">Syncing a remote git dependency</h3>
{{ highlight (printf (`git-deps-syncer sync shell_scripts_lib`)) "sh" "" }}
</p>
<p>
For addintional information <a href="/docs/{{ .Site.Params.docs_version }}/configuration/dependencies">check the configuration section</a>.
For additional information <a href="/docs/{{ .Site.Params.docs_version }}/configuration/dependencies">check the configuration section</a>.
</p>
</div>
</section>
Expand All @@ -49,7 +49,7 @@ <h2 class="display-5 mb-3 fw-semibold lh-sm">Define git repository as a 3rd part
<code>git-deps-syncer</code> uses a configuration file to keep track of existing git dependencies and manage their versioned sources.
</p>
<p class="d-flex justify-content-start lead fw-normal">
<a href="/docs/{{ .Site.Params.docs_version }}/repository/structure/" class="icon-link fw-semibold">
<a href="/docs/{{ .Site.Params.docs_version }}/configuration/dependencies/" class="icon-link fw-semibold">
Learn more about configuration options
<svg class="bi"><use xlink:href="#arrow-right-short"></use></svg>
</a>
Expand Down
17 changes: 0 additions & 17 deletions docs-site/site/static/docs/latest/assets/img/config-locations.svg

This file was deleted.

Loading

0 comments on commit c2aaa05

Please sign in to comment.