Skip to content

Commit 785ec4e

Browse files
authored
Merge pull request #5508 from learningequality/0.17.x
0.17.2 release into master
2 parents 3a65158 + 7868918 commit 785ec4e

File tree

44 files changed

+6572
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+6572
-251
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
make dockerenvdist
6+
buildkite-agent artifact upload 'dist/*.whl'
7+
buildkite-agent artifact upload 'dist/*.zip'
8+
buildkite-agent artifact upload 'dist/*.tar.gz'
9+
buildkite-agent artifact upload 'dist/*.pex'
10+
buildkite-agent artifact upload 'dist/*.exe'

.buildkite/pipeline.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
steps:
2+
- label: Build the docker environment
3+
command: make dockerenvbuild
4+
5+
- wait
6+
7+
- label: Build the python packages and windows installer
8+
command: mkdir -p dist && .buildkite/build_and_upload_artifact.sh && docker container prune -f

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ubuntu:xenial
2+
3+
# install latest python and nodejs
4+
RUN apt-get -y update
5+
RUN apt-get install -y software-properties-common curl
6+
RUN add-apt-repository ppa:voronov84/andreyv
7+
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
8+
RUN apt-get -y update && apt-get install -y python2.7 python-pip git nodejs gettext python-sphinx wget
9+
10+
# Install wine and related packages
11+
RUN dpkg --add-architecture i386
12+
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates sudo software-properties-common
13+
RUN add-apt-repository -y ppa:ubuntu-wine/ppa && apt-get -y update && apt-get install --no-install-recommends --assume-yes wine
14+
15+
16+
COPY . /kalite
17+
VOLUME /kalitedist/
18+
19+
# for mounting the whl files into other docker containers
20+
RUN pip install virtualenv && virtualenv /kalite/kalite_env --python=python2.7
21+
RUN /kalite/kalite_env/bin/pip install -r /kalite/requirements_dev.txt \
22+
&& /kalite/kalite_env/bin/pip install -r /kalite/requirements_sphinx.txt \
23+
&& /kalite/kalite_env/bin/pip install -e /kalite/.
24+
25+
# Override the PATH to add the path of our virtualenv python binaries first so it's python executes instead of
26+
# the system python.
27+
ENV PATH=/kalite/kalite_env/bin:$PATH
28+
ENV KALITE_PYTHON=/kalite/kalite_env/bin/python
29+
30+
# Installer dependencies
31+
RUN cd /kalite/ && git clone https://github.com/learningequality/ka-lite-installers.git && cd /kalite/ka-lite-installers && git checkout 0.17.x
32+
RUN cd /kalite/ka-lite-installers/windows && wget http://pantry.learningequality.org/downloads/ka-lite/0.17/content/contentpacks/en.zip
33+
34+
# Build the python packages and the ka-lite windows installer
35+
CMD cd /kalite && make dist \
36+
&& cd /kalite/ka-lite-installers/windows \
37+
&& cp -R /kalite/dist/ka_lite_static-*-py2-none-any.whl /kalite/ka-lite-installers/windows \
38+
&& export KALITE_BUILD_VERSION=$(/kalite/kalite_env/bin/kalite --version) \
39+
&& wine inno-compiler/ISCC.exe installer-source/KaliteSetupScript.iss \
40+
&& cp /kalite/dist/* /kalitedist/ \
41+
&& cp /kalite/ka-lite-installers/windows/KALiteSetup-$(/kalite/kalite_env/bin/kalite --version).exe /kalitedist/

MANIFEST.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ recursive-include kalite/database/templates/content_items *sqlite
2121
# a local development environment
2222
recursive-exclude kalite/static *
2323

24-
# There are still a couple of files left here, however main part is for build
25-
# process
26-
recursive-include data *
27-
recursive-exclude data/khan *
28-
29-
# Necessary because it's a data directory so they
30-
# do not get automatically excluded
31-
recursive-exclude python-packages *pyc
32-
3324
# Docs
3425
include docs/kalite.1.gz
3526
kalite/static-docs

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ help:
1515
@echo "release - package and upload a release, options: format=[gztar,zip]"
1616
@echo "dist - package locally, options: format=[gztar,zip]"
1717
@echo "install - install the package to the active Python's site-packages"
18+
@echo "msgids - generates source .po files for CrowdIn"
1819

1920
# used for release and dist targets
2021
format?=gztar
@@ -70,6 +71,7 @@ coverage:
7071
coverage run --source kalite bin/kalite test
7172
coverage report -m
7273

74+
7375
docs:
7476
# rm -f docs/ka-lite.rst
7577
# rm -f docs/modules.rst
@@ -85,6 +87,7 @@ man:
8587
cli2man bin/kalite -o docs/kalite.1.gz
8688

8789
assets:
90+
node --version | grep -q v6 || ( echo "Only tested to support Node.js v6" && exit 1 )
8891
npm install --production
8992
node build.js
9093
KALITE_HOME=.kalite_dist_tmp bin/kalite manage syncdb --noinput
@@ -94,6 +97,12 @@ assets:
9497
cp .kalite_dist_tmp/database/data.sqlite kalite/database/templates/
9598
bin/kalite manage retrievecontentpack empty en --foreground --template
9699

100+
msgids:
101+
export IGNORE_PATTERNS="*/kalite/static-libraries/*,*/LC_MESSAGES/*,*/kalite/packages/dist/*,*/kalite/packages/bundled/django/*,*/kalite/*bundle*.js,*/kalite/*/js/i18n/*.js" ;\
102+
cd kalite ;\
103+
kalite manage makemessages -len --no-obsolete ;\
104+
kalite manage makemessages -len --no-obsolete --domain=djangojs
105+
97106
release: dist man
98107
ls -l dist
99108
echo "Uploading dist/* to PyPi, using twine"
@@ -106,7 +115,7 @@ sdist: clean docs assets
106115
python setup.py sdist --formats=$(format) --static
107116
python setup.py sdist --formats=$(format)
108117

109-
dist: clean docs assets
118+
dist: clean docs assets
110119
# Building assets currently creates pyc files in the source dirs,
111120
# so we should delete those...
112121
make clean-pyc
@@ -118,3 +127,16 @@ dist: clean docs assets
118127

119128
install: clean
120129
python setup.py install
130+
131+
dockerwriteversion:
132+
python -c "import kalite; print(kalite.__version__)" > kalite/VERSION
133+
134+
dockerenvclean:
135+
docker container prune -f
136+
docker image prune -f
137+
138+
dockerenvbuild: dockerwriteversion
139+
docker image build -t learningequality/kalite:$$(cat kalite/VERSION) -t learningequality/kalite:latest .
140+
141+
dockerenvdist: dockerwriteversion
142+
docker run -v $$PWD/dist:/kalitedist learningequality/kalite:$$(cat kalite/VERSION)

circle.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
machine:
22
python:
33
version: 2.7.11
4+
node:
5+
version: 6.1.0
46

57
dependencies:
68
cache_directories:
79
- "node_modules"
810
override:
911
- pip install -r requirements_sphinx.txt
1012
- pip install -e .
11-
12-
test:
13-
pre:
13+
- make assets
14+
- make docs
1415
- wget -O geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.10.0/geckodriver-v0.10.0-linux64.tar.gz
1516
- gunzip -c geckodriver.tar.gz | tar xopf -
1617
- chmod +x geckodriver
1718
- sudo mv geckodriver /home/ubuntu/bin
19+
20+
test:
21+
pre:
1822
- export PATH="$PATH:/home/ubuntu/bin"
1923
override:
20-
- make assets:
21-
parallel: true
22-
- make docs
2324
- kalite start --traceback -v2
2425
- sleep 6s # Necessary for server to be ready
2526
- kalite status

docs/README.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/developer_docs/environment.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ interfere with other Python software on your machine like this::
7373
$> mkvirtualenv my-kalite-env
7474
$> workon my-kalite-env
7575
$> pip install ka-lite
76+
77+
78+
Running tests
79+
_____________
80+
81+
82+
On Circle CI, we run Selenium 2.53.6 because it works in their environment. However,
83+
for more recent versions of Firefox, you need to upgrade Selenium::
84+
85+
pip install selenium\<3.5 --upgrade

docs/developer_docs/front_end_code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For more information about using Browserify to handle dependencies, please refer
4646
Building Frontend Code
4747
----------------------
4848

49-
The build script uses `node.js <https://nodejs.org/>`_ - to run the build server for production simply run ``node compile_javascript.js``.
49+
The build script uses `node.js <https://nodejs.org/>`_ - to run the build server for production simply run ``npm install --production`` and ``node build.js`` or build all assets with one command, ``make assets``.
5050

5151
Alternatively, for development, running ``bin/kalite start`` with the ``--watch`` flag will automatically run the build process in watch mode, recompiling Javascript as it changes, on the fly.
5252

docs/developer_docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Useful stuff our devs think that the rest of our devs ought to know about.
1313
Inline help <inline>
1414
Documentation <documentation>
1515
Accessibility <accessibility>
16+
Translation <translation>
1617

0 commit comments

Comments
 (0)