Creating own UpdateCenter

Hi, trying to create my own updatecenter using GitHub - jenkins-infra/update-center2: Jenkins Update Center backend. Looking at the readme I understood that I should start the work by running the generate script ( matching certificates, variables as well as artifactory repo). I attached plugins in the repository using mvn deploy which looks like the right configuration. However, when running the script, I encounter the error ./site/generate-htaccess.sh [ …].
Expected at least one argument.
The tmp/tiers.json file does not contain any values. On what basis is this file generated? Why does it remain empty?
Is there documentation that shows actually how to create such a center? I am keen on providing plugins from my own artifactory for security reasons

I try to run generate.sh with command:

SECRET=/X/Certs ARTIFACTORY_URL="" ARTIFACTORY_API_URL="XX"  ARTIFACTORY_REPOSITORY="XX" ARTIFACTORY_USERNAME="XX" ARTIFACTORY_PASSWORD="XXX" ./site/generate.sh ./wwwroot ./download --root-certificate ./certs/cert.pem --certificate ./certs/update-center.cert --key ./certs/update-center.key

INFO    i.j.u.j.TieredUpdateSitesGenerator#update: Did not find declared core dependency version among all core releases: 2.263.4. It is used by org.jenkins-ci.plugins:docker-build-publish:1.4.0
Usage: ./site/generate-htaccess.sh [<release> ...]
Expected at least one argument.

Hello and welcome to this community, @luczajk. :wave:

  1. Make sure that the generate.sh script is correctly calling generate-htaccess.sh with the necessary arguments.
  2. The tiers.json file is typically generated based on the plugins and their metadata. Ensure that your Artifactory repository is correctly set up and accessible.
  3. Make sure to provide the necessary arguments to the generate-htaccess.sh script.

Here is an example command to run the generate.sh script with the necessary environment variables and arguments:

SECRET=/X/Certs \
ARTIFACTORY_URL="https://your-artifactory-url" \
ARTIFACTORY_API_URL="https://your-artifactory-api-url" \
ARTIFACTORY_REPOSITORY="your-repository" \
ARTIFACTORY_USERNAME="your-username" \
ARTIFACTORY_PASSWORD="your-password" \
./site/generate.sh ./wwwroot ./download --root-certificate ./certs/cert.pem --certificate ./certs/update-center.cert --key ./certs/update-center.key

Thank you for your response, I have used this template to start script generate.sh

SECRET=X
ARTIFACTORY_URL=X
ARTIFACTORY_API_URL=X
  ARTIFACTORY_REPOSITORY=X
ARTIFACTORY_USERNAME=X ARTIFACTORY_PASSWORD=X   ./site/generate.sh ./wwwroot ./download --root-certificate ./certs/cert.pem --certificate /path/tocert --key /path/to/key

Also I have deployed plugins on artifactory with mvn, it looks like good ledder in artifactory with all metadata. As far I can understand using generate.sh is the first step of running own UpdateCenter.

readarray -t WEEKLY_RELEASES < <( jq --raw-output '.weeklyCores[]' tmp/tiers.json ) || { echo "Failed to determine weekly tier list" >&2 ; exit 1 ; }
readarray -t STABLE_RELEASES < <( jq --raw-output '.stableCores[]' tmp/tiers.json ) || { echo "Failed to determine stable tier list" >&2 ; exit 1 ; }

# Workaround for https://github.com/jenkinsci/docker/issues/954 -- still generate fixed tier update sites
readarray -t RELEASES < <( curl --silent --fail 'https://repo.jenkins-ci.org/api/search/versions?g=org.jenkins-ci.main&a=jenkins-core&repos=releases&v=?.*.1' | jq --raw-output '.results[].version' | head -n 5 | $SORT --version-sort ) || { echo "Failed to retrieve list of recent LTS releases" >&2 ; exit 1 ; }

# prepare the www workspace for execution
rm -rf "$WWW_ROOT_DIR"
mkdir -p "$WWW_ROOT_DIR"

# Generate htaccess file
"$( dirname "$0" )"/generate-htaccess.sh "${WEEKLY_RELEASES[@]}" "${STABLE_RELEASES[@]}" > "$WWW_ROOT_DIR/.htaccess"

Looking at the above code, the situation is quite strange and I can’t debug it enough why generate-httaccess.sh gets an empty argument list when a few lines earlier weekly_releases is taken from tiers.json which indicates that this file is empty. Please let me know how artifactory should be configured so that it works properly and the tiers.json file is created.