Skip to content

Commit

Permalink
gitlab ci hinzugefügt und badges
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1702 committed Jun 20, 2023
1 parent ecc7ffa commit b8648f9
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .ci/notify_github.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# Installiere curl
apk add --update --no-cache curl

GITHUB_ORG="mediathekview"
GITHUB_REPO="kodi-repos"
GITHUB_SHA="${CI_COMMIT_SHA}"
cat << EOF > headers.curl
Accept: application/vnd.github+json
Authorization: token ${GITHUB_API_TOKEN}
EOF
cat << EOF > success.json
{
"state" : "success",
"target_url" : "${CI_PIPELINE_URL}",
"description" : "CI runs at ElaonDE systems successful"
}
EOF
cat << EOF > failure.json
{
"state" : "failure",
"target_url" : "${CI_PIPELINE_URL}",
"description" : "CI runs at ElaonDE systems failed"
}
EOF
cat << EOF > pending.json
{
"state" : "pending",
"target_url" : "${CI_PIPELINE_URL}",
"description" : "CI runs at ElaonDE systems pending"
}
EOF
GITHUB_API_URL="https://api.github.com/repos/${GITHUB_ORG}/${GITHUB_REPO}/statuses/${GITHUB_SHA}"
if [ "$1" == "success" ]; then
curl -s -X POST -H @headers.curl "${GITHUB_API_URL}" -d @success.json
elif [ "$1" == "failure" ]; then
curl -s -X POST -H @headers.curl "${GITHUB_API_URL}" -d @failure.json
elif [ "$1" == "pending" ]; then
curl -s -X POST -H @headers.curl "${GITHUB_API_URL}" -d @pending.json
fi
59 changes: 59 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
image: alpine

variables:
GIT_SUBMODULE_STRATEGY: recursive
PROD_ZIEL: /var/www/kodirepo.mediathekview.de/web/

stages:
- .prenotify
- testsyntax
- deploy
- .postnotify

#before_script:

notify-github-pending:
stage: .prenotify
when: always
script:
- .ci/notify_github.sh pending

deploy2prod:
stage: deploy
environment: production
script:
- "echo Vorherige Dateien:"
- ls -la $PROD_ZIEL
- echo Lösche alte Dateien am '${PROD_ZIEL}' ...
- rm -r ${PROD_ZIEL}* || echo "Keine Dateien vorhanden"
- echo Deploye Webseite nach '${PROD_ZIEL}' ...
- cp -r * $PROD_ZIEL
- echo "Passe Rechte auf (www-data) an..."
- "chown -R 33: $PROD_ZIEL"
- "echo Endstand am Ziel:"
- ls -la $PROD_ZIEL
only:
- master
tags:
- mvweb1


test:
stage: testsyntax
script:
- hugo -v
tags:
- mvweb1


notify-github-success:
stage: .postnotify
when: on_success
script:
- .ci/notify_github.sh success

notify-github-failure:
stage: .postnotify
when: on_failure
script:
- .ci/notify_github.sh failure
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Mediathekview Kodi Addon Repos
==============================

![Build Status](https://git.elaon.de/mv/kodi-repos/badges/master/pipeline.svg)


Dieses GITHUB Repository enthält verschieden Kodi Repositories für die installation des offizielle MediathekView Kodi Plugin.

Die stabilen Versionen für Kodi 20 (Nexus), Kodi 19 (Matrix), Kodi 18 (Leia) und Kodi 17 (Krypton) können über das "Stable Repository" bezogen werden.
Expand Down

0 comments on commit b8648f9

Please sign in to comment.