Skip to content

Commit 987298f

Browse files
authored
chore: add tag trigger publish ttc image (#558)
add tag publish
1 parent 5947ca0 commit 987298f

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/ttc.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# .github/workflows/docker-publish.yml
22

3-
name: Docker
3+
name: TTC docker publish
44

55
on:
66
push:
77
branches:
88
- main
9+
tags:
10+
- 'v*'
911
paths:
1012
- 'core/**'
1113
- 'driver/**'
@@ -29,9 +31,15 @@ jobs:
2931
username: ${{ secrets.DOCKERHUB_USERNAME }}
3032
password: ${{ secrets.DOCKERHUB_TOKEN }}
3133

32-
- name: Build and push
34+
- name: Set Docker tag
35+
run: echo "DOCKER_TAG=${{ startsWith(github.ref, 'refs/tags/') && github.ref[10:] || 'latest' }}" >> $GITHUB_ENV
36+
37+
- name: Print Docker tag
38+
run: echo "Start to build and publish: datafuselabs/ttc-rust:$DOCKER_TAG"
39+
40+
- name: TTC Build and push
3341
uses: docker/build-push-action@v2
3442
with:
3543
push: true
3644
file: ./ttc/Dockerfile
37-
tags: datafuselabs/ttc-rust:latest
45+
tags: datafuselabs/ttc-rust:$DOCKER_TAG

ttc/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use tokio::net::TcpStream;
2020
#[tokio::main]
2121
async fn main() -> Result<(), Box<dyn std::error::Error>> {
2222
// Connect to the server
23-
let mut stream = TcpStream::connect("127.0.0.1:9092").await?;
23+
let mut stream = TcpStream::connect("127.0.0.1:9902").await?;
2424

2525
loop {
2626
// Prepare a sql

ttc/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use clap::{command, Parser};
2323
#[derive(Debug, Clone, Parser, PartialEq)]
2424
#[command(name = "ttc")]
2525
struct Config {
26-
#[clap(short = 'P', default_value = "9092", env = "TTC_PORT", long)]
26+
#[clap(short = 'P', default_value = "9902", env = "TTC_PORT", long)]
2727
port: u16,
2828
#[clap(
2929
long,

0 commit comments

Comments
 (0)