-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
859b5f9
commit 658e78e
Showing
4 changed files
with
35 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,18 @@ | ||
FROM registry.fedoraproject.org/fedora:30 as flamel | ||
|
||
MAINTAINER Fernando Lozano <[email protected]> | ||
FROM quay.io/flozanorht/flamel:0.3-7 as pre-commit | ||
|
||
# Adding "-subrelease" to packages, such as SLIDES="-1.2.0-1", breaks the build. | ||
# Having the dash as part of each version string allows installing whatever is latest by default, or forcing the build to use a fixed release | ||
RUN curl https://pre-commit.com/install-local.py | python - & \ | ||
ln -s /root/bin/pre-commit /usr/bin/pre-commit & \ | ||
dnf install -y perl ruby | ||
|
||
ARG CURRICULUM="-22-1" | ||
ARG BRANDING | ||
ARG FLAMEL | ||
ARG SLIDES | ||
ARG BOOKDIR="/tmp/coursebook" | ||
|
||
# Make sure we get English error messages to share with the team. | ||
|
||
ENV LANG="en_US.utf-8" \ | ||
BOOK="${BOOKDIR}" | ||
|
||
RUN curl http://wiki.gls.redhat.com/curriculum-repos/fedora/30/x86_64/curriculum-release-fedora${CURRICULUM}.fc30.noarch.rpm -o /tmp/curriculum-release-fedora${CURRICULUM}.fc30.noarch.rpm \ | ||
&& dnf -y install /tmp/*rpm \ | ||
&& rm -f /tmp/*rpm \ | ||
&& dnf --nodocs -y install \ | ||
publican-gls-redhat-new redhat-training-xsl${BRANDING} reveal-js-slide-generator${SLIDES} \ | ||
interstate-fonts overpass-fonts flamel${FLAMEL} git \ | ||
&& dnf clean all \ | ||
&& mkdir -p ${BOOK} | ||
|
||
COPY check-gls-packages.sh /tmp | ||
|
||
VOLUME ${BOOK} | ||
FROM pre-commit | ||
|
||
WORKDIR ${BOOK}/guides | ||
|
||
# Install pre-commit in a separate container. | ||
|
||
FROM flamel as pre-commit | ||
|
||
RUN pip install --upgrade pip &&\ | ||
pip install --upgrade wheel setuptools &&\ | ||
pip install pre-commit | ||
|
||
# Install additional packages and interpreters | ||
FROM pre-commit as pre-commit-hooks | ||
ARG BOOKDIR="/tmp/coursebook" | ||
|
||
RUN dnf install -y perl ruby | ||
ENV LANG="en_US.utf-8" | ||
|
||
# Setup ssh identities | ||
FROM pre-commit-hooks | ||
ENTRYPOINT ["pre-commit"] | ||
|
||
RUN mkdir /root/.ssh | ||
#COPY ssh /root/.ssh | ||
RUN chmod 0400 /root/.ssh/* | ||
WORKDIR ${BOOK} | ||
WORKDIR ${BOOKDIR} | ||
|
||
CMD ["pre-commit","run","-a"] | ||
CMD ["run","-a"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
Docker image for running GLS pre-commit hooks. | ||
Docker image for running GLS pre-commit hooks. | ||
|
||
Usage: | ||
Just run "pre-commit.sh" or alias it to "pre-commit" in your system. | ||
|
||
If your SSH configuration or your pre-commit cache is not in the default locations, update the appropriate variables in the "pre-commit.sh" script file as needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/sh | ||
|
||
image=quay.io/someth2say/pre-commit:0.1.0 | ||
|
||
book=$(pwd) | ||
container_book=/tmp/coursebook | ||
|
||
ssh_cfg=~/.ssh | ||
container_ssh_cfg=/root/.ssh | ||
|
||
pcommit_cache=~/.cache/pre-commit | ||
containe_pcommit_cache=/root/.cache/pre-commit | ||
|
||
docker run \ | ||
-v ${ssh_cfg}:${container_ssh_cfg} \ | ||
-v ${pcommit_cache}:${containe_pcommit_cache}:z \ | ||
-v ${book}:${container_book}:z \ | ||
${image} $@ |