Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fe678af1b |
||
|
|
60be7b9df4 | ||
|
|
ae3c992f7c | ||
|
|
02400daa62 | ||
|
|
05380af1a8 | ||
|
|
6816f3148f | ||
|
|
afb156364a | ||
|
|
e5899f64e5 |
13 changed files with 1 additions and 237 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
*.py[oc]
|
|
||||||
22
Dockerfile
22
Dockerfile
|
|
@ -1,22 +0,0 @@
|
||||||
FROM baseruntime/baseruntime:latest
|
|
||||||
|
|
||||||
ENV NAME=nodejs \
|
|
||||||
VERSION=0 \
|
|
||||||
RELEASE=1 \
|
|
||||||
ARCH=x86_64
|
|
||||||
|
|
||||||
LABEL summary="Javascript runtime." \
|
|
||||||
name="$FGC/$NAME" \
|
|
||||||
version="$VERSION" \
|
|
||||||
release="$RELEASE.$DISTTAG" \
|
|
||||||
architecture="$ARCH" \
|
|
||||||
usage="docker run nodejs node" \
|
|
||||||
description="Node.js is a platform built on V8 JavaScript Engine for easily building fast, scalable network applications." \
|
|
||||||
io.k8s.description="Node.js is a platform built on V8 JavaScript Engine for easily building fast, scalable network applications."
|
|
||||||
|
|
||||||
|
|
||||||
RUN microdnf --nodocs install nodejs npm
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
CMD /bin/sh/
|
|
||||||
16
Makefile
16
Makefile
|
|
@ -1,16 +0,0 @@
|
||||||
IMAGE_NAME=nodejs
|
|
||||||
|
|
||||||
MODULEMDURL=http://pkgs.fedoraproject.org/cgit/modules/nodejs.git/plain/nodejs.yaml
|
|
||||||
|
|
||||||
default: run
|
|
||||||
|
|
||||||
build:
|
|
||||||
docker build --tag=$(IMAGE_NAME) .
|
|
||||||
|
|
||||||
run: build
|
|
||||||
docker run -d $(IMAGE_NAME)
|
|
||||||
|
|
||||||
test: build
|
|
||||||
cd tests; MODULE=docker MODULEMD=$(MODULEMDURL) URL="docker=$(IMAGE_NAME)" make all
|
|
||||||
cd tests; MODULE=rpm MODULEMD=$(MODULEMDURL) make all
|
|
||||||
|
|
||||||
13
README.md
13
README.md
|
|
@ -1,13 +0,0 @@
|
||||||
nodejs dependencies
|
|
||||||
====================
|
|
||||||
|
|
||||||
build dependencies calculated by brt_dep_solver
|
|
||||||
-----------------------------------------------
|
|
||||||
compat-openssl10
|
|
||||||
gcc
|
|
||||||
icu
|
|
||||||
libuv
|
|
||||||
|
|
||||||
runtime dependencies calculated by brt_dep_solver
|
|
||||||
-------------------------------------------------
|
|
||||||
libuv
|
|
||||||
1
dead.package
Normal file
1
dead.package
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Master branch is not used for modules
|
||||||
49
nodejs.yaml
49
nodejs.yaml
|
|
@ -1,49 +0,0 @@
|
||||||
document: modulemd
|
|
||||||
version: 1
|
|
||||||
data:
|
|
||||||
summary: Javascript runtime
|
|
||||||
description: 'Node.js is a platform built on Chrome''s JavaScript runtime
|
|
||||||
for easily building fast, scalable network applications.
|
|
||||||
Node.js uses an event-driven, non-blocking I/O model that
|
|
||||||
makes it lightweight and efficient, perfect for data-intensive
|
|
||||||
real-time applications that run across distributed devices.'
|
|
||||||
license:
|
|
||||||
module: GPLv3
|
|
||||||
content:
|
|
||||||
- MIT
|
|
||||||
- ASL 2.0
|
|
||||||
- ISC
|
|
||||||
- BSD
|
|
||||||
dependencies:
|
|
||||||
buildrequires:
|
|
||||||
base-runtime: f26
|
|
||||||
shared-userspace: f26
|
|
||||||
requires:
|
|
||||||
base-runtime: f26
|
|
||||||
shared-userspace: f26
|
|
||||||
references:
|
|
||||||
community: https://docs.pagure.org/modularity/
|
|
||||||
documentation: https://github.com/modularity-modules/nodejs
|
|
||||||
tracker: https://github.com/modularity-modules/nodejs
|
|
||||||
profiles:
|
|
||||||
default:
|
|
||||||
rpms:
|
|
||||||
- nodejs
|
|
||||||
- npm
|
|
||||||
minimal:
|
|
||||||
rpms:
|
|
||||||
- nodejs
|
|
||||||
api:
|
|
||||||
rpms:
|
|
||||||
- npm
|
|
||||||
- nodejs
|
|
||||||
components:
|
|
||||||
rpms:
|
|
||||||
nodejs:
|
|
||||||
rationale: JavaScript runtime
|
|
||||||
# commit from f26 which enables bootstrapping
|
|
||||||
ref: b0da67b00a92f2ad570d91d6f50fb9b1786650c9
|
|
||||||
buildorder: 0
|
|
||||||
nodejs-packaging:
|
|
||||||
rationale: packaging macros for nodejs
|
|
||||||
ref: 037154a07e3fec45be281d29831d0b52e836bcce
|
|
||||||
0
sources
0
sources
|
|
@ -1,6 +0,0 @@
|
||||||
MODULE_LINT=/usr/share/moduleframework/tools/modulelint.py
|
|
||||||
CMD=python -m avocado run --filter-by-tags=-WIP $(MODULE_LINT) *.py
|
|
||||||
|
|
||||||
#
|
|
||||||
all:
|
|
||||||
$(CMD)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
document: modularity-testing
|
|
||||||
version: 1
|
|
||||||
name: nodejs
|
|
||||||
modulemd-url: http://pkgs.fedoraproject.org/cgit/modules/nodejs.git/plain/nodejs.yaml
|
|
||||||
service:
|
|
||||||
port: 8080
|
|
||||||
packages:
|
|
||||||
rpms:
|
|
||||||
- nodejs
|
|
||||||
- npm
|
|
||||||
testdependecies:
|
|
||||||
rpms:
|
|
||||||
- curl
|
|
||||||
module:
|
|
||||||
docker:
|
|
||||||
start: "docker run -td -u=0 --entrypoint /usr/bin/bash -p 8080:8080"
|
|
||||||
labels:
|
|
||||||
description: "Node.js is a platform built on V8 JavaScript Engine for easily building fast, scalable network applications."
|
|
||||||
io.k8s.description: "Node.js is a platform built on V8 JavaScript Engine for easily building fast, scalable network applications."
|
|
||||||
source: https://github.com/container-images/nodejs
|
|
||||||
container: docker.io/modularitycontainers/nodejs
|
|
||||||
rpm:
|
|
||||||
start: bash
|
|
||||||
stop: "forever stopall"
|
|
||||||
repos:
|
|
||||||
- http://mirror.vutbr.cz/fedora/releases/26/Everything/x86_64/os/
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Hello world!
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
const http = require('http');
|
|
||||||
|
|
||||||
const port = 8080;
|
|
||||||
|
|
||||||
const server = http.createServer((req, res) => {
|
|
||||||
res.statusCode = 200;
|
|
||||||
res.setHeader('Content-Type', 'text/plain');
|
|
||||||
res.end('Hello World\n');
|
|
||||||
});
|
|
||||||
|
|
||||||
server.listen(port, () => {
|
|
||||||
console.log(`Server running at http://127.0.0.1:${port}/`);
|
|
||||||
});
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
const http = require('http');
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const port = 8080;
|
|
||||||
|
|
||||||
string = "ERROR"
|
|
||||||
|
|
||||||
fs.readFile('/tmp/test/hello.txt','utf-8', function (err,data) {
|
|
||||||
if (err) {
|
|
||||||
console.log("Error");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string = data;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
const server = http.createServer((req, res) => {
|
|
||||||
res.statusCode = 200;
|
|
||||||
res.setHeader('Content-Type', 'text/plain');
|
|
||||||
res.end(string);
|
|
||||||
});
|
|
||||||
|
|
||||||
server.listen(port, () => {
|
|
||||||
console.log(`Server running at http://127.0.0.1:${port}/`);
|
|
||||||
});
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# This Modularity Testing Framework helps you to write tests for modules
|
|
||||||
# Copyright (C) 2017 Red Hat, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# he Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along
|
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
#
|
|
||||||
# Authors: Jan Koscielniak <jkosci@redhat.com>
|
|
||||||
#
|
|
||||||
import socket
|
|
||||||
from avocado import main
|
|
||||||
from avocado.core import exceptions
|
|
||||||
from moduleframework import module_framework
|
|
||||||
import urllib, os, time
|
|
||||||
|
|
||||||
|
|
||||||
class SanityCheckTemplate(module_framework.AvocadoTest):
|
|
||||||
"""
|
|
||||||
:avocado: enable
|
|
||||||
"""
|
|
||||||
def setUp(self):
|
|
||||||
super(self.__class__, self).setUp()
|
|
||||||
self.start()
|
|
||||||
self.run("mkdir -p /tmp/test")
|
|
||||||
self.run('cd /tmp/test/ && npm install -g forever')
|
|
||||||
|
|
||||||
def testServer(self):
|
|
||||||
self.copyTo(os.path.abspath("resources/server1.js"), "/tmp/test/server1.js")
|
|
||||||
self.run('cd /tmp/test/ && forever start server1.js')
|
|
||||||
time.sleep(2)
|
|
||||||
conn = urllib.urlopen("http://127.0.0.1:8080")
|
|
||||||
code = conn.getcode()
|
|
||||||
print ">>> Testing a simple server"
|
|
||||||
print ">>> Returned code: " + str(code)
|
|
||||||
assert code == 200
|
|
||||||
|
|
||||||
def testSyscall(self):
|
|
||||||
self.copyTo(os.path.abspath("resources/server2.js"), "/tmp/test/server2.js")
|
|
||||||
self.copyTo(os.path.abspath("resources/hello.txt"), "/tmp/test/hello.txt")
|
|
||||||
self.run('cd /tmp/test/ && npm install -g fs')
|
|
||||||
self.run('cd /tmp/test/ && forever start server2.js')
|
|
||||||
time.sleep(2)
|
|
||||||
conn = urllib.urlopen("http://127.0.0.1:8080")
|
|
||||||
response = conn.read()
|
|
||||||
print ">>> Response: " + response
|
|
||||||
assert response == "Hello world!"
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue