Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
merge from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
garethcmurphy committed Jan 9, 2019
2 parents 19d2f11 + a37cb7d commit 5d61d00
Show file tree
Hide file tree
Showing 64 changed files with 9,169 additions and 6,365 deletions.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 'Issue '
about: Describe this issue purpose here.

---

## Issue Name

### Summary

### Steps to Reproduce

### Current Behaviour

### Expected Behaviour

### Extra Details

Here you should include details about the system (if it is unique) and possible information about a fix (feel free to link to code where relevant). Screenshots/GIFs are also fine here.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ coverage
node_modules
npm-debug.log
server/pass
server/admin
server/ingestor
server/archiveManager
server/proposalIngestor
server/userGroupIngestor
server/providers.json
server/datasources.json
CI/PSI/envfiles/*
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ before_install:
# Setup your application stack. You may need to tweak these commands if you
# doing out-of-the-ordinary docker-compose builds.
- docker-compose build
- docker-compose up --abort-on-container-exit

# You will want this for logging. If one of your containers does not build for
# whatever reason it's best to report that now before your tests start
# otherwise it can be really tricky to debug why tests are failing sometimes.
- docker ps

script:
- docker-compose run catamel ./wait.sh --verbose
2 changes: 1 addition & 1 deletion CI/ESS/Dockerfile.proxy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY CI/ESS/envfiles/middleware.json /usr/src/app/server/
#COPY CI/ESS/envfiles/providers.json /usr/src/app/server/
#COPY CI/ESS/envfiles/datasources.json /usr/src/app/server/
#COPY CI/ESS/envfiles/component-config.json /usr/src/app/server/
COPY CI/ESS/start.sh /usr/src/app/start.sh
#COPY CI/ESS/start.sh /usr/src/app/start.sh
#COPY CI/ESS/settings.json /usr/src/app/test/config/
RUN NODE_ENV=dev
# Start the app
Expand Down
6 changes: 4 additions & 2 deletions CI/ESS/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
FROM node:9

RUN apt-get update && apt-get install -y --no-install-recommends mongodb-clients ldap-utils vim

ENV PORT 3000
EXPOSE 3000

WORKDIR /usr/src/app
COPY package.json /usr/src/app/
# Install our packages
RUN npm install
RUN npm install


# Copy the rest of our application, node_modules is ignored via .dockerignore
COPY . /usr/src/app
COPY CI/ESS/envfiles/config.ess.js /usr/src/app/server/config.local.js
COPY CI/ESS/envfiles/middleware.json /usr/src/app/server/
COPY CI/ESS/envfiles/providers.json /usr/src/app/server/
COPY CI/ESS/envfiles/providers.unittests.json /usr/src/app/server/providers.json
COPY CI/ESS/envfiles/datasources.json /usr/src/app/server/
COPY CI/ESS/envfiles/component-config.json /usr/src/app/server/
COPY CI/ESS/envfiles/settings.sample.json /usr/src/app/test/config/settings.json
Expand Down
38 changes: 38 additions & 0 deletions CI/ESS/Dockerfile.unittests
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# gives a docker image below 200 MB
FROM node:9

ENV http_proxy "http://192.168.1.1:8123"
ENV https_proxy $http_proxy
ENV no_proxy "localhost, 127.0.0.1"
RUN npm config set proxy $http_proxy
RUN npm config set https-proxy $http_proxy
RUN npm config set registry http://registry.npmjs.org/
RUN npm config set strict-ssl false


RUN apt-get update && apt-get install -y --no-install-recommends mongodb-clients vim ldap-utils

ENV PORT 3000
EXPOSE 3000

WORKDIR /usr/src/app
COPY package.json /usr/src/app/
# Install our packages
RUN npm install


# Copy the rest of our application, node_modules is ignored via .dockerignore
COPY . /usr/src/app
COPY CI/ESS/envfiles/config.ess.js /usr/src/app/server/config.local.js
COPY CI/ESS/envfiles/middleware.json /usr/src/app/server/
RUN touch /usr/src/app/test/config/providers.json
COPY CI/ESS/envfiles/providers.unittests.json /usr/src/app/server/providers.json
COPY CI/ESS/envfiles/datasources.json /usr/src/app/server/
COPY CI/ESS/envfiles/component-config.json /usr/src/app/server/
RUN touch /usr/src/app/test/config/settings.json
COPY CI/ESS/envfiles/settings.sample.json /usr/src/app/test/config/settings.json
COPY CI/ESS/wait.sh /usr/src/app/
# no longer needed COPY CI/ESS/createIndex.js /usr/src/app/

# Start the app
CMD ["./wait.sh"]
1 change: 1 addition & 0 deletions CI/ESS/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node('docker') {
echo "Git image id : ${IMAGE_ID}"
sh "docker push dacat/catamel:${IMAGE_ID}dev"
sh "docker push dacat/catamel:latest"
sh "docker rmi dacat/catamel:${IMAGE_ID}dev"
}
}
stage('SuperTest Catamel ') {
Expand Down
2 changes: 1 addition & 1 deletion CI/ESS/envfiles/config.ess.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
restApiRoot: '/api' + (version > 0 ? '/v' + version : ''),
host: process.env.HOST || '0.0.0.0',
port: process.env.PORT || 3000,
pidPrefix: '10.17199',
pidPrefix: '20.500.12269',
policyPublicationShiftInYears: 3,
policyRetentionShiftInYears: 10,
site: 'ESS',
Expand Down
34 changes: 34 additions & 0 deletions CI/ESS/envfiles/providers.unittests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"local": {
"provider": "local",
"module": "passport-local",
"usernameField": "username",
"passwordField": "password",
"authPath": "/auth/local",
"successRedirect": "/auth/account",
"failureRedirect": "/local",
"failureFlash": true
},
"ldap": {
"provider": "ldap",
"authScheme": "ldap",
"module": "passport-ldapauth",
"authPath": "/auth/msad",
"successRedirect": "/auth/account",
"failureRedirect": "/msad",
"session": true,
"json": true,
"failureFlash": true,
"profileAttributesFromLDAP": {
"displayName": "displayName",
"email": "mail"
},
"server": {
"url": "ldap://openldap:389",
"bindDn": "cn=admin,dc=example,dc=org",
"bindCredentials": "admin",
"searchBase": "dc=example,dc=org",
"searchFilter": "(cn={{username}})"
}
}
}
6 changes: 3 additions & 3 deletions CI/ESS/envfiles/settings.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"admin": {
"username": "ingestor",
"password": "aman",
"login": "User/login"
"login": "api/v2/Users/login"
},
"user": {
"username": "admin",
"password": "admin",
"username": "zach",
"password": "pass",
"login": "auth/msad"
}
}
Expand Down
7 changes: 7 additions & 0 deletions CI/ESS/ldif_files/addAll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo "sleep for 5, waiting for ldap"
sleep 5
ldapsearch -v -h openldap -x -D "cn=admin,dc=example,dc=org" -w admin -b "dc=example,dc=org" -s sub
echo "adding to ldap"
ldapadd -v -h openldap -c -D "cn=admin,dc=example,dc=org" -w admin -f /ldif_files/people.ldif
echo "done adding to ldap"
69 changes: 69 additions & 0 deletions CI/ESS/ldif_files/people.ldif
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# --- OUs -------------------------------------

dn: ou=Groups,dc=example,dc=org
objectClass: organizationalunit
objectClass: top
ou: Groups

dn: ou=People,dc=example,dc=org
objectClass: organizationalunit
objectClass: top
ou: People


# --- People ----------------------------------

dn: cn=marpontes,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: marpontes
userpassword: pass
givenname: Marcello
sn: Pontes
mail: [email protected]
uid: 1001

dn: cn=zach,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: zach
userpassword: pass
givenname: Zachary
sn: Zeus
mail: [email protected]
uid: 1002

dn: cn=leonardo,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: leonardo
userpassword: pass
givenname: Leonardo
sn: Luiz
mail: [email protected]
uid: 1003


# --- Groups ----------------------------------

dn: cn=Administrator,ou=Groups,dc=example,dc=org
objectClass: groupofuniquenames
objectClass: top
ou: Groups
cn: Administrator
uniquemember: cn=marpontes, ou=People, dc=example,dc=org

dn: cn=Developers,ou=Groups,dc=example,dc=org
objectClass: groupofuniquenames
objectClass: top
ou: Groups
cn: Administrator
uniquemember: cn=marpontes, ou=People, dc=example,dc=org
uniquemember: cn=zach, ou=People, dc=example,dc=org
uniquemember: cn=leonardo, ou=People, dc=example,dc=org
Binary file added CI/ESS/scicatmodeldiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions CI/ESS/wait.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

sleep 20
npm test
# wait for mongo container to come up
sleep 15
npm run test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN addgroup mygroup && adduser -D -G mygroup myuser && mkdir -p /usr/src/app &&

# Prepare app directory
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
COPY package*.json ./

USER myuser
# Install our packages
Expand Down
23 changes: 23 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Description

## Motivation

Link to any open issues here

## Fixes:

*
*

## Changes:

*
*

## Tests included/Docs Updated?

- [ ] Included for each change/fix?
- [ ] Passing? (Merge will not be approved unless this is checked)
- [ ] Docs updated?

## Extra Information/Screenshots
Loading

0 comments on commit 5d61d00

Please sign in to comment.