-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from kuzmik/kuzmik/more-goreleaser-again
chore: cleanups for goreleaser, still
- Loading branch information
Showing
5 changed files
with
86 additions
and
71 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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
name: "CodeQL" | ||
# name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '41 22 * * 4' | ||
# on: | ||
# push: | ||
# branches: [ "main" ] | ||
# pull_request: | ||
# branches: [ "main" ] | ||
# schedule: | ||
# - cron: '41 22 * * 4' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: 'ubuntu-latest' | ||
timeout-minutes: 360 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
# jobs: | ||
# analyze: | ||
# name: Analyze | ||
# runs-on: 'ubuntu-latest' | ||
# timeout-minutes: 360 | ||
# permissions: | ||
# actions: read | ||
# contents: read | ||
# security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# language: [ 'go' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# # Initializes the CodeQL tools for scanning. | ||
# - name: Initialize CodeQL | ||
# uses: github/codeql-action/init@v2 | ||
# with: | ||
# languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
# - name: Autobuild | ||
# uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" | ||
# - name: Perform CodeQL Analysis | ||
# uses: github/codeql-action/analyze@v2 | ||
# with: | ||
# category: "/language:${{matrix.language}}" |
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
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
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
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,44 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Stage 1 | ||
FROM golang:1.21.4-alpine AS builder | ||
|
||
ARG BUILD_SHA | ||
ARG BUILD_TIME | ||
ARG VERSION | ||
|
||
ENV GO111MODULE=on | ||
|
||
# Set destination for COPY | ||
WORKDIR /build | ||
|
||
COPY go.sum go.mod ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache git=2.40.1-r0 \ | ||
&& rm -rf /var/cache/apk/* /lib/apk/db/* | ||
|
||
RUN CGO_ENABLED="0" go build -ldflags "-s -w -X 'main.version=${VERSION}' -X 'main.build=${BUILD_SHA}' -X 'main.builddate=${BUILD_TIME}'" -o proxysql-agent cmd/proxysql-agent/main.go | ||
|
||
# Stage 2 | ||
FROM alpine:3.18.4 as runner | ||
|
||
# add mysql-client, curl, jq, etc to apk add when we're ready | ||
RUN apk update \ | ||
&& apk add --no-cache bash=5.2.15-r5 \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& addgroup agent \ | ||
&& adduser -S agent -u 1000 -G agent | ||
|
||
WORKDIR /app | ||
|
||
COPY --chown=agent:agent --from=builder --chmod=700 /build/proxysql-agent /app/ | ||
COPY --chown=agent:agent --from=builder --chmod=600 /build/configs/example_config.yaml /app/config.yaml | ||
|
||
USER agent | ||
|
||
ENTRYPOINT ["/app/proxysql-agent"] |