From 5e3869d825136aa18a0b824405c9d3a68f39fa0e Mon Sep 17 00:00:00 2001 From: Michel Barret Date: Sun, 22 Dec 2024 13:49:20 +0100 Subject: [PATCH] update voxxrin script --- .github/workflows/update_voxxrin.yml | 6 +++--- README.md | 9 +++++++++ voxxrin/voxxrin.sh | 30 +++++++++++++++++----------- 3 files changed, 30 insertions(+), 15 deletions(-) mode change 100644 => 100755 voxxrin/voxxrin.sh diff --git a/.github/workflows/update_voxxrin.yml b/.github/workflows/update_voxxrin.yml index 98584f8..fc48ab1 100644 --- a/.github/workflows/update_voxxrin.yml +++ b/.github/workflows/update_voxxrin.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout your repository using git uses: actions/checkout@v3 - name: update + env: + VOXXRIN_TOKEN: ${{ secrets.VOXXRIN_TOKEN }} run: | - cd voxxrin - chmod +x voxxrin.sh - ./voxxrin.sh update + voxxrin/voxxrin.sh update diff --git a/README.md b/README.md index 5b0e6d8..60d7ab7 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,12 @@ All commands are run from the root of the project, from a terminal: ## 👀 Want to learn more about Astro? Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). + +# Voxxrin update + +To update Voxxrin schedule + +```sh +VOXXRIN_TOKEN='url encoded voxxrin token' voxxrin/voxxrin.sh update +``` + diff --git a/voxxrin/voxxrin.sh b/voxxrin/voxxrin.sh old mode 100644 new mode 100755 index db3daa1..d10b1ac --- a/voxxrin/voxxrin.sh +++ b/voxxrin/voxxrin.sh @@ -1,4 +1,5 @@ -# VOXXRIN est le site web utilisé pour publier le programme de la conference. +#!/usr/bin/env bash +# VOXXRIN est le site web utilisé pour publier le programme de la conference. # Le site se base sur OpenPlanner qui lui même est branché sur Conference Hall # Ce script sert à mettre à jour le site voxxrin. La mise à jour se base sur # Le fichier de configuration est dans /public/voxxrin/ et sur ce qu'il y a dans @@ -6,24 +7,27 @@ # La mise à jour de Open Planner s'effectue dans conference hall en faisant un # export. Attention à n'exporter que les talks 'confirmed'. # -#Author: Sebastien Chassande +# Author: Sebastien Chassande ############################################################################### # Variables de configuration ############################################################################### VOXXRIN_BASE_URL=https://api.voxxr.in VOXXRIN_EVENT_ID=snowcamp25 -#Le token de voxxrin mais les : on été remplacés par des %3A pour le passage dans l'url -VOXXRIN_TOKEN=eventOrganizer%3Asnowcamp%3A4238c6e8-d71c-46dc-826f-2f78721b7278 + +if [[ -z "$VOXXRIN_TOKEN" ]]; then + echo 'Missing $VOXXRIN_TOKEN environment variable' + exit 1 +fi ############################################################################### # Fonction d'affichage de l'usage du script ############################################################################### function usage() { - echo "Usage du script:" - echo " ./voxxrin.sh update : Mets à jour le site voxxrin" - echo " ./voxxrin.sh talks-stats : Telecharge les statistiques de tous les talks" - echo " ./voxxrin.sh usage : Affiche cette documentation" + echo "Usage du script (need VOXXRIN_TOKEN env var token url encoded):" + echo " ./voxxrin.sh update : Mets à jour le site voxxrin" + echo " ./voxxrin.sh talks-stats : Telecharge les statistiques de tous les talks" + echo " ./voxxrin.sh usage : Affiche cette documentation" } ############################################################################### @@ -38,9 +42,9 @@ curl --request POST --url "${VOXXRIN_BASE_URL}/api/crawlers/${VOXXRIN_EVENT_ID}/ ############################################################################### function getTalksStats() { #{{baseUrl}}/api/events/{{eventId}}/talksStats?token={{secretToken}} - curl --request GET --silent --url "${VOXXRIN_BASE_URL}/api/events/${VOXXRIN_EVENT_ID}/talksStats?token=${VOXXRIN_TOKEN}" > talks-stats.json - node talks-stats.cjs talks-stats.json - rm talks-stats.json + curl --request GET --silent --url "${VOXXRIN_BASE_URL}/api/events/${VOXXRIN_EVENT_ID}/talksStats?token=${VOXXRIN_TOKEN}" > talks-stats.json + node talks-stats.cjs talks-stats.json + rm talks-stats.json } @@ -54,5 +58,7 @@ case $1 in "talks-stats") getTalksStats $* ;; - *) usage;; + *) + usage + ;; esac