Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delete command #1

Draft
wants to merge 16 commits into
base: beeper
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Deploy

on:
push:

env:
CI_REGISTRY_IMAGE: "${{ secrets.CI_REGISTRY }}/litestream"

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}

- name: Docker Build
uses: docker/build-push-action@v2
with:
cache-from: ${{ env.CI_REGISTRY_IMAGE }}:latest
pull: true
file: Dockerfile
tags: ${{ env.CI_REGISTRY_IMAGE }}:${{ github.sha }}
push: true

deploy-docker:
runs-on: ubuntu-latest
needs:
- build-docker
if: github.ref == 'refs/heads/beeper'
steps:
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}

- uses: beeper/docker-retag-push-latest@main
with:
image: ${{ env.CI_REGISTRY_IMAGE }}
51 changes: 0 additions & 51 deletions .github/workflows/release.docker.yml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/release.linux.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/release.linux_static.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/test.yml

This file was deleted.

19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 as builder
FROM golang:1.19 as builder

WORKDIR /src/litestream
COPY . .
Expand All @@ -9,8 +9,23 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
go build -ldflags "-s -w -X 'main.Version=${LITESTREAM_VERSION}' -extldflags '-static'" -tags osusergo,netgo,sqlite_omit_load_extension -o /usr/local/bin/litestream ./cmd/litestream

# to make copy a single layer later
COPY etc/sqlite3 etc/aws-k8s-sa-provider /usr/local/bin/

FROM alpine
COPY --from=builder /usr/local/bin/litestream /usr/local/bin/litestream
ENV AWS_SDK_LOAD_CONFIG=1 \
AWS_CONFIG_FILE=/etc/aws-config

# for debugging
RUN apk add --no-cache sqlite && \
mkdir /root/.aws

COPY etc/aws-config /etc/
COPY --from=builder \
/usr/local/bin/litestream \
/usr/local/bin/sqlite3 \
/usr/local/bin/aws-k8s-sa-provider \
/usr/local/bin/

ENTRYPOINT ["/usr/local/bin/litestream"]
CMD []
6 changes: 6 additions & 0 deletions abs/replica_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package abs

import (
"context"
"errors"
"fmt"
"io"
"net/url"
Expand Down Expand Up @@ -342,6 +343,11 @@ func (c *ReplicaClient) DeleteWALSegments(ctx context.Context, a []litestream.Po
return nil
}

// DeleteAll deletes everything on the remote path.
func (c *ReplicaClient) DeleteAll(ctx context.Context) (err error) {
return errors.New("DeleteAll stub")
}

type snapshotIterator struct {
client *ReplicaClient
generation string
Expand Down
Loading