mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-02-17 10:48:34 +01:00
Fixed Docker build and added tests
This commit is contained in:
parent
c315a786fa
commit
a54f57affc
10
Dockerfile
10
Dockerfile
@ -25,11 +25,11 @@ MAINTAINER Martin Donath <martin.donath@squidfunk.com>
|
|||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
|
|
||||||
# Copy files necessary for build
|
# Copy files necessary for build
|
||||||
COPY material .
|
COPY material material
|
||||||
COPY MANIFEST.in .
|
COPY MANIFEST.in MANIFEST.in
|
||||||
COPY package.json .
|
COPY package.json package.json
|
||||||
COPY requirements.txt .
|
COPY requirements.txt requirements.txt
|
||||||
COPY setup.py .
|
COPY setup.py setup.py
|
||||||
|
|
||||||
# Perform build and cleanup artifacts
|
# Perform build and cleanup artifacts
|
||||||
RUN \
|
RUN \
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
|
# Exit, if one command fails
|
||||||
|
set -e
|
||||||
|
|
||||||
# Run build and terminate on error
|
# Run build and terminate on error
|
||||||
yarn run build
|
"$(yarn bin)"/gulp build --clean --optimize --revision
|
||||||
[ $? -gt 0 ] && exit 1
|
|
||||||
|
|
||||||
# Deploy documentation to GitHub pages
|
# Deploy documentation to GitHub pages
|
||||||
if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||||
@ -41,10 +43,23 @@ echo "$TRAVIS_BRANCH" | grep -qvE "^[0-9.]+$" && exit 0; :;
|
|||||||
# Install dependencies for release build
|
# Install dependencies for release build
|
||||||
pip install wheel twine
|
pip install wheel twine
|
||||||
|
|
||||||
# Build release and docker image
|
# Build and install theme and Docker image
|
||||||
python setup.py build sdist bdist_wheel --universal
|
python setup.py build sdist bdist_wheel --universal
|
||||||
|
python setup.py install 2>/dev/null
|
||||||
docker build -t $TRAVIS_REPO_SLUG .
|
docker build -t $TRAVIS_REPO_SLUG .
|
||||||
|
|
||||||
|
# Prepare build regression test
|
||||||
|
pushd /tmp
|
||||||
|
mkdocs new test && cd test
|
||||||
|
echo "theme: material" >> mkdocs.yml
|
||||||
|
|
||||||
|
# Test Docker image build
|
||||||
|
docker run --rm -it -v `pwd`:/docs $TRAVIS_REPO_SLUG build
|
||||||
|
|
||||||
|
# Clean build test
|
||||||
|
rm -rf /tmp/test
|
||||||
|
popd
|
||||||
|
|
||||||
# Push release to PyPI
|
# Push release to PyPI
|
||||||
twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
|
twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user