Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved JS to webpack building #153

Merged
merged 30 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b06e927
rearranging web folder as a webpack preparation
bugy Oct 30, 2018
7d28dc9
migrated main code and dependencies to webpack
bugy Nov 4, 2018
0a0fcaf
fixed inlining sources on prod + fixed vue prod version
bugy Nov 4, 2018
aa0c6ea
fixed missing favicon
bugy Nov 4, 2018
d7e0ca4
removed unused fonts (they are imported now)
bugy Nov 4, 2018
528ef5f
adapted styles and controls to the new materializecss version + fixed…
bugy Nov 9, 2018
74ee23d
fixed obsolete field reference by getter
bugy Nov 9, 2018
5671f68
changed build/init scripts to use webpack build
bugy Nov 11, 2018
b367c18
set up vue loader + migrated file_upload to it
bugy Nov 13, 2018
e9e92f6
changed vue components to vue template
bugy Dec 12, 2018
d27e903
moved JS tests to web folder
bugy Dec 12, 2018
1c9971e
updated JS tests after webpack migration
bugy Dec 21, 2018
d4930c9
updated CI config + fixed all related issues
bugy Dec 27, 2018
5a60df4
added publishing of the latest commit to GitHub
bugy Dec 27, 2018
63210d6
allowed publishing releases from branches (for testing)
bugy Dec 27, 2018
7667628
added missing github api_key
bugy Dec 27, 2018
69f987f
fixed ldap mock, when search is done case-sensitively in some versions
bugy Dec 27, 2018
a450882
fixed obsolete python version
bugy Dec 27, 2018
33a364b
Merge branch 'master' into webpack
bugy Dec 27, 2018
2cfd423
upgraded dist image to use newer python
bugy Dec 27, 2018
41cae32
added missing setuptools package
bugy Dec 27, 2018
c7bc21e
fixed an issue with ldap3 dependency
bugy Dec 27, 2018
9d905eb
fixed wrong package name
bugy Dec 27, 2018
372ea55
fixed deploy configuration
bugy Dec 27, 2018
ed4378d
fixed not loading static data for login page
bugy Dec 27, 2018
148a74e
added possibility to download prebuild web files from releases
bugy Dec 28, 2018
26b58e7
Merge branch 'master' into webpack
bugy Dec 28, 2018
e872ed0
made download_web parameter optional for init
bugy Dec 28, 2018
dbc9696
fixed missing argument
bugy Dec 28, 2018
e0ccf62
added build icon
bugy Dec 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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