Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/fc-asciidoctor-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: fc-asciidoctor-pr
on:
pull_request:
paths:
- utilities/fc-asciidoctor/**
- .github/workflows/fc-asciidoctor-pr.yaml
jobs:
build:
env:
context: utilities/fc-asciidoctor
image_name: fc-asciidoctor
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1

- name: Get image tags
id: image_tags
uses: redhat-cop/github-actions/get-image-version@master
with:
IMAGE_CONTEXT_DIR: ${{ env.CONTEXT_DIR }}

- name: Build image
uses: redhat-actions/buildah-build@v2
with:
context: ${{ env.context }}
dockerfiles: |
./${{ env.context }}/Dockerfile
image: ${{ env.image_name }}
oci: true
tags: ${{ steps.check_version.outputs.IMAGE_TAGS }}

- name: Test image
run: |
echo "Running: podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} git --version"
podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} git --version
echo "Running: podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} asciidoctor --version"
podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} asciidoctor --version
echo "Running: podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} asciidoctor-pdf --version"
podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} asciidoctor-pdf --version
echo "Running: podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} pandoc --version"
podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} pandoc --version
44 changes: 44 additions & 0 deletions .github/workflows/fc-asciidoctor-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: fc-asciidoctor-publish
on:
push:
branches:
- master
tags:
- '*'
paths:
- utilities/fc-asciidoctor/version.json
- .github/workflows/fc-asciidoctor-publish.yaml
jobs:
build:
env:
context: utilities/fc-asciidoctor
image_name: fc-asciidoctor
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master

- name: Get image tags
id: image_tags
uses: redhat-cop/github-actions/get-image-version@master
with:
IMAGE_CONTEXT_DIR: ${{ env.CONTEXT_DIR }}

- name: Build image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
context: ${{ env.context }}
dockerfiles: |
./${{ env.context }}/Dockerfile
image: ${{ env.image_name }}
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"

- name: Push to Quay
id: push_to_quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
registry: ${{ secrets.REGISTRY_URI }}/${{ secrets.REGISTRY_REPOSITORY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
tags: ${{ steps.build_image.outputs.tags }}
57 changes: 57 additions & 0 deletions utilities/fc-asciidoctor/.openshift/bc-fc-asciidoctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: fc-asciidoctor
metadata:
labels:
app.kubernetes.io/name: fc-asciidoctor
app.kubernetes.io/version: "1.2.0"
annotations:
description: asciidoctor utility image
tags: asciidoctor, fc
name: fc-asciidoctor
objects:
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: "fc-asciidoctor"
spec:
output:
to:
kind: "ImageStreamTag"
name: "fc-asciidoctor:latest"
source:
contextDir: "${CONTEXT_DIR}"
git:
uri: "${SOURCE_REPOSITORY_URL}"
ref: "${SOURCE_REPOSITORY_REF}"
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
resources:
requests:
cpu: 1
memory: "512Mi"
limits:
cpu: 2
memory: "1Gi"
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: fc-asciidoctor
spec:
lookupPolicy:
local: true
parameters:
- description: Path within Git repository to build; empty for root of repository
name: CONTEXT_DIR
value: gitlab-runners/fc-asciidoctor
- description: Git branch/tag reference
name: SOURCE_REPOSITORY_REF
value: master
- description: Git source URL for application
name: SOURCE_REPOSITORY_URL
required: true
value: https://github.com/redhat-cop/containers-quickstarts

34 changes: 34 additions & 0 deletions utilities/fc-asciidoctor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM registry.fedoraproject.org/fedora:latest

LABEL MAINTAINERS="Red Hat Services"

RUN dnf -y update && \
dnf -y install asciidoctor pandoc python3-pip && \
dnf clean all

RUN gem install asciidoctor-diagram asciidoctor-pdf kramdown-asciidoc rouge


# Installing Python dependencies for additional
# functionnalities as diagrams or syntax highligthing
RUN pip3 install --no-cache-dir \
actdiag \
'blockdiag[pdf]' \
'nwdiag[pdf]' \
seqdiag


WORKDIR /documents
VOLUME /documents

RUN mkdir /home/work \
&& chgrp -R 0 /home/work \
&& chmod -R g=u /home/work

ENV HOME=/home/work


USER 1001

CMD ["/bin/bash"]

17 changes: 17 additions & 0 deletions utilities/fc-asciidoctor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# fc-asciidoctor

A utility image for the FC image + asciidoctor.

Contains the primary used asciidoctor-pdf for generating reports.

It's base is from https://github.com/asciidoctor/docker-asciidoctor but now Fedora (fc) based.

## Purpose

Useful for environments where these libraries/tools are needed such as:
* local development
* CI tools that do not require specific CI tooling configuraiton, such as GiLab Jobs.

## Published

[https://quay.io/repository/redhat-cop/fc-asciidoctor](https://quay.io/repository/redhat-cop/fc-asciidoctor) via [GitHub Workflows](../../.github/workflows/fc-asciidoctor-publish.yaml).
1 change: 1 addition & 0 deletions utilities/fc-asciidoctor/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"v1.0.0"}
1 change: 1 addition & 0 deletions utilities/ubi10-asciidoctor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf
98 changes: 98 additions & 0 deletions utilities/ubi10-asciidoctor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#FROM registry.access.redhat.com/ubi10@sha256:0f2f2f06299954f2e50cea0c878c33b8490eaadfc27cdc2b50d181d6ab44c5a9
FROM registry.access.redhat.com/ubi10/ruby-33@sha256:14280dc6a535e2784d82525376a9c1b19f88f47ef9c05cdb2f707fc120718443


LABEL MAINTAINERS="Red Hat Services"

ARG ARCH=amd64
ARG RUBY_VERSION=3.3
ARG asciidoctor_version=2.0.23
ARG asciidoctor_confluence_version=0.0.2
ARG asciidoctor_pdf_version=2.3.19
ARG asciidoctor_diagram_version=2.3.2
ARG asciidoctor_epub3_version=2.2.0
ARG asciidoctor_mathematical_version=0.3.5
ARG asciidoctor_revealjs_version=5.2.0
ARG kramdown_asciidoc_version=2.1.0
ARG asciidoctor_bibtex_version=0.9.0
ARG pandoc_version=3.7.0.2
ARG asciidoctor_reducer_version=1.1.2
ARG epubcheck_ruby_version=5.2.1.0

ENV ASCIIDOCTOR_VERSION=${asciidoctor_version} \
ASCIIDOCTOR_CONFLUENCE_VERSION=${asciidoctor_confluence_version} \
ASCIIDOCTOR_PDF_VERSION=${asciidoctor_pdf_version} \
ASCIIDOCTOR_DIAGRAM_VERSION=${asciidoctor_diagram_version} \
ASCIIDOCTOR_EPUB3_VERSION=${asciidoctor_epub3_version} \
ASCIIDOCTOR_MATHEMATICAL_VERSION=${asciidoctor_mathematical_version} \
ASCIIDOCTOR_REVEALJS_VERSION=${asciidoctor_revealjs_version} \
KRAMDOWN_ASCIIDOC_VERSION=${kramdown_asciidoc_version} \
ASCIIDOCTOR_BIBTEX_VERSION=${asciidoctor_bibtex_version} \
PANDOC_VERSION=${pandoc_version} \
ASCIIDOCTOR_REDUCER_VERSION=${asciidoctor_reducer_version} \
EPUBCHECK_RUBY_VERSION=${epubcheck_ruby_version}

USER root

#RUN dnf -y module enable ruby:${RUBY_VERSION} && \
# dnf -y module install ruby:${RUBY_VERSION}

RUN dnf install -y \
python3-devel \
git \
make \
gcc \
redhat-rpm-config \
ruby-devel \
zlib-devel \
python3-lxml \
libjpeg-turbo-devel \
java-21-openjdk-headless \
fontconfig \
&& gem install --no-document \
"asciidoctor:${ASCIIDOCTOR_VERSION}" \
"asciidoctor-confluence:${ASCIIDOCTOR_CONFLUENCE_VERSION}" \
"asciidoctor-diagram:${ASCIIDOCTOR_DIAGRAM_VERSION}" \
"asciidoctor-epub3:${ASCIIDOCTOR_EPUB3_VERSION}" \
asciimath \
"asciidoctor-pdf:${ASCIIDOCTOR_PDF_VERSION}" \
"asciidoctor-revealjs:${ASCIIDOCTOR_REVEALJS_VERSION}" \
coderay \
epubcheck-ruby:${EPUBCHECK_RUBY_VERSION} \
haml \
"kramdown-asciidoc:${KRAMDOWN_ASCIIDOC_VERSION}" \
rouge \
slim \
thread_safe \
tilt \
"asciidoctor-bibtex:${ASCIIDOCTOR_BIBTEX_VERSION}" \
"asciidoctor-reducer:${ASCIIDOCTOR_REDUCER_VERSION}" \
&& rm -rf /usr/local/share/gems/cache \
&& dnf clean all \
&& rm -rf /var/lib/dnf

# install pandoc
RUN curl -L https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-${ARCH}.tar.gz | tar xvz --strip-components 1 -C /usr/local/ pandoc-${PANDOC_VERSION}/bin/pandoc

WORKDIR /documents
VOLUME /documents

RUN mkdir /home/work \
&& chgrp -R 0 /home/work \
&& chmod -R g=u /home/work

ENV HOME=/home/work

# Installing Python dependencies for additional
# functionnalities as diagrams or syntax highligthing
RUN pip3 install --no-cache-dir \
actdiag \
'blockdiag[pdf]' \
'nwdiag[pdf]' \
seqdiag \
lxml

USER 1001

CMD ["/bin/bash"]

18 changes: 18 additions & 0 deletions utilities/ubi10-asciidoctor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ubi8-asciidoctor

A utility image for the UBI8 image + asciidoctor.

Contains the primary used asciidoctor-pdf for generating reports.

It's base is from <https://github.com/asciidoctor/docker-asciidoctor> but now ubi based.

## Purpose

Useful for environments where these libraries/tools are needed such as:

* local development
* CI tools that do not require specific CI tooling configuration, such as GiLab Jobs.

## Published

[https://quay.io/repository/redhat-cop/ubi8-asciidoctor](https://quay.io/repository/redhat-cop/ubi8-asciidoctor) via [GitHub Workflows](../../.github/workflows/ubi8-asciidoctor-publish.yaml).
39 changes: 39 additions & 0 deletions utilities/ubi10-asciidoctor/basic-example.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
= Document Title
Doc Writer <doc@example.com>
:reproducible:
:listing-caption: Listing
:source-highlighter: rouge
:toc:
// Uncomment next line to add a title page (or set doctype to book)
//:title-page:
// Uncomment next line to set page size (default is A4)
//:pdf-page-size: Letter

An example of a basic https://asciidoc.org[AsciiDoc] document prepared by {author}.

== Introduction

A paragraph followed by an unordered list{empty}footnote:[AsciiDoc supports unordered, ordered, and description lists.] with square bullets.footnote:[You may choose from square, disc, and circle for the bullet style.]

[square]
* item 1
* item 2
* item 3

== Main

Here's how you say "`Hello, World!`" in Prawn:

.Create a basic PDF document using Prawn
[source,ruby]
----
require 'prawn'

Prawn::Document.generate 'example.pdf' do
text 'Hello, World!'
end
----

== Conclusion

That's all, folks!
38 changes: 38 additions & 0 deletions utilities/ubi10-asciidoctor/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

### Added
- changelog.md

### Changed

### Deprecated

### Removed

### Fixed

### Security


## [v3.0.0] - 2025-08-04


## Added
- changelog.md
- basic-example.adoc
- local-test-steps.txt

### Changed
- v2.2.1 is based on UBI8
- v3.0.0 is based on ubi10/ruby-33
- v3.0.0 has copied into directory ubi10-asciidoctor from ubi8-asciidoctor


Loading
Loading