Skip to content

Commit

Permalink
initial hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
firecyberice committed Jun 30, 2015
0 parents commit 4608fc4
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*~
Makefile
.git
.gitignore
README.md
LICENCE
FILEPATH
VERSION
16 changes: 16 additions & 0 deletions .drone.yml
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#####################"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
gogs.tar.gz
29 changes: 29 additions & 0 deletions Dockerfile
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"]
1 change: 1 addition & 0 deletions FILEPATH
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm-binaries/gogs/gogs.tar.gz
46 changes: 46 additions & 0 deletions Makefile
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

56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# rpi-hugo

[![dockeri.co](http://dockeri.co/image/hypriot/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.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.14

0 comments on commit 4608fc4

Please sign in to comment.