diff --git a/.drone.yml b/.drone.yml index 7faaa81a..5539e73a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -224,6 +224,21 @@ steps: branch: - master + - name: docker remote-scores-sync-zqds + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: nemunaire/fic-remote-scores-sync-zqds + auto_tag: true + auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} + dockerfile: Dockerfile-remote-scores-sync-zqds + when: + branch: + - master + --- kind: pipeline type: docker @@ -514,6 +529,21 @@ steps: password: from_secret: docker_password + - name: docker remote-scores-sync-zqds + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: nemunaire/fic-remote-scores-sync-zqds + auto_tag: true + auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} + dockerfile: Dockerfile-remote-scores-sync-zqds + when: + branch: + - master + trigger: event: - push diff --git a/Dockerfile-remote-scores-sync-zqds b/Dockerfile-remote-scores-sync-zqds new file mode 100644 index 00000000..b8373190 --- /dev/null +++ b/Dockerfile-remote-scores-sync-zqds @@ -0,0 +1,23 @@ +FROM golang:1.16.7-alpine as gobuild + +RUN apk add --no-cache git + +WORKDIR /go/src/srs.epita.fr/fic-server/ + +ADD go.mod go.sum ./ +ADD libfic ./libfic/ +ADD remote/scores-sync-zqds ./remote/scores-sync-zqds/ + +RUN go get -d -v ./remote/scores-sync-zqds +RUN go build -v -o ./scores-sync-zqds ./remote/scores-sync-zqds + + +FROM alpine + +RUN apk add --no-cache openssl ca-certificates + +WORKDIR /srv + +ENTRYPOINT ["/srv/scores-sync-zqds"] + +COPY --from=gobuild /go/src/srs.epita.fr/fic-server/scores-sync-zqds /srv/scores-sync-zqds diff --git a/admin/fill_teams_zqds.sh b/admin/fill_teams_zqds.sh new file mode 100755 index 00000000..cac5f2eb --- /dev/null +++ b/admin/fill_teams_zqds.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +BASEURL="http://127.0.0.1:8081/admin" + +EVENTID=6109ae5acbb7b36b789c9330 +BASEURL_ZQDS="https://api.well-played.gg" + +curl -s -H 'accept: */*' "${BASEURL_ZQDS}/teams?event_id=${EVENTID}&size=100" | jq --compact-output .content[] | while read TEAMOBJ; do + curl -s -d @- "${BASEURL}/api/teams/" <