-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
12f1c8d
commit f641030
Showing
11 changed files
with
306 additions
and
15 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,52 @@ | ||
name: TTC docker publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
paths: | ||
- '*.go' | ||
- 'tests/ttc/**' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set Docker tag | ||
shell: bash | ||
run: | | ||
ref_v="${{ github.ref }}" | ||
if [[ $ref_v == refs/tags/* ]]; then | ||
DOCKER_TAG=${ref_v:10} | ||
else | ||
DOCKER_TAG="latest" | ||
fi | ||
echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV | ||
- name: Print Docker tag | ||
shell: bash | ||
run: | | ||
echo "Start to build and publish: ghcr.io/databendlabs/ttc-go:$DOCKER_TAG" | ||
- name: TTC Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
file: ./tests/ttc/Dockerfile | ||
tags: ghcr.io/databendlabs/ttc-go:${{ env.DOCKER_TAG }} |
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
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,23 @@ | ||
//go:build rows_hack | ||
|
||
package godatabend | ||
|
||
import ( | ||
"database/sql" | ||
"database/sql/driver" | ||
"reflect" | ||
"unsafe" | ||
) | ||
|
||
func init() { | ||
rowsHack = true | ||
} | ||
|
||
func LastRawRow(rows *sql.Rows) []*string { | ||
field, ok := reflect.TypeOf((*sql.Rows)(nil)).Elem().FieldByName("rowsi") | ||
if !ok { | ||
panic("rowsi field not found") | ||
} | ||
rowsi := *(*driver.Rows)(unsafe.Pointer(uintptr(unsafe.Pointer(rows)) + field.Offset)) | ||
return rowsi.(*nextRows).latestRow | ||
} |
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,13 @@ | ||
FROM golang:latest AS builder | ||
|
||
WORKDIR /usr/src | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 go build -tags rows_hack ./tests/ttc | ||
|
||
FROM debian:bullseye-slim | ||
COPY --from=builder /usr/src/ttc /usr/local/bin/ttc-server | ||
|
||
# docker run --net host -e TTC_PORT=9093 -e DATABEND_DSN=databend://default:@127.0.0.1:8000 ghcr.io/databendlabs/ttc-go:latest | ||
CMD ["ttc-server"] |
Oops, something went wrong.