diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..b88591d87d8a455925bb76d19542fc311d959b38 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,47 @@ +image: debian:stable + +# run this before every stage + +before_script: + # install environment + - apt-get update -q && apt-get install -qq curl python3-pip > /dev/null + - pip3 install -r requirements.txt + + # set up project + - cp salt_observer/private_settings.example.py salt_observer/private_settings.py + +# build stage is the first stage + + build_staticfiles: + stage: build + script: + # Install nodejs + - curl -sL https://deb.nodesource.com/setup_4.x | sh > /dev/null 2>&1 + - apt-get update -q && apt-get install -qq nodejs + + # install & run gulp + - npm i gulp-cli --global > /dev/null + - npm i > /dev/null + - gulp build + + # collect staticfiles + - python3 manage.py collectstatic --noinput + + artifacts: + paths: + - static/ + name: "staticfiles" + +# execute test stage jobs if build stage is completed successful + +check_runserver: + stage: test + script: + - python3 manage.py runserver localhost:8000 & + - sleep 5 + - curl -isSf http://localhost:8000/ + +try_migrations: + stage: test + script: + - python3 manage.py migrate diff --git a/gulpfile.js b/gulpfile.js index 54dcca1b1ee7600826093015505d972f9ab3cb40..0527d11e94a7ca7c2f494efc2e47a61136208891 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,6 +20,7 @@ gulp.task('default', [ 'collect:fonts', 'compile:less' ]); +gulp.task('build', ['default']) gulp.task('watch', ['default'], function() { var less_watcher = gulp.watch(src + 'less/**/*.less', ['compile:less']); diff --git a/salt_observer/private_settings.example.py b/salt_observer/private_settings.example.py index 183b256c0229d1dc5e38b70c1f65680fde65a37c..2a4ab5d4af8bb7a2ae58118c382b025e337f9f0c 100644 --- a/salt_observer/private_settings.example.py +++ b/salt_observer/private_settings.example.py @@ -7,7 +7,7 @@ SECRET_KEY = 'l=fg3h+kynh^y77ac7k%4ubsk4wz=z&1ud8uy*m%p(iw8*+xp-' # SECURITY WARNING: # don't run with debug turned on in production! -DEBUG = False +DEBUG = True # change this! ALLOWED_HOSTS = ['localhost']