This commit is contained in:
parent
db18e03513
commit
384d451410
@ -1 +0,0 @@
|
||||
target/
|
1
.earthlyignore
Normal file
1
.earthlyignore
Normal file
@ -0,0 +1 @@
|
||||
target/
|
36
.github/workflows/ci.yml
vendored
Normal file
36
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# .github/workflows/ci.yml
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MY_DOCKER_USERNAME: ${{ secrets.MY_DOCKER_USERNAME }}
|
||||
MY_DOCKER_PASSWORD: ${{ secrets.MY_DOCKER_PASSWORD }}
|
||||
FORCE_COLOR: 1
|
||||
steps:
|
||||
- uses: https://github.com/earthly/actions-setup@v1
|
||||
with:
|
||||
version: v0.7.0
|
||||
- uses: actions/checkout@v2
|
||||
- name: Put back the git branch into git (Earthly uses it for tagging)
|
||||
run: |
|
||||
branch=""
|
||||
if [ -n "$GITHUB_HEAD_REF" ]; then
|
||||
branch="$GITHUB_HEAD_REF"
|
||||
else
|
||||
branch="${GITHUB_REF##*/}"
|
||||
fi
|
||||
git checkout -b "$branch" || true
|
||||
- name: Docker Login
|
||||
run: docker login git.hibas.dev --username "$MY_DOCKER_USERNAME" --password "$MY_DOCKER_PASSWORD"
|
||||
- name: Earthly version
|
||||
run: earthly --version
|
||||
- name: Run build
|
||||
run: earthly --push +docker-multi
|
27
Dockerfile
27
Dockerfile
@ -1,27 +0,0 @@
|
||||
FROM docker.io/rust:1.67.0-slim-bullseye as builder
|
||||
|
||||
RUN apt-get update -yq && \
|
||||
apt install -y --no-install-recommends \
|
||||
build-essential \
|
||||
libssl-dev \
|
||||
pkg-config \
|
||||
protobuf-compiler \
|
||||
libprotobuf-dev
|
||||
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM docker.io/debian:bullseye-slim
|
||||
|
||||
RUN apt-get update -yq && \
|
||||
apt-get install -y --no-install-recommends glusterfs-client htop
|
||||
|
||||
COPY --from=builder /src/target/release/gluster-dir-csi /usr/local/bin/gluster-dir-csi
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/gluster-dir-csi"]
|
||||
|
||||
|
||||
|
23
Earthfile
Normal file
23
Earthfile
Normal file
@ -0,0 +1,23 @@
|
||||
VERSION 0.7
|
||||
FROM rust:1.68
|
||||
WORKDIR /rustbuild
|
||||
|
||||
prepare-env:
|
||||
RUN apt update && apt install -y protobuf-compiler
|
||||
|
||||
docker-multi:
|
||||
BUILD --platform linux/amd64 --platform linux/arm64 +docker
|
||||
|
||||
build:
|
||||
FROM +prepare-env
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
SAVE ARTIFACT target/release/gluster-dir-csi gluster-dir-csi
|
||||
|
||||
docker:
|
||||
FROM debian:bullseye-slim
|
||||
COPY +build/gluster-dir-csi gluster-dir-csi
|
||||
ENTRYPOINT ["./gluster-dir-csi"]
|
||||
ARG EARTHLY_TARGET_TAG_DOCKER
|
||||
ARG TAG=$EARTHLY_TARGET_TAG_DOCKER
|
||||
SAVE IMAGE --push git.hibas.dev/ops/gluster-dir-csi:$TAG
|
2
csi-spec
2
csi-spec
@ -1 +1 @@
|
||||
Subproject commit 1de425b860085fa0e987d8ece6fe36ed47cdebb3
|
||||
Subproject commit c7ab2f379311a9ae234ae42bdfbfebfa9c15e538
|
Loading…
Reference in New Issue
Block a user