Skip to content

Commit d46cd10

Browse files
.github/workflows/ci: Push docker image
1 parent 74a406b commit d46cd10

File tree

7 files changed

+43
-2
lines changed

7 files changed

+43
-2
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.git/
2+
CMakeFiles/
3+
CMakeCache.txt

.github/workflows/ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ jobs:
7373
- name: tar types
7474
run: |
7575
tar -cvf dist/types.tar types
76+
- name: move thrift-docker
77+
run: |
78+
cp contrib/thrift-docker dist
79+
- name: Login to GitHub Container Registry
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
- name: Build docker container
86+
uses: upfluence/actions/build-docker@master
87+
with:
88+
version: ${{ needs.compute-version.outputs.version }}
89+
registries: ghcr.io
7690
- name: Create release
7791
uses: upfluence/actions/create-github-release@master
7892
with:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -278,3 +278,5 @@ test-driver
278278
/CPack*.cmake
279279
/compile_commands.json
280280
/install_manifest.txt
281+
**/*.cmake
282+
**/CMakeFiles

Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
#
2626
# TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler
2727

28-
FROM debian:jessie
28+
FROM debian:latest
2929
MAINTAINER Apache Thrift <dev@thrift.apache.org>
3030

3131
ENV DEBIAN_FRONTEND noninteractive
32+
ARG SEMVER_VERSION=v0.0.0
3233

3334
ADD . /thrift
3435

@@ -43,19 +44,22 @@ RUN buildDeps=" \
4344
apt-get update && apt-get install -y --no-install-recommends $buildDeps \
4445
&& mkdir /tmp/cmake-build && cd /tmp/cmake-build \
4546
&& cmake \
47+
-DTHRIFT_VERSION=${SEMVER_VERSION#v}-upfluence \
4648
-DBUILD_COMPILER=ON \
4749
-DBUILD_LIBRARIES=OFF \
4850
-DBUILD_TESTING=OFF \
4951
-DBUILD_EXAMPLES=OFF \
5052
/thrift \
5153
&& cmake --build . --config Release \
5254
&& make install \
53-
&& curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
55+
&& curl -k -sSL "https://storage.googleapis.com/golang/go1.23.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
5456
&& tar xzf /tmp/go.tar.gz -C /tmp \
5557
&& cp /tmp/go/bin/gofmt /usr/bin/gofmt \
5658
&& apt-get purge -y --auto-remove $buildDeps \
5759
&& apt-get clean \
5860
&& rm -rf /tmp/* \
5961
&& rm -rf /var/lib/apt/lists/*
6062

63+
WORKDIR /data
64+
6165
ENTRYPOINT ["thrift"]

contrib/thrift-docker

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAG=${TAG:-"latest"}
2+
3+
exec docker run --pull always -v "${PWD}:/data" --rm -it ghcr.io/upfluence/thrift:${TAG} $@

lib/Makefile.am

+6
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,10 @@ EXTRA_DIST = \
9494

9595
precross-%:
9696
$(MAKE) -C $* precross
97+
9798
precross: precross-nodejs precross-csharp precross-java
99+
100+
generate-types-%:
101+
$(MAKE) -C $* generate-types
102+
103+
generate-types: generate-types-go generate-types-rb generate-types-cpp

lib/cpp/Makefile.am

+10
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,13 @@ EXTRA_DIST = \
271271

272272
style-local:
273273
$(CPPSTYLE_CMD)
274+
275+
TYPE_FILES = ../../types/*.thrift ../../types/known/*.thrift
276+
277+
$(TYPE_FILES):
278+
mkdir -p src/thrift/$(patsubst ../../%,%,$(dir $@))
279+
$(THRIFT) -gen cpp --out src/thrift/$(patsubst ../../%,%,$(dir $@)) $@
280+
281+
generate-types: $(TYPE_FILES)
282+
283+
.PHONY: generate-types $(TYPE_FILES)

0 commit comments

Comments
 (0)