-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gianmarco Fraccaroli
committed
Oct 16, 2023
1 parent
3aa0db7
commit ea290e0
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build docker images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The docker image tag' | ||
required: true | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
GIT_LFS_SKIP_SMUDGE: 1 | ||
|
||
jobs: | ||
docker: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
version: v0.9.1 | ||
- name: Login to private registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.REGISTRY_URL }} | ||
username: ${{ secrets.REGISTRY_USERNAME }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ secrets.REGISTRY_URL }}/namada-load-tester | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=raw,value=latest | ||
- name: Build and Push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: ${{ github.ref == 'refs/heads/master' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# use the default dart image as the build image | ||
FROM rust:1.70 AS builder | ||
|
||
# copy the current folder into the build folder | ||
COPY . /app | ||
|
||
# set the work directory | ||
WORKDIR /app | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update | ||
|
||
# build app | ||
RUN cargo build --release | ||
|
||
# use a slim image | ||
FROM debian:bullseye-slim | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y ca-certificates | ||
|
||
# copy the runtime files | ||
COPY scenarios /app | ||
COPY --from=builder /app/target/release/namada-load-tester /app/namada-load-tester | ||
WORKDIR /app | ||
|
||
# start the dart webserver | ||
ENTRYPOINT ["./namada-load-tester"] | ||
CMD ["--help"] |