-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker build #65
base: master
Are you sure you want to change the base?
Docker build #65
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
kind: pipeline | ||
type: docker | ||
name: default | ||
|
||
steps: | ||
- name: build | ||
image: abakus/statuttbuilder:latest | ||
commands: | ||
- ./generate.sh | ||
when: | ||
event: | ||
- pull_request | ||
|
||
- name: push | ||
image: appleboy/drone-git-push | ||
settings: | ||
remote_name: origin | ||
branch: dronebbuild | ||
force: false | ||
commit: true | ||
commit_message: "DroneCI new build" | ||
when: | ||
event: | ||
- pull_request |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get install -y --no-install-recommends \ | ||
texlive \ | ||
texlive-latex-base \ | ||
texlive-font-utils \ | ||
texlive-lang-european \ | ||
pandoc \ | ||
ghostscript | ||
|
||
WORKDIR /statutter | ||
# | ||
#COPY ./generate.sh / | ||
# | ||
#CMD /generate.sh |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,30 @@ | ||
# Abakus' statutter [![Build Status](https://travis-ci.org/abakus-ntnu/statutter.svg?branch=master)](https://travis-ci.org/abakus-ntnu/statutter) | ||
Her finner du LaTeX-kildekoden til statuttene til Abakus Linjeforening. | ||
Send gjerne endringsforslag via pull-requests, les mer om reglene for | ||
statuttendringer i [CONTRIBUTING.md](CONTRIBUTING.md). | ||
|
||
## Bygging av PDF | ||
### Installering av pdfTeX | ||
pdfTeX kreves for å bygge statuttene. Det kan installeres på følgende måte: | ||
|
||
macOS (krever [Homebrew](https://brew.sh/)): | ||
```bash | ||
brew cask install mactex | ||
``` | ||
# Abakus' statutter | ||
|
||
Ubuntu: | ||
```bash | ||
sudo apt-get install texlive texlive-font-utils texlive-lang-european latexmk | ||
``` | ||
Her finner du LaTeX-kildekoden til statuttene til Abakus Linjeforening. Send gjerne endringsforslag via pull-requests, les mer om reglene for statuttendringer i [CONTRIBUTING.md](CONTRIBUTING.md). | ||
|
||
### Kompilere PDF | ||
```bash | ||
make | ||
``` | ||
## Organisering | ||
|
||
## Nettside | ||
### Publisering | ||
[GitHub Pages](https://pages.github.com/) brukes til å hoste | ||
[statutter.abakus.no](https://statutter.abakus.no). Opplastning av siste versjon | ||
skjer automatisk av [Travis](https://travis-ci.org/abakus-ntnu/statutter) når | ||
commits blir pushet til master. | ||
|
||
### Lokal utvikling | ||
#### Avhengigheter | ||
macOS (krever [Homebrew](https://brew.sh/)): | ||
```bash | ||
brew install pandoc | ||
``` | ||
`statutter` mappen inneholder kildekoden til statuttene. | ||
|
||
Ubuntu: | ||
```bash | ||
sudo apt-get install pandoc | ||
``` | ||
`static` mappen inneholder filer som blir brukt under generering av nettsiden. | ||
|
||
`public` mappen inneholder alt av output som docker containeren genererer. Denne mappen blir entrypoint for nettsiden, og det er disse html og css filene som brukere ser. | ||
|
||
## Bygging av statutter | ||
|
||
Alle statuttene bygges ved hjelp av et `docker` image som har all programvare som trengs, samt et generering script som bruker denne programvaren. Scriptet bygger både `pdf` og `html` versjon av statuttene. | ||
|
||
### Kjør bilde ved hjelp av følgende kommando | ||
|
||
Den mounter de tre volumene `statutter, static og public` som blir brukt av bildet når den bygger statutter. | ||
|
||
I tillegg kan du sende inn `ASSEMBLY_DATE` som en variabel, og den genererte pdf filen som blir arkivert får dette navnet. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this env-var doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was a thing back in the day, but now it's deprecated. |
||
|
||
#### Bygging | ||
```bash | ||
make jekyll | ||
cd gh-pages | ||
bundle exec jekyll serve | ||
```sh | ||
$ docker run --rm \ | ||
-v `pwd`/statutter:/statutter/ \ | ||
-v `pwd`/static:/static/ \ | ||
-v `pwd`/public:/public/ \ | ||
-e ASSEMBLY_DATE=01.januar.1970 \ | ||
abakus/statuttbuilder:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better to use the Dockerfile instead, to make sure that the correct version is used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That might be a good idea |
||
``` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
TIMESTAMP=`eval date +%d.%B.%Y` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need a shell script to generate them, instead of the Makefile? If we have a shell-script, it should at least do proper error handling to make it possible to understand if something fails... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should at least enforce shellcheck |
||
|
||
# Convert abakus LaTeX to html | ||
pandoc -f latex -o public/index.html \ | ||
--include-in-header=static/head.html \ | ||
--include-before-body=static/abakus.html \ | ||
--include-after-body=static/end.html \ | ||
statutter/abakus-statutter/innhold.tex | ||
|
||
# Move other static files to the public folder | ||
cp static/main.css static/abakule.jpg public/ | ||
|
||
# Convert abakus LaTeX to PDF | ||
pdflatex -halt-on-error statutter/abakus-statutter.tex | ||
pdflatex -halt-on-error statutter/abakus-statutter.tex | ||
pdflatex -pdf -halt-on-error -output-dir="./public" statutter/abakus-statutter.tex | ||
|
||
# Store a copy of the pdf in the archive | ||
mkdir -p public/archive/ | ||
cp public/*.pdf public/archive/$TIMESTAMP.pdf | ||
|
||
# Clean up the Statutter directory, as it used to genereate fles | ||
rm -f ./statutter/*.log \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to remove these files? |
||
./statutter/*.aux \ | ||
./statutter/*.out \ | ||
./statutter/*.toc \ | ||
./statutter/*.pdf # The result PDF is moved to /public by pdflatex | ||
|
||
# Clean up the public directory, as it's used to genereate fles | ||
rm -f ./public/*.log \ | ||
./public/*.aux \ | ||
./public/*.out \ | ||
./public/*.toc \ |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work yet, but it's supposed to do the same things as
Travis
does, where it builds then pushes the public code to another branch, which is served.The whole process isn't planned yet.