Skip to content

Commit

Permalink
Merge pull request #153 from bugy/webpack
Browse files Browse the repository at this point in the history
moved JS to webpack building
  • Loading branch information
bugy authored Dec 28, 2018
2 parents b832abe + e0ccf62 commit d126830
Show file tree
Hide file tree
Showing 112 changed files with 3,132 additions and 2,867 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ conf/conf.json
logs
.idea
temp
web/css/libs
web/css/fonts/libs
web/js/libs
web
web-src/node_modules
web-src/package-lock.json
54 changes: 46 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
language: python
python: 3.4
if: tag IS blank
sudo: required
dist: xenial
language: node_js
node_js:
- '6'
cache:
directories:
- web-src/node_modules
addons:
chrome: stable
env:
global:
- OWNER=${TRAVIS_REPO_SLUG%/*}
- secure: "GtWCiMPNz3MDDTvXqaVsgZBvlxYRZuTY6sUEhWTL37zJZHgRLlxTCTD27hHZp2P4B6G6KGV/0iEvMYxqzo6jMrzcEnt7TlGetteqI18dhV1dIQGH6uy8Y/PktkK2g2FuJeGV3FRK4+a21v6zzSuUaFa26k97mPapa4LS83XXj7rc13ll23HhhtObVF/a1n3U0Xwe4FkdoxbKlecJUnNujESxFk4xQl4N1tFv15fldDlFq0XWs26eEp3LU/n7wkMzbg9WEqPvDeaYlvir9VpvcYWpVvf8Uz+wpvW1jnE2R6bK1TDv5BNzQwbf2JtN284yZ8I1nwZtOJkc1RUr5wUFxCD0p8tc30sAlKemI385v2t1ccoBYMwH8LHFIUoSXoolHZBsnZeADqpo3a0d8hVFWv4AcxC27Q6SfMCltl0+ogAoQ7wVfkRT++044p415Ar4raEqIkqTm64FaRNMS0v2y5mS2634PMSGMRnK+NBrWz1yFKxsiuPKypIWygtrJ4pyiL2yPBZupnCluEgqva3q6AmMDlNuSUmcTEnCRGB01U2if6/oSEgISH1VK2lsRSxuoG5dFFuezwv90YENh/7pw0/hgge7EOse6OzDsU3uNRWcTuXF7eEBhjM1wBHWHlaAwV9vfHMZX4sHWP4R4CZhPjVEPRz6HPEg1tFCs2EvkuI="
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
install:
- pip install -r requirements.txt
- pip install ldap3
- sudo pip3 install -r requirements.txt
- sudo pip3 install ldap3
- sudo pip3 install pyasn1 --upgrade
- cd web-src
- npm install
- cd ..
before_script:
- cd src
- python3 -m unittest discover -s tests -p "*.py"
- cd ..
- cd src
- python3 -m unittest discover -s tests -p "*.py"
- cd ../web-src
- npm run test
- cd ..
script:
- python3 tools/build.py
- python3 tools/build.py
before_deploy:
- git config --local user.name 'bugy'
- git config --local user.email '[email protected]'
- git tag -f 'dev'
- git remote add gh https://${OWNER}:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git push -f gh dev
- git remote remove gh
deploy:
provider: releases
name: dev
api_key: $GITHUB_TOKEN
file: build/script-server.zip
prerelease: true
overwrite: true
skip_cleanup: true
on:
branch: master
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/bugy/script-server.svg?branch=master)](https://travis-ci.org/bugy/script-server)

# script-server
Script-server is a Web GUI and a web server for scripts.

Expand Down Expand Up @@ -41,16 +43,19 @@ Any more or less up to date browser with enabled JS
Internet connection is not needed. All the files are loaded from the server.

## Installation
### Non-developer mode
1. Download script-server.zip file from [Latest release](https://github.com/bugy/script-server/releases/latest)
### For production
1. Download script-server.zip file from [Latest release](https://github.com/bugy/script-server/releases/latest) or [Dev release](https://github.com/bugy/script-server/releases/tag/dev)
2. Create script-server folder anywhere on your PC and extract zip content to this folder

(For detailed steps on linux with virtualenv, please see [Installation guide](https://github.com/bugy/script-server/wiki/Installing-on-virtualenv-(linux))
(For detailed steps on linux with virtualenv, please see [Installation guide](https://github.com/bugy/script-server/wiki/Installing-on-virtualenv-(linux)))

### Developer mode
### For development
1. Clone/download the repository
2. Run 'tools/init.py --dev' script (this will download javascript libraries)
2. Run 'tools/init.py --dev --no-npm' script

`init.py` script should be run after pulling any new changes

If you are making changes to web files, use `npm run build:dev` or `npm run start:dev`

## Setup and run
1. Create configurations for your scripts in *conf/runners/* folder (see [script config page](https://github.com/bugy/script-server/wiki/Script-config) for details)
Expand Down
2 changes: 2 additions & 0 deletions samples/scripts/parameterized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ else
echo '--file_upload content:'
cat "$my_file"
fi

sleep 5
8 changes: 7 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import logging.config
import os
import sys

import migrations.migrate
from alerts.alerts_service import AlertsService
Expand All @@ -17,6 +18,7 @@
from files.user_file_storage import UserFileStorage
from model import server_conf
from utils import tool_utils, file_utils
from utils.tool_utils import InvalidWebBuildException
from web import server

parser = argparse.ArgumentParser(description='Launch script-server.')
Expand Down Expand Up @@ -49,7 +51,11 @@ def get_secret(temp_folder):


def main():
tool_utils.validate_web_imports_exist(os.getcwd())
try:
tool_utils.validate_web_build_exists(os.getcwd())
except InvalidWebBuildException as e:
print(str(e))
sys.exit(-1)

logging_conf_file = os.path.join(CONFIG_FOLDER, 'logging.json')
with open(logging_conf_file, 'rt') as f:
Expand Down
2 changes: 1 addition & 1 deletion src/tests/auth_ldap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def connect(username, password):
)

for dn, attrs in self._entries.items():
dn = safe_dn(dn)
dn = safe_dn(dn).lower()

entry_added = connection.strategy.add_entry(dn, attrs)
if not entry_added:
Expand Down
Loading

0 comments on commit d126830

Please sign in to comment.