Skip to content

Simplified generating of .env file

Konstantin Belykh requested to merge belykh_k/castopod.org:main into main

This change utilises ability for jq to find values of keys across different objects and by using grep we can filter out unneeded url of releases.

Simple explanation how it works:

  1. Get all needed prerequisite info from gitlab:
RELEASE_URL="https://code.castopod.org/api/v4/projects/2/releases"
CASTOPOD_VERSION=$(echo $(curl --silent https://code.castopod.org/api/v4/projects/2/releases | jq '.[0] | .tag_name') | tr -d '"')
LATEST_RELEASE_URL="https://code.castopod.org/api/v4/projects/2/releases/${CASTOPOD_VERSION}"
  1. Download information about latest release:
echo $(curl --silent ${LATEST_RELEASE_URL})
  1. Download information about all urls of released files
echo $(curl --silent ${LATEST_RELEASE_URL} | jq '.assets.links[].url')
  1. Filter out links so we only get .zip one
echo $(curl --silent ${LATEST_RELEASE_URL} | jq '.assets.links[].url' | grep -e '.zip')
  1. Clean up " from link
echo $(curl --silent ${LATEST_RELEASE_URL} | jq '.assets.links[].url' | grep -e '.zip' | tr -d '"')

Merge request reports