diff --git a/.gitignore b/.gitignore index c1f62a9a..b898ed86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ +# Custom +*.zip +/tmp + + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class -# C extensions -*.so - # Distribution / packaging .Python build/ @@ -36,51 +38,14 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ .pytest_cache/ -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - # Sphinx documentation docs/_build/ # PyBuilder target/ -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - # Environments .env .venv @@ -89,19 +54,3 @@ venv/ ENV/ env.bak/ venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -*.zip -/tmp diff --git a/README.md b/README.md index 1212478b..0179b3de 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,17 @@ # Get Started Tutorial (sources) -Contains source code, deployment and generation scripts for the -[get started](https://dvc.org/doc/get-started) tutorial. +Contains source code, deployment and generation scripts for example DVC +repositories used in the [Get Started](https://dvc.org/doc/get-started) and +other sections of the docs. -- `create.sh` - generates the `example-get-started` repository. The previous - version must be manually deleted on Github. Code bundle is downloaded from - S3 the same way as in the online tutorial. If you update code, make sure - to run `deploy.sh` first to make sure that the archive is up to date. -- `deploy.sh` - deploys code archive that is downloaded as part of the tutorial - to S3. +- `get-started.sh` - generates the `example-get-started` DVC project from + scratch. Code bundle is downloaded from S3 the same way as in the _Get + Started_ -> [Connect Code and + Data](https://dvc.org/doc/get-started/connect-code-and-data) chapter. + If you change [source code](code/src/) files, run `deploy.sh` first to make + sure that the code.zip archive is up to date. + +- `deploy.sh` - deploys code archive that is downloaded as part of the + `get-started.sh` to S3. + > Requires AWS CLI and write access to `dvc-share` S3 bucket. diff --git a/code/README.md b/code/README.md index a812360c..6b8ba181 100644 --- a/code/README.md +++ b/code/README.md @@ -1,7 +1,8 @@ # DVC Get Started -This is an auto-generated repository (please, don't create issues here, use the -[example-get-started-dev](https://github.com/iterative/example-get-started-dev)). +This is an auto-generated repository for use in https://dvc.org/doc/get-started. +Please report any issues in +[example-repos-dev](https://github.com/iterative/example-repos-dev). ![](https://dvc.org/static/img/example-flow-2x.png) diff --git a/deploy.sh b/deploy.sh index 9f0300e4..319aef94 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,6 +1,10 @@ #!/bin/bash -set -uvex +# e Exit immediately if a command exits with a non-zero exit status. +# u Treat unset variables as an error when substituting. +# v Print shell input lines as they are read. +# x Print commands and their arguments as they are executed. +set -euvx PACKAGE_DIR=code PACKAGE=code.zip @@ -15,7 +19,7 @@ pushd $PACKAGE_DIR zip -r $PACKAGE src/* requirements.txt popd - +# Requires AWS CLI and write access to `dvc-share` S3 bucket. mv $PACKAGE_DIR/$PACKAGE . aws s3 cp --acl public-read $PACKAGE s3://dvc-share/get-started/$PACKAGE diff --git a/create.sh b/get-started.sh similarity index 93% rename from create.sh rename to get-started.sh index 8f8fbef8..65552404 100755 --- a/create.sh +++ b/get-started.sh @@ -1,5 +1,9 @@ #!/bin/bash +# e Exit immediately if a command exits with a non-zero exit status. +# u Treat unset variables as an error when substituting. +# v Print shell input lines as they are read. +# x Print commands and their arguments as they are executed. set -euvx THIS="$( cd "$(dirname "$0")" ; pwd -P )"