diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4a1573d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,26 @@ +--- +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: testdrone + local_ref: testdrone + force: false + commit: true + commit_message: "DroneCI new build" + when: + event: + - pull_request diff --git a/.gitignore b/.gitignore index 1a3fc9f..d481ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -gh-pages/index.html -gh-pages/fond/index.html -gh-pages/_site -logs/ - ## Core latex/pdflatex auxiliary files: *.aux *.lof @@ -15,7 +10,6 @@ logs/ *.fot *.cb *.cb2 -*.pdf ## Intermediate documents: *.dvi @@ -25,7 +19,6 @@ logs/ *.ps report.pdf svg-inkscape/ -*.pdf ## Bibliography auxiliary files (bibtex/biblatex/biber): *.bbl @@ -224,4 +217,6 @@ TSWLatexianTemp* # expex forward references with \gathertags *-tags.tex +.DS_Store +.now diff --git a/.latexmkrc b/.latexmkrc deleted file mode 100644 index 3ed0163..0000000 --- a/.latexmkrc +++ /dev/null @@ -1 +0,0 @@ -$pdflatex = 'pdflatex -halt-on-error -interaction=nonstopmode'; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 46a068b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -before_install: - - sudo apt-get update -qq - - sudo apt-get install -qq texlive texlive-font-utils texlive-lang-european pandoc latexmk ghostscript - -script: - - make test - -deploy: - provider: pages - fqgd: statutter.abakus.no - local-dir: gh-pages - skip-cleanup: true - github-token: $GITHUB_TOKEN - keep-history: true - on: - branch: master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b998635 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile deleted file mode 100644 index 47f32ab..0000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -ifeq ($(shell uname -s), Darwin) - OPEN='open' -else - OPEN='see' -endif - -ABAKUS=abakus-statutter -# Used to check if any of the tex files have been changed -all: $(ABAKUS).pdf - -test: clean all jekyll - -%.pdf: %.tex - @ mkdir -p logs - @ latexmk -pdf $< >> logs/compile \ - && echo "Compiled $@" || (cat logs/compile && fail) - -$(ABAKUS).tex: $(ABAKUS)/*.tex - @touch $@ - -open: $(ABAKUS).pdf - $(OPEN) $(ABAKUS).pdf - -clean: - rm -f *.log *.aux *.lof *.pdf *.toc *.lot *.out *.fdb_latexmk *.fls - rm -rf logs - rm -f gh-pages/index.html gh-pages/*.pdf - -jekyll: clean gh-pages/index.html gh-pages/$(ABAKUS).pdf - -gh-pages/index.html: $(ABAKUS).tex - @echo "---\nlayout: abakus\n---" > gh-pages/index.html - @pandoc -f latex -t html $(ABAKUS)/innhold.tex >> gh-pages/index.html - @echo "Created $@" - -gh-pages/%.pdf: %.pdf - cp $< $@ - -.PHONY: open clean jekyll diff --git a/README.md b/README.md index 7c1ef7d..a4444b7 100644 --- a/README.md +++ b/README.md @@ -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. -#### 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 ``` diff --git a/abakus-statutter/innhold.tex b/abakus-statutter/innhold.tex deleted file mode 100644 index 0e33019..0000000 --- a/abakus-statutter/innhold.tex +++ /dev/null @@ -1,8 +0,0 @@ -\input{abakus-statutter/00-definisjoner} -\input{abakus-statutter/01-03-foreningen} -\input{abakus-statutter/04-06-medlemskap} -\input{abakus-statutter/07-arrangementer} -\input{abakus-statutter/08-generalforsamling} -\input{abakus-statutter/09-organisasjon} -\input{abakus-statutter/10-okonomi} -\input{abakus-statutter/11-statutter} diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..210179c --- /dev/null +++ b/generate.sh @@ -0,0 +1,33 @@ +TIMESTAMP=`eval date +%d.%B.%Y` + +# 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 \ + ./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 \ diff --git a/gh-pages/CNAME b/gh-pages/CNAME deleted file mode 100644 index e61525c..0000000 --- a/gh-pages/CNAME +++ /dev/null @@ -1 +0,0 @@ -statutter.abakus.no diff --git a/gh-pages/Gemfile b/gh-pages/Gemfile deleted file mode 100644 index 37f5eaa..0000000 --- a/gh-pages/Gemfile +++ /dev/null @@ -1,2 +0,0 @@ -source 'https://rubygems.org' -gem 'github-pages', group: :jekyll_plugins diff --git a/gh-pages/Gemfile.lock b/gh-pages/Gemfile.lock deleted file mode 100644 index f124f2c..0000000 --- a/gh-pages/Gemfile.lock +++ /dev/null @@ -1,248 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.2.10) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.4) - dnsruby (1.61.2) - addressable (~> 2.5) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - ethon (0.12.0) - ffi (>= 1.3.0) - eventmachine (1.2.7) - execjs (2.7.0) - faraday (0.15.4) - multipart-post (>= 1.2, < 3) - ffi (1.10.0) - forwardable-extended (2.6.0) - gemoji (3.0.0) - github-pages (196) - activesupport (= 4.2.10) - github-pages-health-check (= 1.16.0) - jekyll (= 3.7.4) - jekyll-avatar (= 0.6.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.5) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.11.0) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.12.1) - jekyll-mentions (= 1.4.1) - jekyll-optional-front-matter (= 0.3.0) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.2.0) - jekyll-redirect-from (= 0.14.0) - jekyll-relative-links (= 0.6.0) - jekyll-remote-theme (= 0.3.1) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.5.0) - jekyll-sitemap (= 1.2.0) - jekyll-swiss (= 0.4.0) - jekyll-theme-architect (= 0.1.1) - jekyll-theme-cayman (= 0.1.1) - jekyll-theme-dinky (= 0.1.1) - jekyll-theme-hacker (= 0.1.1) - jekyll-theme-leap-day (= 0.1.1) - jekyll-theme-merlot (= 0.1.1) - jekyll-theme-midnight (= 0.1.1) - jekyll-theme-minimal (= 0.1.1) - jekyll-theme-modernist (= 0.1.1) - jekyll-theme-primer (= 0.5.3) - jekyll-theme-slate (= 0.1.1) - jekyll-theme-tactile (= 0.1.1) - jekyll-theme-time-machine (= 0.1.1) - jekyll-titles-from-headings (= 0.5.1) - jemoji (= 0.10.2) - kramdown (= 1.17.0) - liquid (= 4.0.0) - listen (= 3.1.5) - mercenary (~> 0.3) - minima (= 2.5.0) - nokogiri (>= 1.8.5, < 2.0) - rouge (= 2.2.1) - terminal-table (~> 1.4) - github-pages-health-check (1.16.0) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (~> 3.0) - typhoeus (~> 1.3) - html-pipeline (2.10.0) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.6.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.7.4) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.6.0) - jekyll (~> 3.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.2.0) - commonmarker (~> 0.14) - jekyll (>= 3.0, < 4.0) - jekyll-commonmark-ghpages (0.1.5) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1) - rouge (~> 2) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.11.0) - jekyll (~> 3.3) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.12.1) - jekyll (~> 3.4) - octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.4.1) - html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-optional-front-matter (0.3.0) - jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.2.0) - jekyll (~> 3.0) - jekyll-redirect-from (0.14.0) - jekyll (~> 3.3) - jekyll-relative-links (0.6.0) - jekyll (~> 3.3) - jekyll-remote-theme (0.3.1) - jekyll (~> 3.5) - rubyzip (>= 1.2.1, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.5.0) - jekyll (~> 3.3) - jekyll-sitemap (1.2.0) - jekyll (~> 3.3) - jekyll-swiss (0.4.0) - jekyll-theme-architect (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.5.3) - jekyll (~> 3.5) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.1) - jekyll (~> 3.3) - jekyll-watch (2.1.2) - listen (~> 3.0) - jemoji (0.10.2) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (~> 3.0) - kramdown (1.17.0) - liquid (4.0.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - mercenary (0.3.6) - mini_portile2 (2.4.0) - minima (2.5.0) - jekyll (~> 3.5) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.11.3) - multipart-post (2.0.0) - nokogiri (1.10.1) - mini_portile2 (~> 2.4.0) - octokit (4.13.0) - sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (3.0.3) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) - ffi (~> 1.0) - rouge (2.2.1) - ruby-enum (0.7.2) - i18n - ruby_dep (1.5.0) - rubyzip (1.2.2) - safe_yaml (1.0.5) - sass (3.7.3) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.3.1) - ethon (>= 0.9.0) - tzinfo (1.2.5) - thread_safe (~> 0.1) - unicode-display_width (1.4.1) - -PLATFORMS - ruby - -DEPENDENCIES - github-pages - -BUNDLED WITH - 2.0.1 diff --git a/gh-pages/_layouts/abakus.html b/gh-pages/_layouts/abakus.html deleted file mode 100644 index ba3347e..0000000 --- a/gh-pages/_layouts/abakus.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: default -title: Abakus' statutter ---- -