diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ff5ae1a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +.github +doc \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9d7618..8a77b00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,20 +17,20 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' - name: Test run: go test -v ./... - name: Build - run: go build -v sentinelexport ./cmd + run: go build -v -o artifacts/sentinelexport ./cmd - name: Upload a Build Artifact uses: actions/upload-artifact@v4.3.0 with: name: sentinelexport - path: sentinelexport + path: artifacts/sentinelexport if-no-files-found: error - name: Docker Login uses: docker/login-action@v3.0.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..677237b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +secrets.env +artifacts/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1042b1b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:jammy + +LABEL org.opencontainers.image.authors = "hello@axiom.co" + +RUN apt update; apt install -y ca-certificates + +COPY artifacts/sentinelexport sentinelexport + +ENV CONNECTION_STRING="" \ + STORAGE_URL="" \ + AXIOM_PERSONAL_TOKEN="" \ + AXIOM_ORG="" \ + AXIOM_URL="https://api.axiom.co" + +CMD ./sentinelexport export --axiom-url="${AXIOM_URL}" --axiom-personal-org="${AXIOM_ORG}" --storage-url="${STORAGE_URL}" \ No newline at end of file diff --git a/cmd/root.go b/cmd/root.go index eb903af..029d6bf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -6,7 +6,7 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "axiomazure-exporter", + Use: "sentinelexport", Short: "exports data from azure log anaytics (via storage) to axiom", Long: `exports data from azure log anaytics (via storage) to axiom.