diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..590166b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,20 @@ +version: 2.1 + +workflows: + version: 2 + all: + jobs: + - build-doc-linux + +jobs: + build-doc-linux: + docker: + - image: ubuntu:18.04 + steps: + - checkout + - run: + name: Prepare + command: ./.ldrelease/linux-prepare.sh + - run: + name: Build Doc + command: ./.ldrelease/linux-build-docs.sh diff --git a/.ldrelease/config.yml b/.ldrelease/config.yml new file mode 100644 index 0000000..32e5ac5 --- /dev/null +++ b/.ldrelease/config.yml @@ -0,0 +1,14 @@ +repo: + public: lua-server-sdk + private: lua-server-sdk-private + +circleci: + linux: + image: ubuntu:18.04 + +documentation: + title: LaunchDarkly Server-Side SDK for Lua + githubPages: true + +sdk: + displayName: "Lua (server-side)" diff --git a/.ldrelease/linux-build-docs.sh b/.ldrelease/linux-build-docs.sh new file mode 100755 index 0000000..91557bb --- /dev/null +++ b/.ldrelease/linux-build-docs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# This only runs in the Linux build, since the docs are the same for all platforms. + +PROJECT_DIR=$(pwd) + +ldoc launchdarkly-server-sdk.lua + +mkdir -p $PROJECT_DIR/artifacts +cd $PROJECT_DIR/doc +zip -r $PROJECT_DIR/artifacts/docs.zip * diff --git a/.ldrelease/linux-prepare.sh b/.ldrelease/linux-prepare.sh new file mode 100755 index 0000000..d3d8578 --- /dev/null +++ b/.ldrelease/linux-prepare.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +apt-get update -y && apt-get install -y lua-ldoc zip ca-certificates diff --git a/.ldrelease/update-version.sh b/.ldrelease/update-version.sh new file mode 100755 index 0000000..64d347a --- /dev/null +++ b/.ldrelease/update-version.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +sed -i "s/local SDKVersion =.*/local SDKVersion = \"${LD_RELEASE_VERSION}\"/" 'launchdarkly-server-sdk.lua' diff --git a/CHANGELOG.md b/CHANGELOG.md index 830fc1a..9331c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the LaunchDarkly Lua Server-side SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [1.0.0-beta.2] - 2020-05-12 + +### Changed: +- Updates the configuration object to include wrapper name and version. + ## [1.0.0-beta.1] - 2020-03-24 Initial beta release. diff --git a/README.md b/README.md index 6585ef9..a5fe5b4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,12 @@ LaunchDarkly overview [![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly) + +Supported Lua versions +----------- + +This version of the LaunchDarkly SDK is compatible with the Lua 5.1 interpreter, and LuaJIT. Lua 5.3 is not supported due to FFI constraints. + Getting started ----------- diff --git a/launchdarkly-server-sdk.lua b/launchdarkly-server-sdk.lua index 92ab778..bb72c73 100644 --- a/launchdarkly-server-sdk.lua +++ b/launchdarkly-server-sdk.lua @@ -91,6 +91,8 @@ ffi.cdef[[ const char *const attribute); void LDConfigSetFeatureStoreBackend(struct LDConfig *const config, struct LDStoreInterface *const backend); + bool LDConfigSetWrapperInfo(struct LDConfig *const config, + const char *const wrapperName, const char *const wrapperVersion); struct LDUser * LDUserNew(const char *const userkey); void LDUserFree(struct LDUser *const user); void LDUserSetAnonymous(struct LDUser *const user, const bool anon); @@ -213,6 +215,8 @@ ffi.cdef[[ struct LDUser *const user); ]] +local SDKVersion = "1.0.0-beta.2" + local so = ffi.load("ldserverapi") local function applyWhenNotNil(subject, operation, value) @@ -297,6 +301,8 @@ local function makeConfig(fields) applyWhenNotNil(config, so.LDConfigSetUserKeysCapacity, fields["userKeysCapacity"]) applyWhenNotNil(config, so.LDConfigSetUserKeysFlushInterval, fields["userKeysFlushInterval"]) + so.LDConfigSetWrapperInfo(config, "lua-server-sdk", SDKVersion) + local names = fields["privateAttributeNames"] if names ~= nil and names ~= cjson.null then