This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes 1548591 - use docker-compose in travis
- Loading branch information
Showing
15 changed files
with
128 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[flake8] | ||
exclude = **/migrations/**,.tox,*.egg,vendor | ||
# E501 - line too long (82 > 79 characters) | ||
# E731 - do not assign a lambda expression, use a def | ||
# F405 - name may be undefined, or defined from star imports: module | ||
# W504 - line break after binary operator | ||
# conflicts with W503 (line break before binary operator) | ||
ignore = E501,E731,F405,W504 | ||
# flake8-import-order settings | ||
import-order-style=edited | ||
application-import-names=kuma,pages,utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,36 @@ | ||
sudo: required | ||
branches: | ||
only: | ||
- master | ||
- potato-1490727 | ||
cache: | ||
pip: True | ||
directories: | ||
- node_modules | ||
- downloads | ||
language: python | ||
python: | ||
- "2.7" | ||
services: | ||
- docker | ||
- mysql | ||
- redis | ||
env: | ||
global: | ||
- DATABASE_URL=mysql://root:@127.0.0.1:3306/kuma | ||
- DJANGO_SETTINGS_MODULE=kuma.settings.travis | ||
- DOCKER_COMPOSE_VERSION=1.23.2 | ||
- ES_VERSION=6.7.1 | ||
- ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.1.tar.gz | ||
- PIPELINE_CLEANCSS_BINARY=$TRAVIS_BUILD_DIR/node_modules/.bin/cleancss | ||
- PIPELINE_CLEANCSS_ARGUMENTS="-O1 --skip-rebase" | ||
- PIPELINE_CSS_COMPRESSOR=kuma.core.pipeline.cleancss.CleanCSSCompressor | ||
- PIPELINE_JS_COMPRESSOR=pipeline.compressors.uglifyjs.UglifyJSCompressor | ||
- PIPELINE_SASS_BINARY=$TRAVIS_BUILD_DIR/node_modules/.bin/node-sass | ||
- PIPELINE_UGLIFYJS_BINARY=$TRAVIS_BUILD_DIR/node_modules/.bin/uglifyjs | ||
|
||
matrix: | ||
include: | ||
- python: "2.7" | ||
- language: python | ||
python: 3.6 | ||
cache: pip | ||
script: | ||
- scripts/travis-docs | ||
- language: python | ||
python: 2.7 | ||
env: | ||
TOXENV=pytest | ||
CREATE_DB=kuma | ||
INSTALL_ELASTICSEARCH=1 | ||
INSTALL_NPM_TOOLS=1 | ||
- python: "2.7" | ||
env: | ||
TOXENV=flake8 | ||
- python: "2.7" | ||
env: | ||
TOXENV=docs | ||
- python: "2.7" | ||
env: | ||
TOXENV=locales | ||
CREATE_DB=kuma | ||
INSTALL_NPM_TOOLS=1 | ||
- python: "2.7" | ||
env: | ||
TOXENV=docker | ||
INSTALL_DOCKER_COMPOSE=1 | ||
UID=0 | ||
- python: "2.7" | ||
env: | ||
TOXENV=assetlint | ||
INSTALL_NPM_TOOLS=1 | ||
- python: "3.6" | ||
env: | ||
TOXENV=pytest3 | ||
CREATE_DB=kuma | ||
INSTALL_ELASTICSEARCH=1 | ||
INSTALL_NPM_TOOLS=1 | ||
allow_failures: | ||
- python: "3.6" | ||
env: | ||
TOXENV=pytest3 | ||
CREATE_DB=kuma | ||
INSTALL_ELASTICSEARCH=1 | ||
INSTALL_NPM_TOOLS=1 | ||
install: | ||
- nvm install 10 | ||
- nvm use 10 | ||
- scripts/travis-install | ||
- pip install -U pip | ||
- pip install -r requirements/travis.txt | ||
# Wait for ElasticSearch to be ready | ||
- if [[ "$INSTALL_ELASTICSEARCH" == "1" ]]; then wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200; fi; | ||
script: | ||
- tox -v | ||
after_failure: | ||
- dmesg | tail | ||
notifications: | ||
irc: | ||
channels: | ||
- "irc.mozilla.org#mdndev" | ||
on_success: always | ||
on_failure: always | ||
use_notice: true | ||
DOCKER_COMPOSE_VERSION=1.23.2 | ||
cache: | ||
directories: | ||
- downloads | ||
- build | ||
- static | ||
script: | ||
- set -e | ||
- scripts/travis-python | ||
- scripts/travis-localerefresh | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
- language: node_js | ||
node_js: 10 | ||
cache: npm | ||
script: | ||
- scripts/travis-js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e # Exit on non-zero status | ||
set -u # Treat unset variables as an error | ||
|
||
pip install -r requirements/docs.txt | ||
sphinx-build -b html -d doctrees docs html |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e # Exit on non-zero status | ||
set -u # Treat unset variables as an error | ||
|
||
# XXX I think Travis automatically discovers that this is npm | ||
# based on the existence of a `package.json` & `package-lock.json` | ||
# so it automatically executes `npm ci` | ||
#npm install | ||
make jslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e # Exit on non-zero status | ||
set -u # Treat unset variables as an error | ||
|
||
# XXX Instead of using the "make-bundle" `localerefresh` we spell out | ||
# each and every one of these. Otherwise it causes to build-static again. | ||
## docker-compose exec -T web make localerefresh | ||
docker-compose exec -T web make localeextract | ||
docker-compose exec -T web make locale-populate-react | ||
docker-compose exec -T web make localetest | ||
docker-compose exec -T web make localecompile | ||
|
||
cd locale | ||
export GIT_PAGER=cat | ||
git diff -G "^msgid " templates/LC_MESSAGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
set -e # Exit on non-zero status | ||
set -u # Treat unset variables as an error | ||
|
||
# First install docker-compose (right version of it) | ||
if [ -x $(command -v docker-compose) ] | ||
then | ||
echo "Overwriting existing docker-compose." | ||
docker-compose -v | ||
else | ||
echo "Installing docker-compose ${DOCKER_COMPOSE_VERSION}." | ||
fi | ||
mkdir -p downloads | ||
DOCKER_COMPOSE_FILE=downloads/docker-compose-${DOCKER_COMPOSE_VERSION} | ||
if [ ! -f $DOCKER_COMPOSE_FILE ] | ||
then | ||
time wget -q --waitretry=1 --retry-connrefused -T 10 \ | ||
-O downloads/docker-compose-${DOCKER_COMPOSE_VERSION} \ | ||
https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` | ||
fi | ||
chmod +x $DOCKER_COMPOSE_FILE | ||
sudo cp $DOCKER_COMPOSE_FILE /usr/local/bin/docker-compose | ||
|
||
|
||
# Now build the Docker container | ||
|
||
time VERSION=latest make build-base | ||
time VERSION=latest make build-kuma | ||
|
||
time docker-compose --version | ||
time docker-compose up -d | ||
# Hang tight until MySQL appears to be working | ||
time docker-compose exec -T web urlwait mysql://root:kuma@mysql:3306/developer_mozilla_org 30 | ||
# Hang tight until Elasticsearch appears to be working | ||
time docker-compose exec -T web urlwait http://elasticsearch:9200 30 | ||
|
||
# echo "docker-compose exec -T web make webpack" | ||
# docker-compose exec -T web make webpack | ||
time docker-compose exec -T web make clean | ||
time docker-compose exec -T web make localecompile | ||
time docker-compose exec -T web make build-static | ||
time docker-compose exec -T web make pylint | ||
time docker-compose exec -T web ./manage.py migrate | ||
# time docker-compose exec -T web make test | ||
time docker-compose exec -T web make coveragetest | ||
# time docker-compose exec -T web make coveragetesthtml | ||
|
||
# This one is deliberately commented out because of this bug: | ||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1548669 | ||
#docker-compose exec -T web ./manage.py makemigrations --check --dry-run |