Skip to content

Commit

Permalink
Completely working Makefile and Readme with documentation on how to c…
Browse files Browse the repository at this point in the history
…all make
  • Loading branch information
rayraspberry committed Oct 31, 2022
1 parent 2d80f97 commit f290d0d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
TOPDIR=$(shell pwd)


build: ## Build docker image
docker build -t yfd-jekyll .
docker run -p 4000:4000 --volume="$(TOPDIR):/workspaces/yfd-docs" -dit --name yfd-docs yfd-jekyll
## docker-compose build

start:build
## docker-compose up --force-recreate
docker exec -it -w /workspaces/yfd-docs yfd-docs sh -c "bundle exec jekyll serve --host 0.0.0.0 --config _config_local.yml"
start:
# docker-compose up --force-recreate
docker start yfd-docs
docker exec -d -it -w /workspaces/yfd-docs yfd-docs sh -c "bundle exec jekyll serve --host 0.0.0.0 --config _config_local.yml"

@echo "YFD Docs service is starting... please wait 10 seconds."
@echo "Open http://localhost:4000/ in your preferred web browser."
stop:
## docker-compose stop
docker stop yfd-docs

rebuild: # run jekyll build inside container to update on the go
## docker-compose exec jekyll jekyll build --incremental --watch
make clean
make build
make start

open:
docker exec -it yfd-docs "/bin/ash"
Expand Down
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Y-Foundry Wiki Repository
# Y-Foundry Documentation Repository

Built with Github Pages and [Jekyll](https://jekyllrb.com/)

Expand All @@ -10,20 +10,45 @@ Built with Github Pages and [Jekyll](https://jekyllrb.com/)


## Setting up a documentation environment locally
First this:
https://jekyllrb.com/docs/installation/ubuntu/

then:
[Jekyll](https://jekyllrb.com/docs/step-by-step/01-setup/)
## Pre-requestites ##

1. Git

2. Docker

### Clone YFD-WIKI Repo
```git clone https://github.com/Y-Foundry-Dao/yfd-wiki.git```

### From the ```yfd-wiki``` directory
```bundle install```
### From the ```yfd-wiki``` cloned repo directory

`make build`
To build the Docker Image and Container

***
`make start`
To launch the Documentation Service

Open a browser to [local documentation site](http://localhost:4000)

***

#### Other Commands

`make stop`

To stop the development environment

***
`make rebuild`
To rebuild the local development environment

***
`make clean`
To clean image and container files

```bundle exec jekyll serve --config _config_local.yml```

***

## For Reference

Expand Down

0 comments on commit f290d0d

Please sign in to comment.