Compare commits
No commits in common. "master" and "v0.1.0" have entirely different histories.
182
.drone.yml
182
.drone.yml
|
@ -1,75 +1,28 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: testing
|
||||
name: dockerhub-build-trigger
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: hadolint
|
||||
- name: call webhook
|
||||
pull: always
|
||||
image: hadolint/hadolint:v2.9.3-alpine
|
||||
image: bash:latest
|
||||
environment:
|
||||
ENDPOINT:
|
||||
from_secret: dockerhub_endpoint
|
||||
commands:
|
||||
- hadolint --version
|
||||
- hadolint Containerfile
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- "refs/heads/feature-**"
|
||||
- "refs/pull/**"
|
||||
- "refs/tags/**"
|
||||
event:
|
||||
exclude: [cron]
|
||||
- apk add --no-cache curl
|
||||
- curl -sO https://git.dotya.ml/wanderer/docker-fedora-hugo/raw/branch/master/curl.it
|
||||
- bash ./curl.it $ENDPOINT
|
||||
|
||||
- name: kaniko-build
|
||||
pull: always
|
||||
image: immawanderer/drone-kaniko:linux-amd64
|
||||
settings:
|
||||
dockerfile: Containerfile
|
||||
context: .
|
||||
args:
|
||||
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
|
||||
when:
|
||||
ref:
|
||||
- "refs/heads/feature-**"
|
||||
- "refs/pull/**"
|
||||
- "refs/tags/**"
|
||||
event:
|
||||
exclude: [cron]
|
||||
|
||||
- name: kaniko-publish
|
||||
pull: always
|
||||
image: immawanderer/drone-kaniko:linux-amd64
|
||||
settings:
|
||||
dockerfile: Containerfile
|
||||
context: .
|
||||
args:
|
||||
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
|
||||
tags:
|
||||
- latest
|
||||
- linux-amd64
|
||||
- ${DRONE_COMMIT_SHA:0:8}
|
||||
repo: immawanderer/fedora-hugo
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
event:
|
||||
exclude: [pull_request, tag]
|
||||
|
||||
trigger:
|
||||
event: [push, pull_request, cron, tag]
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: notifications
|
||||
|
||||
platform:
|
||||
|
@ -79,41 +32,42 @@ platform:
|
|||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: discord
|
||||
pull: if-not-exists
|
||||
image: appleboy/drone-discord:latest
|
||||
settings:
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
âś… [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
||||
event: **`{{build.event}}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{else}}
|
||||
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
||||
event: **`${DRONE_BUILD_EVENT}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
```{{commit.message}}```
|
||||
{{/success}}
|
||||
webhook_id:
|
||||
from_secret: discord_webhook_id
|
||||
webhook_token:
|
||||
from_secret: discord_webhook_token
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
exclude: [pull_request]
|
||||
include: [push, tag]
|
||||
- push
|
||||
- tag
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
- success
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- testing
|
||||
- dockerhub-build-trigger
|
||||
|
||||
steps:
|
||||
- name: discord
|
||||
pull: if-not-exists
|
||||
image: appleboy/drone-discord:latest
|
||||
settings:
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
âś… [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
||||
event: **`{{build.event}}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{else}}
|
||||
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
||||
event: **`${DRONE_BUILD_EVENT}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
```{{commit.message}}```
|
||||
{{/success}}
|
||||
webhook_id:
|
||||
from_secret: discord_webhook_id
|
||||
webhook_token:
|
||||
from_secret: discord_webhook_token
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: notifications-cronbuild
|
||||
|
||||
platform:
|
||||
|
@ -123,42 +77,36 @@ platform:
|
|||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: discord
|
||||
pull: always
|
||||
image: appleboy/drone-discord:latest
|
||||
settings:
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
âś… [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
||||
event: **`{{build.event}}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{else}}
|
||||
❌ [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
||||
event: **`${DRONE_BUILD_EVENT}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{/success}}
|
||||
webhook_id:
|
||||
from_secret: discord_webhook_hourly_id
|
||||
webhook_token:
|
||||
from_secret: discord_webhook_hourly_token
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- master
|
||||
event:
|
||||
- cron
|
||||
- cron
|
||||
cron:
|
||||
- nightly
|
||||
- hourly-build
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
- success
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- testing
|
||||
- dockerhub-build-trigger
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: f43c4763b72fa76b3c12b03aa32f9a36f22ebb3a90d546388bd625ba6d3efe01
|
||||
|
||||
...
|
||||
steps:
|
||||
- name: discord
|
||||
pull: always
|
||||
image: appleboy/drone-discord:latest
|
||||
settings:
|
||||
message: >
|
||||
{{#success build.status}}
|
||||
âś… [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
||||
event: **`{{build.event}}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{else}}
|
||||
❌ [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
||||
event: **`${DRONE_BUILD_EVENT}`**
|
||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||
{{/success}}
|
||||
webhook_id:
|
||||
from_secret: discord_webhook_hourly_id
|
||||
webhook_token:
|
||||
from_secret: discord_webhook_hourly_token
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
# syntax=docker/dockerfile:1.4
|
||||
FROM registry.fedoraproject.org/fedora-minimal:36
|
||||
|
||||
ENV HUGO_VERSION 0.104.3
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG VCS_REF
|
||||
|
||||
LABEL description="Container image for building websites with Hugo static site generator."
|
||||
|
||||
LABEL org.label-schema.build-date=$BUILD_DATE \
|
||||
org.label-schema.vcs-url="https://git.dotya.ml/wanderer/docker-fedora-hugo.git" \
|
||||
org.label-schema.vcs-ref=$VCS_REF \
|
||||
org.label-schema.license=GPL-3.0
|
||||
|
||||
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp/hugo.tar.gz
|
||||
|
||||
WORKDIR /tmp/
|
||||
# DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
|
||||
# hadolint ignore=DL3041
|
||||
RUN microdnf --refresh upgrade -y && microdnf install -y bsdtar git findutils \
|
||||
--nodocs --setopt install_weak_deps=0 \
|
||||
&& microdnf clean all -y; \
|
||||
\
|
||||
bsdtar xfv /tmp/hugo.tar.gz && rm -fv /tmp/hugo.tar.gz README.md LICENSE \
|
||||
&& chmod +x /tmp/hugo \
|
||||
&& mkdir -pv /usr/local/bin \
|
||||
&& mv -v /tmp/hugo /usr/local/bin/ \
|
||||
&& rm -rfv /tmp/* \
|
||||
&& rm -rf /usr/share/zoneinfo/* ; rm -rf /usr/include/* ; \
|
||||
find /. -name "*~" -type f -delete > /dev/null 2>&1 ;\
|
||||
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete
|
||||
WORKDIR /
|
|
@ -1 +0,0 @@
|
|||
Containerfile
|
|
@ -0,0 +1,29 @@
|
|||
FROM fedora:33
|
||||
|
||||
ENV HUGO_VERSION 0.76.5
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG VCS_REF
|
||||
|
||||
LABEL description="Docker image for building websites with Hugo static site generator."
|
||||
|
||||
LABEL org.label-schema.build-date=$BUILD_DATE \
|
||||
org.label-schema.vcs-url="https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-archlinux-hugo.git" \
|
||||
org.label-schema.vcs-ref=$VCS_REF \
|
||||
org.label-schema.license=GPL-3.0
|
||||
|
||||
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp/hugo.tar.gz
|
||||
|
||||
WORKDIR /tmp/
|
||||
RUN dnf --refresh upgrade -y && dnf install -y git findutils && dnf autoremove -y
|
||||
RUN tar xfv /tmp/hugo.tar.gz && rm -v /tmp/hugo.tar.gz README.md LICENSE \
|
||||
&& chmod +x /tmp/hugo \
|
||||
&& mkdir -pv /usr/local/bin \
|
||||
&& mv -v /tmp/hugo /usr/local/bin/
|
||||
RUN dnf clean all -y \
|
||||
&& rm -rv /usr/share/zoneinfo/* ; rm -rv /usr/include/* ; \
|
||||
find /. -name "*~" -type f -delete; \
|
||||
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete; \
|
||||
rm -rv /tmp/* ; \
|
||||
dnf autoremove -y findutils; dnf clean all -y || true
|
||||
WORKDIR /
|
2
LICENSE
2
LICENSE
|
@ -2,7 +2,7 @@ GNU GENERAL PUBLIC LICENSE
|
|||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2020-2021 Adam Mirre <a_mirre@utb.cz>
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
|
29
Makefile
29
Makefile
|
@ -1,29 +0,0 @@
|
|||
dcmd = docker
|
||||
dfile = Containerfile
|
||||
dtag = immawanderer/fedora-hugo:testbuild
|
||||
dargs = build -t $(dtag) --no-cache --pull - < $(dfile)
|
||||
cleanargs = image rm -f $(dtag)
|
||||
pruneargs = system prune -af
|
||||
dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir):z
|
||||
kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.9.0-debug
|
||||
kanikowdir = /src
|
||||
kanikocontext = .
|
||||
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --build-arg BUILD_DATE=$(build_date) --build-arg VCS_REF=$(vcs_ref) --no-push
|
||||
vcs_ref = $$(git rev-parse --short HEAD)
|
||||
build_date= $$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
.PHONY: build kaniko clean test prune
|
||||
|
||||
kaniko:
|
||||
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)
|
||||
|
||||
build:
|
||||
$(dcmd) $(dargs)
|
||||
|
||||
clean:
|
||||
$(dcmd) $(cleanargs)
|
||||
|
||||
test: build kaniko
|
||||
|
||||
prune:
|
||||
$(dcmd) $(pruneargs)
|
13
README.md
13
README.md
|
@ -1,20 +1,19 @@
|
|||
# docker-fedora-hugo
|
||||
|
||||
[![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-fedora-hugo/status.svg)](https://drone.dotya.ml/wanderer/docker-fedora-hugo)
|
||||
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/immawanderer/fedora-hugo)](https://hub.docker.com/r/immawanderer/fedora-hugo/tags/?page=1&ordering=last_updated)
|
||||
[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/immawanderer/fedora-hugo/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-hugo/tags/?page=1&ordering=last_updated&name=linux-amd64)
|
||||
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/immawanderer/fedora-hugo/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-hugo/tags/?page=1&ordering=last_updated&name=linux-amd64)
|
||||
[![Docker pulls](https://img.shields.io/docker/pulls/immawanderer/fedora-hugo)](https://hub.docker.com/r/immawanderer/fedora-hugo/)
|
||||
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/immawanderer/fedora-hugo)](https://hub.docker.com/r/immawanderer/fedora-hugo/builds)
|
||||
[![](https://images.microbadger.com/badges/version/immawanderer/archlinux.svg)](https://microbadger.com/images/immawanderer/fedora-hugo)
|
||||
[![](https://images.microbadger.com/badges/commit/immawanderer/archlinux.svg)](https://microbadger.com/images/immawanderer/fedora-hugo)
|
||||
|
||||
This repository provides a Containerfile to create a container image, which may be used for web developent using [Hugo](https://gohugo.io) website building framework.
|
||||
This repository provides the Dockerfile to create a Docker image used for web developent using [Hugo](https://gohugo.io) website building framework.
|
||||
|
||||
The image is rebuilt <del>approximately every hour</del> nightly to ensure it always has the latest packages.
|
||||
The image is rebuilt approximately every hour to ensure it always has the latest packages.
|
||||
|
||||
push mirror lives in [this GitHub repo](https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-fedora-hugo)
|
||||
development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docker-fedora-hugo)
|
||||
|
||||
## What you get
|
||||
* updated `registry.fedoraproject.org/fedora-minimal:36` image
|
||||
* updated `fedora:33` image
|
||||
* git
|
||||
* hugo-extended (latest version from [GitHub](https://github.com/gohugoio/hugo/releases))
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
curl -s -H 'Content-Type: application/json' --data '{"docker_tag":"nightly"}' -X POST $2
|
||||
else
|
||||
curl -s -H 'Content-Type: application/json' --data '{"docker_tag":"latest"}' -X POST $1
|
||||
fi
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
# $IMAGE_NAME var is injected into the build so the tag is correct.
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
echo "Build hook running"
|
||||
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
|
||||
--build-arg VCS_REF=`git rev-parse --short HEAD` \
|
||||
|
|
Loading…
Reference in New Issue