Skip to content

Commit

Permalink
Push scylla-bench docker image using gocql version from the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
sylwiaszunejko committed Sep 4, 2024
1 parent 7656329 commit 0fc015a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.21

ARG version
ARG fork
ENV version=${version}
ENV fork=${fork:-scylladb/scylla-bench}

RUN apt-get update && apt-get -y install --no-install-recommends unzip curl && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN curl -Lo sb.zip https://github.com/${fork}/archive/refs/${version}.zip && \
unzip sb.zip && \
cd ./scylla-bench-* && \
GO111MODULE=on go install . && \
cd .. && \
rm -f sb.zip
65 changes: 65 additions & 0 deletions .github/workflows/scylla_bench_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build scylla-bench docker image with gocql PR

on:
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
# authorize:
# environment:
# ${{ github.event_name == 'pull_request_target' &&
# github.event.pull_request.head.repo.full_name != github.repository &&
# 'default' || 'internal' }}
# runs-on: ubuntu-latest
# steps:
# - run: true

build-scylla-bench:
# if: contains(github.event.pull_request.labels.*.name, 'extended-ci')
# needs: authorize
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Check out the scylla-bench repository
uses: actions/checkout@v2
with:
repository: scylladb/scylla-bench
path: scylla-bench

- name: Checkout GoCQL PR Repository
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: gocql

- name: Replace gocql with the PR version
run: |
cd scylla-bench
go mod edit -replace github.com/gocql/gocql=../gocql
go mod tidy
- name: Build and push Scylla-bench Docker Image
run: |
cd scylla-bench
export SCYLLA_BENCH_VERSION=tags/v0.1.9
export NAME="${{ github.event.pull_request.head.ref }}"
export SCYLLA_BENCH_DOCKER_IMAGE=scylladb/gocql-extended-ci:scylla-bench-${NAME}
docker build -f ../gocql/.github/workflows/Dockerfile . -t ${SCYLLA_BENCH_DOCKER_IMAGE} --build-arg version=$SCYLLA_BENCH_VERSION
docker push ${SCYLLA_BENCH_DOCKER_IMAGE}
- name: Trigger jenkins job
uses: mickeygoussetorg/trigger-jenkins-job@v1
with:
jenkins-server: "https://jenkins.scylladb.com"
jenkins-job: "scylla-staging/sylwia.szunejko/longevity-twcs-3h"
jenkins-username: "sylwiaszunejko"
jenkins-pat: ${{ secrets.JENKINS_TOKEN }}
poll-time: 90 # how often (seconds) to poll the jenkins server for results
timeout-value: 3600 # How long (seconds) to poll before timing out the action
verbose: true # true/false - turns on extra logging

0 comments on commit 0fc015a

Please sign in to comment.