File tree Expand file tree Collapse file tree 10 files changed +58
-14
lines changed
Expand file tree Collapse file tree 10 files changed +58
-14
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,19 @@ inputs:
55 description : ' Version of Lua to use for building and testing.'
66 required : false
77 default : ' 5.3'
8- cpp-sdk-version :
9- description : ' Version of the C++ Server-side SDK to use for building and testing.'
8+ cpp-sdk-redis- version :
9+ description : ' Version of the C++ Server-side SDK with Redis Source to use for building and testing.'
1010 required : false
11- default : ' launchdarkly-cpp-server-redis-source-v2.1.3'
1211 rockspec :
1312 description : ' The rockspec file for the server-side SDK.'
1413 required : true
1514
1615runs :
1716 using : composite
1817 steps :
18+ - name : Get C++ Versions
19+ id : cpp-versions
20+ uses : ./.github/actions/cpp-versions
1921 - name : Install Lua
2022 uses : leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e
2123 with :
3133 - name : Install CPP SDK
3234 uses : ./.github/actions/install-cpp-sdk-redis
3335 with :
34- version : ${{ inputs.cpp-sdk-version }}
36+ version : ${{ inputs.cpp-sdk-redis- version }}
3537 path : cpp-sdk
3638
3739 - name : Build Package
Original file line number Diff line number Diff line change 1+ # The following chunk of yml pulls two C++ sdk version numbers out of a file and
2+ # makes them available to the other actions/workflows in a convenient fashion.
3+ # This allows us to easily bump the version numbers in one place, instead of multiple yml files.
4+ name : C++ Versions
5+ description : Foo
6+ outputs :
7+ sdk :
8+ description : ' The version of the C++ Server-side SDK.'
9+ value : ${{ steps.cpp-versions.outputs.sdk }}
10+ redis_source :
11+ description : ' The version of the C++ Server-side SDK with Redis Source.'
12+ value : ${{ steps.cpp-versions.outputs.redis_source }}
13+ runs :
14+ using : composite
15+ steps :
16+ - name : Set C++ Versions
17+ id : cpp-versions
18+ shell : bash
19+ run : cat ./.github/variables/cpp-sdk-versions.env > $GITHUB_OUTPUT
20+ - name : Display C++ Versions
21+ shell : bash
22+ run : |
23+ echo "${{ format('C++ Server SDK v{0}', steps.cpp-versions.outputs.sdk) }}"
24+ echo "${{ format('C++ Server SDK Redis Source v{0}', steps.cpp-versions.outputs.redis_source) }}"
Original file line number Diff line number Diff line change @@ -4,21 +4,23 @@ inputs:
44 version :
55 required : true
66 description : " Version of the C++ SDK with Redis Source."
7- default : " launchdarkly-cpp-server-redis-source-v2.1.3"
87 path :
98 description : " Where to download the SDK."
109 default : " cpp-sdk"
1110
1211runs :
1312 using : composite
1413 steps :
14+ - name : Get Default C++ Versions
15+ id : cpp-versions
16+ uses : ./.github/actions/cpp-versions
1517 - name : Download C++ Server-side SDK with Redis Source
1618 uses : robinraju/release-downloader@efa4cd07bd0195e6cc65e9e30c251b49ce4d3e51
1719 id : download-cpp-sdk
1820 with :
1921 repository : " launchdarkly/cpp-sdks"
2022 latest : false
21- tag : ${{ inputs.version }}
23+ tag : ${{ format('launchdarkly-cpp-server-redis-source-v{0}', inputs.version || steps.cpp-versions.outputs.redis_source) }}
2224 fileName : linux-gcc-x64-dynamic.zip
2325 out-file-path : ${{ inputs.path }}
2426 extract : true
Original file line number Diff line number Diff line change 1+ sdk = 3.3.3
2+ redis_source = 2.1.3
Original file line number Diff line number Diff line change 5252 LD_SDK_KEY : foo
5353 steps :
5454 - uses : actions/checkout@v4
55+ - name : Get C++ Versions
56+ id : cpp-versions
57+ uses : ./.github/actions/cpp-versions
5558 - name : Build ${{ matrix.name }} image
5659 run : |
57- docker build -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
60+ docker build \
61+ --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \
62+ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
5863 - name : Run ${{ matrix.name }} container in background
5964 run : |
6065 docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 --env LD_SDK_KEY="$LD_SDK_KEY" launchdarkly:${{ matrix.name }}
7681 LD_SDK_KEY : foo
7782 steps :
7883 - uses : actions/checkout@v4
84+ - name : Get C++ Versions
85+ id : cpp-versions
86+ uses : ./.github/actions/cpp-versions
7987 - name : Build ${{ matrix.name }} image
8088 run : |
81- docker build -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
89+ docker build \
90+ --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \
91+ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile .
8292 - name : Run ${{ matrix.name }} container in foreground
8393 run : |
8494 docker run --env LD_SDK_KEY="$LD_SDK_KEY" launchdarkly:${{ matrix.name }} > logs.txt
Original file line number Diff line number Diff line change 2929 description : " Version of the C++ Server-side SDK."
3030 required : false
3131 type : string
32- default : ' launchdarkly-cpp-server-redis-source-v2.1.3'
3332 workflow_call :
3433 inputs :
3534 package :
4948 PACKAGE : ${{ inputs.package == null && 'launchdarkly-server-sdk' || inputs.package }}
5049 VERSION : ${{ inputs.version == null && '' || inputs.version }}
5150 LUA_VERSION : ${{ inputs.lua-version == null && '5.3' || inputs.lua-version }}
52- CPP_SDK_VERSION : ${{ inputs.cpp-sdk-version == null && 'launchdarkly-cpp-server-redis-source-v2.1.3' || inputs.cpp-sdk-version }}
5351jobs :
5452 install :
5553 runs-on : ubuntu-latest
7472 - name : Install CPP SDK
7573 uses : ./.github/actions/install-cpp-sdk-redis
7674 with :
77- version : ${{ env.CPP_SDK_VERSION }}
75+ version : ${{ inputs.cpp-sdk-version }}
7876 path : cpp-sdk
7977
8078 - name : Install Package
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ FROM debian:bookworm
44ARG VERSION=2.1.0
55# {{ x-release-please-end }}
66
7+ ARG CPP_SDK_VERSION=3.3.3
8+
79# For unknown reasons, it appears that boost.json and boost.url aren't included in the
810# libboost-all package.
911
@@ -16,7 +18,7 @@ RUN apt-get update && apt-get install -y \
1618
1719
1820RUN mkdir cpp-sdk-libs
19- RUN git clone --branch launchdarkly-cpp-server-v3.3.3 https://github.com/launchdarkly/cpp-sdks.git && \
21+ RUN git clone --branch launchdarkly-cpp-server-v${CPP_SDK_VERSION} https://github.com/launchdarkly/cpp-sdks.git && \
2022 cd cpp-sdks && \
2123 mkdir build-dynamic && \
2224 cd build-dynamic && \
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ FROM ubuntu:22.04
44ARG VERSION=2.1.0
55# {{ x-release-please-end }}
66
7+ ARG CPP_SDK_VERSION=3.3.3
8+
79RUN apt-get update && apt-get install -y \
810 curl luarocks lua5.3 lua5.3-dev \
911 haproxy apt-transport-https ca-certificates \
@@ -13,7 +15,7 @@ RUN add-apt-repository ppa:mhier/libboost-latest && \
1315 apt-get update && \
1416 apt-get install -y boost1.81
1517
16- RUN curl https://github.com/launchdarkly/cpp-sdks/releases/download/launchdarkly-cpp-server-v3.3.3 /linux-gcc-x64-dynamic.zip -L -o /tmp/sdk.zip && \
18+ RUN curl https://github.com/launchdarkly/cpp-sdks/releases/download/launchdarkly-cpp-server-v${CPP_SDK_VERSION} /linux-gcc-x64-dynamic.zip -L -o /tmp/sdk.zip && \
1719 mkdir ./cpp-sdk && \
1820 unzip /tmp/sdk.zip -d ./cpp-sdk && \
1921 rm /tmp/sdk.zip
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ FROM openresty/openresty:jammy
44ARG VERSION=2.1.0
55# {{ x-release-please-end }}
66
7+ ARG CPP_SDK_VERSION=3.3.3
8+
79RUN apt-get update && apt-get install -y \
810 git netbase curl libssl-dev apt-transport-https ca-certificates \
911 software-properties-common \
@@ -15,7 +17,7 @@ RUN add-apt-repository ppa:mhier/libboost-latest && \
1517
1618
1719RUN mkdir cpp-sdk-libs
18- RUN git clone --branch launchdarkly-cpp-server-v3.3.3 https://github.com/launchdarkly/cpp-sdks.git && \
20+ RUN git clone --branch launchdarkly-cpp-server-v${CPP_SDK_VERSION} https://github.com/launchdarkly/cpp-sdks.git && \
1921 cd cpp-sdks && \
2022 mkdir build-dynamic && \
2123 cd build-dynamic && \
You can’t perform that action at this time.
0 commit comments