forked from hypriot/rpi-hugo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
firecyberice
committed
Jun 30, 2015
0 parents
commit 4608fc4
Showing
8 changed files
with
159 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*~ | ||
Makefile | ||
.git | ||
.gitignore | ||
README.md | ||
LICENCE | ||
FILEPATH | ||
VERSION |
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,16 @@ | ||
image: registry.hypriot.com/arm_base/dockerindocker | ||
docker: | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
git: | ||
path: github.com/hypriot/rpi-hugo | ||
script: | ||
- echo "+++++ start docker daemon +++++" | ||
- wrapdocker & | ||
- sleep 5 | ||
- docker login --username=$$REGISTRY_USER --password=$$REGISTRY_PASSWORD --email=$$REGISTRY_USER_EMAIL $$REGISTRY_URL | ||
- echo "+++++ build docker image +++++" | ||
- make | ||
- echo "+++++ stop docker daemon +++++" | ||
- start-stop-daemon --stop --pidfile "/var/run/docker.pid" | ||
- echo -e "#####################\n***** COMPLETED *****\n#####################" |
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,2 @@ | ||
*~ | ||
gogs.tar.gz |
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,29 @@ | ||
FROM registry.hypriot.com/alpine/bash | ||
|
||
MAINTAINER Andreas Eiermann <[email protected]> | ||
LABEL version="alpine linux version: 3.2\r\nhugo version: 0.14" | ||
ENV HUGO_VERSION=0.14 | ||
|
||
# set alpine to version 3.2 instead of edge | ||
RUN echo "http://nl.alpinelinux.org/alpine/v3.1/main" > /etc/apk/repositories | ||
|
||
RUN apk update && \ | ||
apk add openssh git && \ | ||
rm -rf /var/cache/apk/* | ||
#apk upgrade && \ | ||
|
||
|
||
ADD \ | ||
https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux_arm.tar.gz / | ||
|
||
RUN tar xzf /hugo_${HUGO_VERSION}_linux_arm.tar.gz && \ | ||
rm /hugo_${HUGO_VERSION}_linux_arm.tar.gz && \ | ||
mv /hugo_${HUGO_VERSION}_linux_arm/hugo_${HUGO_VERSION}_linux_arm \ | ||
/usr/local/bin/hugo | ||
|
||
WORKDIR /www/ | ||
|
||
ENTRYPOINT ["hugo"] | ||
|
||
#ENTRYPOINT ["/bin/bash","-s","-c"] | ||
#CMD ["hugo"] |
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 @@ | ||
arm-binaries/gogs/gogs.tar.gz |
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,46 @@ | ||
IMAGENAME := $(shell basename `git rev-parse --show-toplevel`) | ||
SHA := $(shell git rev-parse --short HEAD) | ||
targz_file := $(shell cat FILEPATH) | ||
timestamp := $(shell date +"%Y%m%d%H%M") | ||
VERSION :=$(shell cat VERSION) | ||
|
||
default: create push | ||
|
||
docker: dockerbuild push | ||
|
||
loadS3_and_extract: | ||
aws s3 cp s3://$(AWS_BUCKET)/$(targz_file) ./binary.tar.gz | ||
mkdir content/ | ||
tar xzf binary.tar.gz -C content/ | ||
ls -la content/ | ||
|
||
dockerbuild: | ||
docker rmi -f $(NAMESPACE)/$(IMAGENAME):bak || true | ||
docker tag $(NAMESPACE)/$(IMAGENAME) $(NAMESPACE)/$(IMAGENAME):bak || true | ||
docker rmi -f $(NAMESPACE)/$(IMAGENAME) || true | ||
docker build -t $(NAMESPACE)/$(IMAGENAME) . | ||
|
||
testimg: | ||
docker rm -f new-$(IMAGENAME) || true | ||
docker run -d --name new-$(IMAGENAME) $(NAMESPACE)/$(IMAGENAME):latest | ||
docker inspect -f '{{.NetworkSettings.IPAddress}}' new-$(IMAGENAME) | ||
docker logs -f new-$(IMAGENAME) | ||
|
||
push: | ||
# push VERSION | ||
docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION) | ||
docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION) | ||
docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION) || true | ||
# push commit SHA | ||
docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA) | ||
docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA) | ||
docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA) || true | ||
# push timestamp | ||
docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp) | ||
docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp) | ||
docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp) || true | ||
# push latest | ||
docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest | ||
docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest | ||
docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest || true | ||
|
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,56 @@ | ||
# rpi-hugo | ||
|
||
[](https://registry.hub.docker.com/u/hypriot/rpi-hugo/) | ||
|
||
Raspberry Pi compatible Docker Image with hugo - a static webpage builder | ||
|
||
## Details | ||
- [Source Project Page](https://github.com/hypriot) | ||
- [Source Repository](https://github.com/hypriot/rpi-hugo) | ||
|
||
## Start a gogs git server | ||
```bash | ||
docker run -d --name my-go-git-server --publish 8022:22 --publish 3000:3000 --volume `pwd`/gogs-data/:/data hypriot/rpi-gogs-raspbian | ||
``` | ||
Now you can access the new gogs installation by opening `http://< IP of your Raspberry Pi>:3000` in your browser | ||
|
||
## How to create this image | ||
|
||
Run all the commands from within the project root directory. | ||
|
||
### Build the Docker Image | ||
```bash | ||
make dockerbuild | ||
``` | ||
|
||
#### Push the Docker Image to the Docker Hub | ||
* First use a `docker login` with username, password and email address | ||
* Second push the Docker Image to the official Docker Hub | ||
|
||
```bash | ||
make push | ||
``` | ||
|
||
## License | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Hypriot | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
0.14 |