Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ajv from 6.12.0 to 6.12.6 #43

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 104 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
kind: pipeline
name: default
type: docker
name: linux-amd64

platform:
arch: amd64
os: linux

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

when:
event:
- push
- 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-app-duplicator
dockerfile: docker/Dockerfile.arm64
context:
auto_tag: true
auto_tag_suffix: linux-arm64

when:
event:
- push
- tag

depends_on:
- linux-amd64


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

platform:
arch: arm
os: linux

steps:
- name: docker
Expand All @@ -10,12 +77,43 @@ steps:
password:
from_secret: dockerhub_password
repo: ptarmiganlabs/butler-app-duplicator
dockerfile: Dockerfile
dockerfile: docker/Dockerfile.arm
context:
# auto_tag: true
tags:
- latest
- '3.0.3'
auto_tag: true
auto_tag_suffix: linux-arm

when:
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: docker/manifest.tmpl
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password

trigger:
event:
- push
- tag

depends_on:
- linux-arm64
- linux-arm
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion healthcheck.js → docker-healthcheck.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const config = require('config');
var httpHealth = require("http");

var optionsHealth = {
host : "localhost",
port : "12398",
port : config.get('dockerHealthCheck.port'),
timeout : 2000
};

Expand Down
7 changes: 3 additions & 4 deletions Dockerfile → docker/Dockerfile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ LABEL description="Docker image providing app wizard/creation services for Qlik
WORKDIR /nodeapp

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

# Copy app's source files
COPY . .

COPY ../. .

# Create and use non-root user
RUN groupadd -r nodejs \
Expand All @@ -23,6 +22,6 @@ RUN groupadd -r nodejs \
USER nodejs

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

CMD ["node", "index.js"]
27 changes: 27 additions & 0 deletions docker/Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use Node 12 LTS
FROM node:12-stretch

# Add some information about the image
LABEL maintainer="Göran Sander mountaindude@ptarmiganlabs.com"
LABEL description="Docker image providing app wizard/creation services for Qlik Sense."

# 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", "index.js"]
27 changes: 27 additions & 0 deletions docker/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use Node 12 LTS
FROM node:12-stretch

# Add some information about the image
LABEL maintainer="Göran Sander mountaindude@ptarmiganlabs.com"
LABEL description="Docker image providing app wizard/creation services for Qlik Sense."

# 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", "index.js"]
25 changes: 25 additions & 0 deletions docker/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
image: ptarmiganlabs/butler-app-duplicator:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: ptarmiganlabs/butler-app-duplicator:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: ptarmiganlabs/butler-app-duplicator:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8
-
image: ptarmiganlabs/butler-app-duplicator:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux
variant: v7
15 changes: 11 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ restServer.listen(config.get('restAPIPort'), function() {
logger.info(`${restServer.name} listening at ${restServer.url}`);
});


// Set up Docker healthcheck server
// Create restServer object
var restServerDockerHealth = restify.createServer({
name: 'Docker healthcheck for Butler App Duplicator',
version: appVersion,
});


// Enable parsing of http parameters
restServerDockerHealth.use(restify.plugins.queryParser());

Expand All @@ -154,10 +156,15 @@ restServerDockerHealth.get(
},
);

// Start Docker healthcheck REST server on port 12398
restServerDockerHealth.listen(12398, function() {
logger.info(`Docker healthcheck server now listening on ${restServerDockerHealth.url}`);
});
// Start Docker healthcheck REST server on port set in config file
if (config.get('dockerHealthCheck.enabled') == true) {
logger.verbose('MAIN: Starting Docker healthcheck server...');

restServerDockerHealth.listen(config.get('dockerHealthCheck.port'), function () {
logger.info(`Docker healthcheck server now listening on ${restServerDockerHealth.url}`);
});
};


// Create custom property (unless it already exists) used to identify template apps
let qrsInstanceCustomPropertyCheck1 = new qrsInteract(configQRS);
Expand Down
Loading