Compare commits
10 Commits
6ea97c602f
...
v2.0.0-202
| Author | SHA1 | Date | |
|---|---|---|---|
|
4ec9e007df
|
|||
| 7c04dd5138 | |||
| 080a1ce8d8 | |||
|
9f94e43ebc
|
|||
| f35fd2aa7f | |||
| e0eb3313c2 | |||
| d2395fe4eb | |||
| 6c458a5724 | |||
| 0001e056db | |||
|
176320fd88
|
36
.github/workflows/go-dev.yml
vendored
Normal file
36
.github/workflows/go-dev.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# This workflow will build a golang project
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
||||||
|
|
||||||
|
name: Go Dev Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["develop"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["develop"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
BuildWin64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: build
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: x1unix/go-mingw:1.20
|
||||||
|
options: -v ${{ github.workspace }}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1
|
||||||
|
|
||||||
|
run: |
|
||||||
|
go build -o ./ifxmetrics_x64.dll -buildmode=c-shared -buildvcs=false -ldflags "-w -s -X main.EXTENSION_VERSION=${{github.ref_name}}-${{github.sha}}" ./extension/cmd
|
||||||
|
|
||||||
|
BuildWin32:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: x1unix/go-mingw:1.20
|
||||||
|
options: -v ${{ github.workspace }}:/go/work -w /go/work -e GOARCH=386 -e CGO_ENABLED=1
|
||||||
|
|
||||||
|
run: |
|
||||||
|
go build -o ./ifxmetrics.dll -buildmode=c-shared -buildvcs=false -ldflags "-w -s -X main.EXTENSION_VERSION=${{github.ref_name}}-${{github.sha}}" ./extension/cmd
|
||||||
25
.github/workflows/go-main.yml
vendored
Normal file
25
.github/workflows/go-main.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# This workflow will build a golang project
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
||||||
|
|
||||||
|
name: Go Main
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.20'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v ./extension/cmd/...
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ ifxmetrics.config.json
|
|||||||
|
|
||||||
.hemttout
|
.hemttout
|
||||||
influxdb
|
influxdb
|
||||||
|
releases
|
||||||
16
README.md
16
README.md
@@ -29,7 +29,7 @@ In the below example, the `milsimServerEfficiency` event handler will send data
|
|||||||
// ...
|
// ...
|
||||||
"cbaEventHandlers": {
|
"cbaEventHandlers": {
|
||||||
"milsimServerEfficiency": {
|
"milsimServerEfficiency": {
|
||||||
"name": "milsimServerEfficiency",
|
"eventName": "milsimServerEfficiency",
|
||||||
"description": "EVENTHANDLER. Tracks the efficiency of the server.",
|
"description": "EVENTHANDLER. Tracks the efficiency of the server.",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"bucket": "server_performance",
|
"bucket": "server_performance",
|
||||||
@@ -111,12 +111,12 @@ Set an environment variable in your terminal with the desired extension build ve
|
|||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
# powershell
|
# powershell
|
||||||
$IFXMETRICS_BUILD_VER = "0.1.0-$(Get-Date -Format 'yyyyMMdd')-$(git rev-parse --short HEAD)"
|
$IFXMETRICS_BUILD_VER = "2.0.0-$(Get-Date -Format 'yyyyMMdd')-$(git rev-parse --short HEAD)"
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# bash
|
# bash
|
||||||
export IFXMETRICS_BUILD_VER="0.1.0-$(date -u '+%Y%m%d')-$(git rev-parse --short HEAD)"
|
export IFXMETRICS_BUILD_VER="2.0.0-$(date -u '+%Y%m%d')-$(git rev-parse --short HEAD)"
|
||||||
```
|
```
|
||||||
|
|
||||||
### EXTENSION: COMPILING FOR WINDOWS
|
### EXTENSION: COMPILING FOR WINDOWS
|
||||||
@@ -127,13 +127,13 @@ Run this from the project root.
|
|||||||
docker pull x1unix/go-mingw:1.20
|
docker pull x1unix/go-mingw:1.20
|
||||||
|
|
||||||
# Compile x64 Windows DLL
|
# Compile x64 Windows DLL
|
||||||
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics_x64.dll -buildmode=c-shared -ldflags "-w -s main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics_x64.dll -buildmode=c-shared -ldflags "-w -s -X main.EXTENSION_VERSION=`"$IFXMETRICS_BUILD_VER`"" ./extension/cmd
|
||||||
|
|
||||||
# Compile x86 Windows DLL
|
# Compile x86 Windows DLL
|
||||||
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=386 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics.dll -buildmode=c-shared -ldflags "-w -s main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=386 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics.dll -buildmode=c-shared -ldflags "-w -s -X main.EXTENSION_VERSION=`"$IFXMETRICS_BUILD_VER`"" ./extension/cmd
|
||||||
|
|
||||||
# Compile x64 Windows EXE
|
# Compile x64 Windows EXE
|
||||||
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics_x64.exe -ldflags "-w -s main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
docker run --rm -it -v ${PWD}:/go/work -w /go/work -e GOARCH=amd64 -e CGO_ENABLED=1 x1unix/go-mingw:1.20 go build -o ./ifxmetrics_x64.exe -ldflags "-w -s -X main.EXTENSION_VERSION=`"$IFXMETRICS_BUILD_VER`"" ./extension/cmd
|
||||||
```
|
```
|
||||||
|
|
||||||
### EXTENSION: COMPILING FOR LINUX
|
### EXTENSION: COMPILING FOR LINUX
|
||||||
@@ -144,10 +144,10 @@ Run this from the project root.
|
|||||||
docker build -t indifox926/build-a3go:linux-so -f ./build/Dockerfile.build .
|
docker build -t indifox926/build-a3go:linux-so -f ./build/Dockerfile.build .
|
||||||
|
|
||||||
# Compile x64 Linux .so
|
# Compile x64 Linux .so
|
||||||
docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=1 -e CC=gcc indifox926/build-a3go:linux-so go build -o ./ifxmetrics_x64.so -linkshared -ldflags "-w -s main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=1 indifox926/build-a3go:linux-so go build -o ./ifxmetrics_x64.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
||||||
|
|
||||||
# Compile x86 Linux .so
|
# Compile x86 Linux .so
|
||||||
docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=386 -e CGO_ENABLED=1 -e CC=gcc indifox926/build-a3go:linux-so go build -o ./ifxmetrics.so -linkshared -ldflags "-w -s main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
docker run --rm -it -v ${PWD}:/app -e GOOS=linux -e GOARCH=386 -e CGO_ENABLED=1 indifox926/build-a3go:linux-so go build -o ./ifxmetrics.so -linkshared -ldflags "-w -s -X main.EXTENSION_VERSION=${IFXMETRICS_BUILD_VER}" ./extension/cmd
|
||||||
```
|
```
|
||||||
|
|
||||||
### ADDON: COMPILE USING HEMTT
|
### ADDON: COMPILE USING HEMTT
|
||||||
|
|||||||
11
build/Dockerfile.build
Normal file
11
build/Dockerfile.build
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# build Golang app for Linux
|
||||||
|
FROM golang:1.20
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# get gcc-multilib and gcc-mingw-w64
|
||||||
|
RUN apt update
|
||||||
|
RUN apt install -y gcc-multilib gcc-mingw-w64
|
||||||
|
|
||||||
|
CMD ["/bin/sh"]
|
||||||
|
|
||||||
@@ -125,6 +125,9 @@ func onInfluxConnect(
|
|||||||
ctx a3interface.ArmaExtensionContext,
|
ctx a3interface.ArmaExtensionContext,
|
||||||
data string,
|
data string,
|
||||||
) (string, error) {
|
) (string, error) {
|
||||||
|
if influx.InfluxClient != nil {
|
||||||
|
influx.InfluxClient.Close()
|
||||||
|
}
|
||||||
err := influx.Setup(
|
err := influx.Setup(
|
||||||
settings.Active,
|
settings.Active,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user