initial commit
This commit is contained in:
parent
34cebd627f
commit
2d42b6a3a2
30
.drone.yml
30
.drone.yml
@ -1,12 +1,24 @@
|
|||||||
|
# kind: pipeline
|
||||||
|
# name: default
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# - name: build
|
||||||
|
# image: plugins/hugo
|
||||||
|
# settings:
|
||||||
|
# hugo_version: 0.88.1
|
||||||
|
# pull: always
|
||||||
|
# validate: true
|
||||||
|
# config: blog/config.toml
|
||||||
|
# theme: /drone/src/blog/themes
|
||||||
|
|
||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
type: docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: test
|
||||||
image: plugins/hugo
|
image: plugins/hugo
|
||||||
settings:
|
settings:
|
||||||
hugo_version: 0.88.1
|
validate: true
|
||||||
pull: always
|
pull: always
|
||||||
validate: true
|
source: blog/
|
||||||
config: blog/config.toml
|
|
||||||
theme: /drone/src/blog/themes
|
|
59
Dockerfile
59
Dockerfile
@ -1,24 +1,45 @@
|
|||||||
FROM alpine:latest
|
# GitHub: https://github.com/gohugoio
|
||||||
|
# Twitter: https://twitter.com/gohugoio
|
||||||
LABEL maintainer="Sthope <HopelessAutomations@gmail.com>"
|
# Website: https://gohugo.io/
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
FROM golang:1.16-alpine AS build
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
openssh-client \
|
|
||||||
rsync \
|
|
||||||
build-base \
|
|
||||||
libc6-compat
|
|
||||||
|
|
||||||
RUN HUGO=$(curl -s "https://api.github.com/repos/gohugoio/hugo/releases/latest" | awk -F '"' '/tag_name/{print $4}'| sed -E 's/v//g;') && \
|
# Optionally set HUGO_BUILD_TAGS to "extended" or "nodeploy" when building like so:
|
||||||
export HUGO && \
|
# docker build --build-arg HUGO_BUILD_TAGS=extended .
|
||||||
mkdir -p /usr/local/src && \
|
ARG HUGO_BUILD_TAGS
|
||||||
cd /usr/local/src && \
|
|
||||||
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO}/hugo_extended_${HUGO}_linux-64bit.tar.gz" | tar -xz && \
|
|
||||||
mv hugo /usr/local/bin/hugo && \
|
|
||||||
addgroup -Sg 1000 hugo && \
|
|
||||||
adduser -Sg hugo -u 1000 -h /src hugo
|
|
||||||
|
|
||||||
WORKDIR /src
|
ARG CGO=1
|
||||||
|
ENV CGO_ENABLED=${CGO}
|
||||||
|
ENV GOOS=linux
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/gohugoio/hugo/
|
||||||
|
|
||||||
|
# gcc/g++ are required to build SASS libraries for extended version
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache gcc g++ musl-dev && \
|
||||||
|
go get github.com/magefile/mage
|
||||||
|
|
||||||
|
RUN mage hugo && mage install
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
FROM alpine:3.12
|
||||||
|
|
||||||
|
COPY --from=build /go/bin/hugo /usr/bin/hugo
|
||||||
|
|
||||||
|
# libc6-compat & libstdc++ are required for extended SASS libraries
|
||||||
|
# ca-certificates are required to fetch outside resources (like Twitter oEmbeds)
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache ca-certificates libc6-compat libstdc++ git
|
||||||
|
|
||||||
|
VOLUME /site
|
||||||
|
WORKDIR /site
|
||||||
|
|
||||||
|
# Expose port for live server
|
||||||
EXPOSE 1313
|
EXPOSE 1313
|
||||||
|
|
||||||
|
ENTRYPOINT ["hugo"]
|
||||||
|
CMD ["--help"]
|
Loading…
x
Reference in New Issue
Block a user