This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from demokratie-live/2020/#828-kubernetes-setu…
…p-cronjobs-bio-admin switch to kubernetes
- Loading branch information
Showing
13 changed files
with
544 additions
and
338 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
node_modules | ||
npm-debug.log | ||
.next/ | ||
.next | ||
.env* |
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,40 @@ | ||
name: Docker Image | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
build: | ||
name: Build Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo dev)" | ||
id: extract_branch | ||
|
||
# - name: Extract branch name | ||
# shell: bash | ||
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
# id: extract_branch | ||
|
||
- name: Read package.json | ||
uses: tyankatsu0105/read-package-version-actions@v1 | ||
id: package-version | ||
|
||
- name: Extract repository name | ||
shell: bash | ||
run: echo "##[set-output name=REPOSITORY_NAME;]$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" | ||
id: extract_repository | ||
|
||
- uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
registry: docker.pkg.github.com | ||
repository: ${{ github.repository }}/${{ steps.extract_repository.outputs.REPOSITORY_NAME }} | ||
tags: ${{ steps.package-version.outputs.version }}-${{ steps.extract_branch.outputs.branch }} |
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
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,14 +1,35 @@ | ||
FROM node:12.11.1 | ||
FROM node:12-alpine AS BUILD_IMAGE | ||
|
||
# TMP - Yarn fix | ||
RUN mkdir -p /opt/yarn/bin && ln -s /opt/yarn/yarn-v1.5.1/bin/yarn /opt/yarn/bin/yarn | ||
# install next-optimized-images requirements | ||
RUN apk --no-cache update \ | ||
&& apk --no-cache add yarn curl g++ make bash zlib-dev libpng-dev python \ | ||
&& rm -fr /var/cache/apk/* | ||
|
||
# install node-prune (https://github.com/tj/node-prune) | ||
RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash -s -- -b /usr/local/bin | ||
|
||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
RUN yarn --frozen-lockfile | ||
COPY . . | ||
|
||
RUN yarn build | ||
|
||
RUN npm prune --production | ||
|
||
# run node prune | ||
RUN /usr/local/bin/node-prune | ||
|
||
FROM node:12-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN yarn install | ||
# copy from build image | ||
COPY --from=BUILD_IMAGE /app/.next ./.next | ||
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules | ||
|
||
RUN yarn build | ||
ENV NODE_ENV=production | ||
|
||
ENTRYPOINT [ "yarn", "start" ] |
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 @@ | ||
FROM node:12-alpine | ||
|
||
# install next-optimized-images requirements | ||
RUN apk --no-cache update \ | ||
&& apk --no-cache add yarn curl g++ make bash zlib-dev libpng-dev python \ | ||
&& rm -fr /var/cache/apk/* | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
RUN yarn --frozen-lockfile | ||
|
||
COPY . . | ||
|
||
ENV NODE_ENV=development | ||
|
||
ENTRYPOINT [ "yarn", "dev" ] |
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,47 @@ | ||
import React from 'react' | ||
|
||
const replaceText = (text, strPart, color) => { | ||
return text.replaceAll(strPart, `<span style="background-color: ${color}">${strPart}</span>`) | ||
} | ||
|
||
const replaceParties = (text) => { | ||
let outText = [ | ||
["Grüne", "#abffb3"], | ||
["Linke", "#fa9db0"], | ||
["CDU", "#d1c9ca"], | ||
["CSU", "#d1c9ca"], | ||
["Union", "#d1c9ca"], | ||
["FDP", "#f8ffa6"], | ||
["AfD", "#94fff8"], | ||
["SPD", "#fab59d"], | ||
["alle übrigen", "#ffe1a1"], | ||
].reduce((prev, p) => { | ||
return replaceText(prev, p[0], p[1]) | ||
}, text) | ||
return outText; | ||
} | ||
|
||
const replaceVoteKeywords = (text) => { | ||
const returnText = ["abgelehnt", "angenommen"].reduce((prev, docId) => { | ||
return replaceText(prev, docId, "#ff42e0") | ||
}, text) | ||
return returnText; | ||
} | ||
|
||
const replaceDocNumbers = (text, docIds) => { | ||
const returnText = docIds.reduce((prev, docId) => { | ||
return replaceText(prev, docId, "#ff42e0") | ||
}, text) | ||
return returnText; | ||
} | ||
|
||
const PlenarText = ({text, docIds}) => { | ||
let outText = replaceParties(text); | ||
outText = replaceVoteKeywords(outText); | ||
outText = replaceDocNumbers(outText, docIds); | ||
return ( | ||
<div dangerouslySetInnerHTML={{__html: outText }} style={{paddingBottom: "10px"}} /> | ||
) | ||
} | ||
|
||
export default PlenarText |
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
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
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,9 @@ | ||
import gql from "graphql-tag"; | ||
|
||
export default gql` | ||
query voteTexts($procedureId: String!) { | ||
voteResultTextHelper(procedureId: $procedureId) { | ||
results | ||
} | ||
} | ||
`; |
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
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
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
Oops, something went wrong.