mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[DEVOPS-1161] fix the rate limiting issue in building bitwarden unified (#2694)
* Add GH_PAT secret to build * Fix secret * Fix * Fix * Maybe fix * add cat for tags.json * Maybe fix * Matbe fix * Trying to fix * Change gh_pat path * Fix * Remove obsolete tags obtaining
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
# syntax = docker/dockerfile:1.2
|
||||
###############################################
|
||||
# Build stage #
|
||||
###############################################
|
||||
@ -13,7 +14,12 @@ RUN apt-get update && apt-get install -y \
|
||||
WORKDIR /tmp
|
||||
|
||||
# Download tags from 'clients' repository
|
||||
RUN curl https://api.github.com/repos/bitwarden/clients/git/refs/tags --output tags.json
|
||||
RUN --mount=type=secret,id=GH_PAT,target=/etc/secrets/GH_PAT if [ -e "/etc/secrets/GH_PAT" ]; then \
|
||||
curl --header "Authorization: token $(cat /etc/secrets/GH_PAT)" \
|
||||
https://api.github.com/repos/bitwarden/clients/git/refs/tags --output tags.json ; else \
|
||||
curl https://api.github.com/repos/bitwarden/clients/git/refs/tags --output tags.json ; fi
|
||||
|
||||
RUN cat tags.json
|
||||
|
||||
# Grab last tag/release of the 'web' client
|
||||
RUN cat tags.json | jq -r 'last(.[] | select(.ref|test("refs/tags/web-v[0-9]{4}.[0-9]{1,2}.[0-9]+"))) | .ref | split("/")[2]' > tag.txt
|
||||
|
Reference in New Issue
Block a user