Skip to content

Commit

Permalink
Merge pull request #72 from mountaindude/master
Browse files Browse the repository at this point in the history
3.1.0 RC
  • Loading branch information
mountaindude authored Jul 15, 2020
2 parents 89601e0 + 5234316 commit 8a1b9b5
Show file tree
Hide file tree
Showing 36 changed files with 1,123 additions and 858 deletions.
54 changes: 54 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: "2" # required to adjust maintainability checks
checks:
argument-count:
config:
threshold: 4
complex-logic:
config:
threshold: 4
file-lines:
config:
threshold: 250
method-complexity:
config:
threshold: 5
method-count:
config:
threshold: 20
method-lines:
config:
threshold: 25
nested-control-flow:
config:
threshold: 4
return-statements:
config:
threshold: 4
similar-code:
config:
threshold: # language-specific defaults. an override will affect all languages.
identical-code:
config:
threshold: # language-specific defaults. an override will affect all languages.

plugins:
eslint:
enabled: true
# channel: "eslint-6"
# csslint:
# enabled: true
markdownlint:
enabled: true

exclude_patterns:
# - "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "Tests/"
- "**/vendor/"
109 changes: 99 additions & 10 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
kind: pipeline
name: default
type: docker
name: linux-amd64

platform:
arch: amd64
os: linux

steps:
- name: docker
Expand All @@ -10,17 +15,101 @@ steps:
password:
from_secret: dockerhub_password
repo: ptarmiganlabs/butler
dockerfile: src/Dockerfile
dockerfile: src/Dockerfile.amd64
context: src
# auto_tag: true
tags:
- latest
- 'v3.0.4'
- '3.0.4'
auto_tag: true
auto_tag_suffix: linux-amd64
when:
event:
- push
- tag

# trigger:
# event:
# - tag
---
kind: pipeline
type: docker
name: linux-arm64

platform:
arch: arm64
os: linux

steps:
- name: docker
image: plugins/docker
settings:
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
repo: ptarmiganlabs/butler
dockerfile: src/Dockerfile.arm64
context: src
auto_tag: true
auto_tag_suffix: linux-arm64

trigger:
event:
- push
- tag

depends_on:
- linux-amd64


---
kind: pipeline
type: docker
name: linux-arm

platform:
arch: arm
os: linux

steps:
- name: docker
image: plugins/docker
settings:
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
repo: ptarmiganlabs/butler
dockerfile: src/Dockerfile.arm
context: src
auto_tag: true
auto_tag_suffix: linux-arm

trigger:
event:
- push
- tag

depends_on:
- linux-amd64


---
kind: pipeline
type: docker
name: manifest

steps:
- name: publish
image: plugins/manifest:1.2
settings:
auto_tag: true
ignore_missing: true
spec: src/docker/manifest.tmpl
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password

trigger:
event:
- push
- tag

depends_on:
- linux-arm64
- linux-arm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ butler-docs/site/
src/udp_client/node_modules/*
npm-debug.log
.DS_Store
**/log
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"type": "node",
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
[![Build Status](https://travis-ci.com/ptarmiganlabs/butler.svg?branch=master)](https://travis-ci.com/ptarmiganlabs/butler)
[![Build Status](https://cloud.drone.io/api/badges/ptarmiganlabs/butler/status.svg)](https://cloud.drone.io/ptarmiganlabs/butler)

![Butler](icon.png)

![Butler](icon.png)
\
Butler is a utility toolbox for [Qlik Sense](https://www.qlik.com/us/products/qlik-sense).

<br>
<br>
<br>

\
\
\
**Documentation is available at [https://butler.ptarmiganlabs.com](https://butler.ptarmiganlabs.com).**
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Change log

## 3.1.0

Stayin' alive: hearbeats are here.

1. Added user configurable heartbeat option. Butler can now (optionally) do http calls to a url, indicating it is alive and well. This is useful in enterprise settings, for use together with network monitoring tools etc.
2. Updated dependencies to their latest versions.

## 3.0.0

This version brings a general refresh of the tool, both in terms of updated dependencies, streamlined configuration settings and more up-to-date documentation.

1. **Breaking change** Streamline the names of configuration options in the production_template.yaml config file. This change however means that the config files for existing Butler environments need to be updated. Please refer to the [documentation site](https://ptarmiganlabs.github.io/butler/install-config/#config_file_syntax) file for info on the most recent config options.
2. Each REST API endpoint can be enabled/disabled. This is useful for deployment scarios when some endpoints for whatever reasons should not be available.
2. Each REST API endpoint can be enabled/disabled. This is useful for deployment scarios when some endpoints for whatever reasons should not be available.
3. Much improved logging of requests to the REST API endpoints. Turning on verbose logging will output lots of info on the requests, including what IP address the request comes from.
4. Better error messages when connection to Sense server for some reason fails.

Expand Down
2 changes: 1 addition & 1 deletion src/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parserOptions:
ecmaVersion: 6
ecmaVersion: 2020
env:
node: true
extends: 'eslint:recommended'
Expand Down
2 changes: 2 additions & 0 deletions src/Dockerfile → src/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Build Docker image for Amd64

FROM node:12-stretch

# Add metadata about the image
Expand Down
29 changes: 29 additions & 0 deletions src/Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build Docker image for Arm64

FROM node:12-stretch

# Add metadata about the image
LABEL maintainer="Göran Sander [email protected]"
LABEL description="Extensible micro service adding features that Qlik Sense do not offer out of the box."

# Create app dir inside container
WORKDIR /nodeapp

# Install app dependencies separately (creating a separate layer for node_modules, effectively caching them between image rebuilds)
COPY package.json .
RUN npm install

# Copy app's source files
COPY . .

# Create and use non-root user
RUN groupadd -r nodejs \
&& useradd -m -r -g nodejs nodejs

USER nodejs

# Set up Docker healthcheck
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD ["node", "docker-healthcheck.js"]

CMD ["node", "butler.js"]

29 changes: 29 additions & 0 deletions src/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build Docker image for Arm64

FROM node:12-stretch

# Add metadata about the image
LABEL maintainer="Göran Sander [email protected]"
LABEL description="Extensible micro service adding features that Qlik Sense do not offer out of the box."

# Create app dir inside container
WORKDIR /nodeapp

# Install app dependencies separately (creating a separate layer for node_modules, effectively caching them between image rebuilds)
COPY package.json .
RUN npm install

# Copy app's source files
COPY . .

# Create and use non-root user
RUN groupadd -r nodejs \
&& useradd -m -r -g nodejs nodejs

USER nodejs

# Set up Docker healthcheck
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD ["node", "docker-healthcheck.js"]

CMD ["node", "butler.js"]

14 changes: 14 additions & 0 deletions src/butler-claim0-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: butler-claim0
name: butler-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
58 changes: 58 additions & 0 deletions src/butler-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.controller.type: deployment
kompose.service.export: "true"
kompose.service.type: nodeport
kompose.version: 1.21.0 ()
creationTimestamp: null
labels:
io.kompose.service: butler
name: butler
spec:
replicas: 2
selector:
matchLabels:
io.kompose.service: butler
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.controller.type: deployment
kompose.service.export: "true"
kompose.service.type: nodeport
kompose.version: 1.21.0 ()
creationTimestamp: null
labels:
io.kompose.service: butler
spec:
containers:
- env:
- name: NODE_ENV
value: production
image: ptarmiganlabs/butler:3.1.0
imagePullPolicy: ""
name: butler
ports:
- containerPort: 8080
- containerPort: 9997
- containerPort: 9998
resources: {}
volumeMounts:
- mountPath: /nodeapp/config
# name: butler-claim0
name: butler-config-volume
restartPolicy: Always
serviceAccountName: ""
volumes:
# - name: butler-claim0
# persistentVolumeClaim:
# claimName: butler-claim0
- name: butler-config-volume
configMap:
name: production.yaml
status: {}
Loading

0 comments on commit 8a1b9b5

Please sign in to comment.