Commit 82e4dd26 authored by Tobias Schmidt's avatar Tobias Schmidt

Use authentification for github release API requests

So far the requests against the Github API to fetch release information
has been made unauthenticated, making them subject to a rate-limit of 10
requests per hour per IP. As the build process is executed on Travis CI,
this results in many build failures.

The requests are now made with a personal access token, in the form of
GITHUB_AUTHENTICATION="-u prombot:<oauth token>". The standard printing
in the Makefile has been removed in order to not expose the token.
parent c825dc13
sudo: false
language: ruby
branches:
only:
- master
only:
- master
script: make deploy
before_install:
- eval "$(ssh-agent -s)"
- openssl aes-256-cbc -K $encrypted_2ba894bc7c2f_key -iv $encrypted_2ba894bc7c2f_iv -in prometheus_rsa.enc -out prometheus_rsa -d
- chmod 600 prometheus_rsa
- ssh-add prometheus_rsa
- eval "$(ssh-agent -s)"
- openssl aes-256-cbc -K $encrypted_2ba894bc7c2f_key -iv $encrypted_2ba894bc7c2f_iv -in prometheus_rsa.enc -out prometheus_rsa -d
- chmod 600 prometheus_rsa
- ssh-add prometheus_rsa
env:
global:
secure: aNZoB4UDtdelUDxFTTJa5Dxm8gXorKGmQWYaFIXzuBwLvFMp1toIY+amsMrGBbnvxrJosO4764GpS8sWRT/Jbr252sxjOe8N4jfbtJUX29U2aNFQSWVc/o8VnKFW1NI5cjBAZ9OOvgpS6KUGkXZ2/PTmvgxvyqGS4pPovIM1OOo=
......@@ -11,12 +11,14 @@ deploy: github_pages_export github_pages_push
downloads: $(DOWNLOADS:%=downloads/%/repo.json) $(DOWNLOADS:%=downloads/%/releases.json)
downloads/%/repo.json:
mkdir -p $(dir $@)
curl -sf -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/prometheus/$* > $@
@mkdir -p $(dir $@)
# curl -sf -H 'Accept: application/vnd.github.v3+json' <GITHUB_AUTHENTICATION> https://api.github.com/repos/prometheus/$* > $@
@curl -sf -H 'Accept: application/vnd.github.v3+json' $(GITHUB_AUTHENTICATION) https://api.github.com/repos/prometheus/$* > $@
downloads/%/releases.json:
mkdir -p $(dir $@)
curl -sf -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/prometheus/$*/releases > $@
@mkdir -p $(dir $@)
# curl -sf -H 'Accept: application/vnd.github.v3+json' <GITHUB_AUTHENTICATION> https://api.github.com/repos/prometheus/$*/releases > $@
@curl -sf -H 'Accept: application/vnd.github.v3+json' $(GITHUB_AUTHENTICATION) https://api.github.com/repos/prometheus/$*/releases > $@
github_pages_export: compile
cd output && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment