Skip to content

Commit

Permalink
chore: Update Dockerfile. (eclipse-che#2213)
Browse files Browse the repository at this point in the history
Co-authored-by: Florent BENOIT <[email protected]>
  • Loading branch information
themr0c and benoitf authored Jan 21, 2022
1 parent 17589b1 commit 41dba62
Show file tree
Hide file tree
Showing 14 changed files with 392 additions and 84 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/build-and-validate-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#

# Name is reused in `publish-netlify.yml`
name: "Build and validate PR"
name: "Build and validate pull request"

on:
- pull_request

jobs:
build:
name: link checker # This job name is set as mandatory in the GitHub configuration.
name: "Build and validate pull request"
runs-on: ubuntu-20.04
container: "quay.io/eclipse/che-docs:latest"
steps:
Expand All @@ -36,6 +36,7 @@ jobs:
run: |
echo "::set-output name=yearweek::$(/bin/date -u "+%Y%U")"
shell: bash

- name: Restore cache
uses: actions/cache@v2
env:
Expand All @@ -46,30 +47,21 @@ jobs:

- name: Build using antora # and fail on warning
id: antora-build
run: CI=true antora generate antora-playbook-for-development.yml --stacktrace 2>&1 | (tee | grep WARNING && exit 42 || exit 0)

- name: Upload artifact doc-content
uses: actions/upload-artifact@v2
with:
name: doc-content
path: build/site
run: CI=true antora generate antora-playbook-for-development.yml --stacktrace --log-failure-level=warn

- name: Store PR info for publish-netlify
- name: Store pull request details for publish-netlify
run: |
echo "${{ github.event.number }}" > PR_NUMBER
echo "${{ github.event.pull_request.head.sha }}" > PR_SHA
- name: Upload artifact pull-request-number for publish-netlify
uses: actions/upload-artifact@v2
with:
name: pull-request-number
path: PR_NUMBER

- name: Upload artifact pull-request-sha for publish-netlify
- name: Upload artifact doc-content
uses: actions/upload-artifact@v2
with:
name: pull-request-sha
path: PR_SHA
name: doc-content
path: |
build/site
PR_NUMBER
PR_SHA
- name: Validate links using htmltest
id: validate-links
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Copyright (c) 2022 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

name: Build and publish container

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to docker.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
registry: docker.io
- name: Login to quay.io
uses: docker/login-action@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
- name: Docker Build and Push
run: |
SHORT_SHA1=$(git rev-parse --short=7 HEAD)
docker buildx build --platform linux/amd64 -f Dockerfile --push -t quay.io/eclipse/che-docs:${SHORT_SHA1} -t quay.io/eclipse/che-docs:next .
25 changes: 6 additions & 19 deletions .github/workflows/publish-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: Publish doc-content using netlify
on:
workflow_run:
workflows:
- "Build and validate PR"
- "Build and validate pull request"
types:
- completed

Expand All @@ -31,31 +31,18 @@ jobs:
name: doc-content
path: content

- name: Download pull-request-number artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pull-request-number

- name: Set PR_NUMBER variable
- name: Set PR_NUMBER and PR_SHA variables in GITHUB_ENV
run: |
pr_number=$(cat "PR_NUMBER")
pr_number=$(cat "content/PR_NUMBER")
if ! [[ "$pr_number" =~ ^[0-9]+$ ]]; then
echo "pr number invalid"
exit 1
fi
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
- name: Download pull-request-sha artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pull-request-sha

- name: Set PR_SHA variable
run: |
pr_sha=$(cat "PR_SHA")
rm content/PR_NUMBER
pr_sha=$(cat "content/PR_SHA")
echo "PR_SHA=$pr_sha" >> $GITHUB_ENV
rm content/PR_SHA
- name: Publish doc-content using netlify
uses: netlify/actions/cli@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ linkchecker-out.html
.local
.yarnrc
yarn.lock
package.json
22 changes: 12 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN wget -qO- https://github.com/wjdp/htmltest/archive/refs/tags/v${HTMLTEST_VER

FROM docker.io/library/golang:1.17-alpine3.13 as vale-builder
WORKDIR /vale
ARG VALE_VERSION=2.12.1
ARG VALE_VERSION=2.14.0
RUN wget -qO- https://github.com/errata-ai/vale/archive/v${VALE_VERSION}.tar.gz | tar --strip-components=1 -zxvf - \
&& export ARCH="$(uname -m)" \
&& if [[ ${ARCH} == "x86_64" ]]; \
Expand All @@ -39,7 +39,7 @@ RUN wget -qO- https://github.com/errata-ai/vale/archive/v${VALE_VERSION}.tar.gz
&& GOOS=linux GOARCH=${ARCH} CGO_ENABLED=0 go build -tags closed -ldflags "-X main.date=`date -u +%Y-%m-%dT%H:%M:%SZ` -X main.version=${VALE_VERSION}" -o bin/vale ./cmd/vale \
&& /vale/bin/vale --version

FROM docker.io/library/alpine:3.13
FROM docker.io/library/alpine:3.15

COPY --from=newdoc-builder /usr/local/cargo/bin/newdoc /usr/local/bin/newdoc
COPY --from=vale-builder /vale/bin/vale /usr/local/bin/vale
Expand All @@ -48,19 +48,20 @@ COPY --from=htmltest-builder /htmltest/bin/htmltest /usr/local/bin/htmltest
EXPOSE 4000
EXPOSE 35729

LABEL description="Tools to build Eclipse Che documentation: antora, asciidoctor.js, bash, curl, findutils, git, gulp, jinja2, jq, linkchecker, newdoc, vale, yq" \
io.k8s.description="Tools to build Eclipse Che documentation: antora, asciidoctor.js, bash, curl, findutils, git, gulp, jinja2, jq, linkchecker, newdoc, vale, yq" \
LABEL description="Tools to build Eclipse Che documentation." \
io.k8s.description="Tools to build Eclipse Che documentation." \
io.k8s.display-name="Che-docs tools" \
license="Eclipse Public License - v 2.0" \
MAINTAINERS="Eclipse Che Documentation Team" \
maintainer="Eclipse Che Documentation Team" \
name="che-docs" \
source="https://github.com/eclipse/che-docs/Dockerfile" \
source="https://github.com/eclipse/che-docs/blob/main/Dockerfile" \
summary="Tools to build Eclipse Che documentation" \
URL="quay.io/eclipse/che-docs" \
vendor="Eclipse Che Documentation Team" \
version="2021.11"
version="2022.01"

ARG ANTORA_VERSION=3.0.0
RUN apk add --no-cache --update \
bash \
curl \
Expand All @@ -76,27 +77,28 @@ RUN apk add --no-cache --update \
tar \
xmlstarlet \
yarn \
&& pip3 install --no-cache-dir --no-input jinja2-cli linkchecker yq \
&& yarnpkg global add --ignore-optional --non-interactive @antora/cli@latest @antora/site-generator-default@latest asciidoctor gulp gulp-connect \
&& pip3 install --no-cache-dir --no-input diagrams jinja2-cli yq \
&& yarnpkg global add --ignore-optional --non-interactive @antora/cli@${ANTORA_VERSION} @antora/site-generator@${ANTORA_VERSION} @antora/site-generator-default@latest @antora/lunr-extension asciidoctor gulp gulp-connect \
&& rm -rf $(yarnpkg cache dir)/* \
&& rm -rf /tmp/* \
&& antora --version \
&& asciidoctor --version \
&& bash --version \
&& curl --version \
&& curl --version \
&& git --version \
&& gulp --version \
&& htmltest --version \
&& jinja2 --version \
&& jq --version \
&& linkchecker --version \
&& newdoc --version \
&& vale -v \
&& yq --version

VOLUME /projects
WORKDIR /projects
ENV HOME="/projects" \
NODE_PATH="/usr/local/share/.config/yarn/global/node_modules"
NODE_PATH="/usr/local/share/.config/yarn/global/node_modules" \
USER_NAME=che-docs

USER 1001
5 changes: 5 additions & 0 deletions antora-playbook-for-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#

# Use this Antora Playbook for development, to build current state in HEAD.
antora:
extensions:
- require: "@antora/lunr-extension"
site:
title: Eclipse Che Documentation
# Disabling url on purpose to avoid htmltest crawling the live website.
Expand All @@ -35,3 +38,5 @@ urls:
redirect_facility: static
runtime:
cache_dir: ./.cache/antora
log:
level: info
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const connect = require('gulp-connect')
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const fs = require('fs')
const generator = require('@antora/site-generator-default')
const generator = require('@antora/site-generator')
const { reload: livereload } = process.env.LIVERELOAD === 'true' ? require('gulp-connect') : {}
const { parallel, series, src, watch } = require('gulp')
const yaml = require('js-yaml')

const playbookFilename = 'antora-playbook-for-development.yml'
const playbook = yaml.safeLoad(fs.readFileSync(playbookFilename, 'utf8'))
const playbook = yaml.load(fs.readFileSync(playbookFilename, 'utf8'))
const outputDir = (playbook.output || {}).dir || './build/site'
const serverConfig = { name: 'Preview Site', livereload, host: '0.0.0.0', port: 4000, root: outputDir }
const antoraArgs = ['--playbook', playbookFilename]
Expand Down
8 changes: 0 additions & 8 deletions package.json

This file was deleted.

Empty file removed supplemental-ui/.htaccess
Empty file.
76 changes: 76 additions & 0 deletions supplemental-ui/css/search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.search-result-dropdown-menu {
position: absolute;
z-index: 100;
display: block;
right: 0;
left: inherit;
top: 100%;
border-radius: 4px;
margin: 6px 0 0;
padding: 0;
text-align: left;
height: auto;
background: transparent;
border: none;
max-width: 600px;
min-width: 500px;
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 768px) {
.search-result-dropdown-menu {
min-width: calc(100vw - 3.75rem);
}
}

.search-result-dataset {
position: relative;
border: 1px solid #d9d9d9;
background: #fff;
border-radius: 4px;
overflow: auto;
padding: 0 8px;
max-height: calc(100vh - 5.25rem);
line-height: 1.5;
}

.search-result-item {
display: flex;
margin: 0.5rem 0;
}

.search-result-document-title {
width: 33%;
border-right: 1px solid #ddd;
color: #02060c;
font-weight: 500;
font-size: 0.8rem;
padding: 0.5rem 0.5rem 0.5rem 0;
text-align: right;
position: relative;
word-wrap: break-word;
}

.search-result-document-hit {
flex: 1;
font-size: 0.75rem;
color: #63676d;
}

.search-result-document-hit > a {
color: inherit;
display: block;
padding: 0.55rem 0.25rem 0.55rem 0.75rem;
}

.search-result-document-hit > a:hover {
background-color: rgba(69, 142, 225, 0.05);
}

.search-result-highlight {
color: #174d8c;
background: rgba(143, 187, 237, 0.1);
padding: 0.1em 0.05em;
font-weight: 500;
}

Loading

0 comments on commit 41dba62

Please sign in to comment.