Skip to content

Commit

Permalink
1.0.0 beta.2 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hroederld authored May 12, 2020
1 parent debda96 commit ed87f6c
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .ldrelease/config.yml
Original file line number Diff line number Diff line change
@@ -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)"
13 changes: 13 additions & 0 deletions .ldrelease/linux-build-docs.sh
Original file line number Diff line number Diff line change
@@ -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 *
5 changes: 5 additions & 0 deletions .ldrelease/linux-prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

apt-get update -y && apt-get install -y lua-ldoc zip ca-certificates
5 changes: 5 additions & 0 deletions .ldrelease/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

sed -i "s/local SDKVersion =.*/local SDKVersion = \"${LD_RELEASE_VERSION}\"/" 'launchdarkly-server-sdk.lua'
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------

Expand Down
6 changes: 6 additions & 0 deletions launchdarkly-server-sdk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ed87f6c

Please sign in to comment.