This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
forked from juliusloman/netxms-dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/migrate-to-actions' into 3.8.314
- Loading branch information
Showing
13 changed files
with
159 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Build Docker Images | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
WebUI: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout repository | ||
|
||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
name: Build & push Web UI | ||
with: | ||
image: netxms_webui | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USERNAME }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
dockerfile: webui/Dockerfile | ||
|
||
WebUIREST: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout repository | ||
|
||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
name: Build & push Web UI with REST API | ||
with: | ||
image: netxms_webuirest | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USERNAME }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
dockerfile: webuirest/Dockerfile | ||
|
||
Server: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout repository | ||
|
||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
name: Build & push Server | ||
with: | ||
image: netxms_webuirest | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USERNAME }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
dockerfile: server/Dockerfile | ||
|
||
NXAgent: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout repository | ||
|
||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
name: Build & push NXAgent | ||
with: | ||
image: netxms_webuirest | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USERNAME }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
dockerfile: nxagent/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
import gitlab | ||
import json | ||
|
||
return_object = dict() | ||
|
||
try: | ||
gitlab = gitlab.Gitlab('http://gitlab.com', job_token=os.environ['CI_JOB_TOKEN']) | ||
except KeyError: | ||
gitlab = gitlab.Gitlab('http://gitlab.com', private_token=os.environ['PRIVATE_TOKEN']) | ||
|
||
project = gitlab.projects.get(int(os.environ['PROJECT_ID'])) | ||
|
||
image_registry = project.repositories.list() | ||
for registry in image_registry: | ||
return_object.update({ | ||
registry.path : { | ||
"tags" : list() | ||
}, | ||
}) | ||
for tag in registry.tags.list(): | ||
sliced_version = tag.name.split("-") | ||
try: | ||
for index, slice in enumerate(sliced_version): | ||
sliced_version[index] = int(slice) | ||
except Exception: | ||
break | ||
tag.name = tag.name.replace("-", ".") | ||
return_object[registry.path]["tags"].append(tag.name) | ||
|
||
with open('container_registry_tags.json', 'w') as output: | ||
json.dump(return_object, output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
certifi==2020.12.5 | ||
chardet==4.0.0 | ||
idna==2.10 | ||
python-gitlab==2.7.1 | ||
requests==2.25.1 | ||
requests-toolbelt==0.9.1 | ||
urllib3==1.26.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import re as regex # To split the original file based on specific astrisks | ||
import json # To output the result as JSON | ||
|
||
changeLogFile = open("/mnt/c/Users/MBeckett/Documents/Repositories/netxms-dockerfiles/changelog/ChangeLog", "r").read() | ||
flatChangeList = list() | ||
|
||
# Regex breakdown: | ||
# | divides two seperate regex statements | ||
# ^ finds start of string, $ finds end of string, characters between these are matched | ||
# \ escapes the * as * is a special character in regex and we want to match '*' or '* ' | ||
for change in regex.split(r'^\*$|^\* $', changeLogFile, flags=regex.MULTILINE): | ||
if change != '\n': # Strip blank lines | ||
if change != '': # Strip blank lines | ||
flatChangeList.append(change) # Create flat list containing version numbers and patch notes | ||
|
||
changeList = list(zip(flatChangeList[0::2], flatChangeList[1::2])) # Split the list into a list of tuples containing (Version, Patch Notes) | ||
|
||
OutDict = dict() # Create to dict to be output as JSON | ||
for change in changeList: | ||
# Strip extra new lines and asterisk in change version/change text | ||
changeVersion = change[0].lstrip("\n* ").rstrip("\n") | ||
ChangeText = change[1].lstrip("\n").rstrip("\n") | ||
if "CURRENT" in changeVersion: | ||
continue | ||
OutDict[changeVersion] = ChangeText # Add each version to dict | ||
|
||
# Write file out to JSON | ||
with open('releases_from_changelog.json', 'w') as file: | ||
file.write(json.dumps(OutDict)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ | |
FROM debian:buster-slim | ||
MAINTAINER Matt Beckett <[email protected]> | ||
|
||
ENV NETXMS_VERSION_AGENT=3.8.314-1 | ||
ENV MAJOR_VERSION=3.8 MINOR_VERSION=314 | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | ||
apt-get update && apt-get -y install curl apt-transport-https gnupg && \ | ||
curl -sL http://packages.netxms.org/netxms.gpg | apt-key add - && \ | ||
echo "deb http://packages.netxms.org/debian/ buster main" > /etc/apt/sources.list.d/netxms.list && \ | ||
apt-get update && apt-get -y install netxms-agent=$NETXMS_VERSION_AGENT && apt-get clean | ||
apt-get update && apt-get -y install netxms-agent="${MAJOR_VERSION}.${MINOR_VERSION}-1" && apt-get clean | ||
|
||
COPY ./docker-entrypoint.sh / | ||
COPY nxagent/docker-entrypoint.sh / | ||
|
||
RUN chmod 755 /docker-entrypoint.sh | ||
ENTRYPOINT ["/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,21 @@ | |
|
||
FROM debian:buster-slim | ||
MAINTAINER Matt Beckett <[email protected]> | ||
ENV NETXMS_VERSION_SERVER=3.8.314-1 NETXMS_VERSION_AGENT=3.8.314-1 | ||
ENV MAJOR_VERSION=3.8 MINOR_VERSION=314 | ||
|
||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | ||
apt-get update && apt-get -y install curl apt-transport-https gnupg && \ | ||
curl -sL http://packages.netxms.org/netxms.gpg | apt-key add - && \ | ||
echo "deb http://packages.netxms.org/debian/ buster main" > /etc/apt/sources.list.d/netxms.list && \ | ||
apt-get update && apt-get -y install netxms-server=$NETXMS_VERSION_SERVER netxms-agent=$NETXMS_VERSION_AGENT netxms-dbdrv-sqlite3=$NETXMS_VERSION_SERVER supervisor && apt-get clean | ||
apt-get update && apt-get -y install netxms-server="${MAJOR_VERSION}.${MINOR_VERSION}-1" netxms-agent="${MAJOR_VERSION}.${MINOR_VERSION}-1" netxms-dbdrv-sqlite3="${MAJOR_VERSION}.${MINOR_VERSION}-1" supervisor && apt-get clean | ||
|
||
VOLUME /data | ||
|
||
EXPOSE 4701 | ||
|
||
ENV NETXMS_UNLOCKONSTARTUP=1 NETXMS_STARTAGENT=1 NXAGENT_REGISTERSERVER=127.0.0.1 | ||
|
||
COPY ./docker-entrypoint.sh ./nxagent.sh / | ||
COPY server/docker-entrypoint.sh server/nxagent.sh / | ||
|
||
RUN chmod 755 /docker-entrypoint.sh /nxagent.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ MAINTAINER Matt Beckett <[email protected]> | |
|
||
ENV MAJOR_VERSION=3.8 MINOR_VERSION=314 NETXMS_SERVER=127.0.0.1 NETXMS_SESSIONTIMEOUT=120 NETXMS_ENABLEADVANCEDSETTINGS=true | ||
|
||
COPY ./docker-entrypoint.sh / | ||
COPY webui/docker-entrypoint.sh / | ||
|
||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | ||
apt-get update && apt-get -y install wget apt-transport-https && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ MAINTAINER Matt Beckett <[email protected]> | |
|
||
ENV MAJOR_VERSION=3.8 MINOR_VERSION=314 NETXMS_SERVER=127.0.0.1 NETXMS_SESSIONTIMEOUT=120 NETXMS_ENABLEADVANCEDSETTINGS=true | ||
|
||
COPY ./docker-entrypoint.sh / | ||
COPY webuirest/docker-entrypoint.sh / | ||
|
||
RUN wget -O /usr/local/tomcat/webapps/nxapisrv.war http://www.netxms.org/download/releases/${MAJOR_VERSION}/netxms-websvc-${MAJOR_VERSION}.${MINOR_VERSION}.war && \ | ||
sha256sum /usr/local/tomcat/webapps/nxapisrv.war && \ | ||
|