Skip to content

Commit

Permalink
Merge pull request #122 from mountaindude/master
Browse files Browse the repository at this point in the history
5.5.0 RC1
  • Loading branch information
mountaindude authored Jul 15, 2020
2 parents 2947ef9 + bc551d0 commit 8eb5449
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 51 deletions.
111 changes: 103 additions & 8 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,14 +15,104 @@ steps:
password:
from_secret: dockerhub_password
repo: ptarmiganlabs/butler-sos
dockerfile: src/Dockerfile
dockerfile: src/Dockerfile.amd64
context:
# auto_tag: true
tags:
- latest
- '5.4.0'
- '5.4'
- '5'
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-sos
dockerfile: src/Dockerfile.arm64
context:
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-sos
dockerfile: src/Dockerfile.arm
context:
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
File renamed without changes.
27 changes: 27 additions & 0 deletions src/Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:12-stretch

# Add metadata about the image
LABEL maintainer="Göran Sander mountaindude@ptarmiganlabs.com"
LABEL description="Real-time operational metrics 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 src/package.json .
RUN npm install

# Copy app's source files
COPY src/. .

# 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-sos.js"]

27 changes: 27 additions & 0 deletions src/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:12-stretch

# Add metadata about the image
LABEL maintainer="Göran Sander mountaindude@ptarmiganlabs.com"
LABEL description="Real-time operational metrics 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 src/package.json .
RUN npm install

# Copy app's source files
COPY src/. .

# 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-sos.js"]

4 changes: 4 additions & 0 deletions src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ services:
options:
max-file: "5"
max-size: "5m"
labels:
kompose.service.type: nodeport # Used when creating Kubernetes resource files from this docker-compose file
kompose.service.export: "true" # Used when creating Kubernetes resource files from this docker-compose file
kompose.controller.type: deployment # Used when creating Kubernetes resource files from this docker-compose file
25 changes: 25 additions & 0 deletions src/docker/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
image: ptarmiganlabs/butler-sos:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: ptarmiganlabs/butler-sos:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: ptarmiganlabs/butler-sos:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8
-
image: ptarmiganlabs/butler-sos:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux
variant: v7
82 changes: 41 additions & 41 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8eb5449

Please sign in to comment.