From 8eecde255d45d8271550b860bcc1a5a1dc304fc4 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Wed, 15 Sep 2021 15:44:14 +0000 Subject: [PATCH 1/3] Add new file --- .gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1ade371 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,45 @@ +stages: +- build +- test +#running the bash script in test + +build_and_push: + image: registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev + stage: build + variables: + #CI_DEBUG_TRACE: "true" + CIC_PACKAGE_REGISTRY_PROJECT_ID: 27624814 + script: + #- python -m pip install --upgrade setuptools wheel pip twine semver + - python -m pip install --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple --extra-index-url https://pip.grassrootseconomics.net:8433 install -r requirements.txt -r test_requirements.txt -r sql_requirements.txt + - python setup.py sdist bdist_wheel + - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --skip-existing --repository-url ${CI_API_V4_URL}/projects/${CIC_PACKAGE_REGISTRY_PROJECT_ID}/packages/pypi dist/* + # Below are the built dependencies + #- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CIC_PACKAGE_REGISTRY_PROJECT_ID}/packages/pypi /tmp/wheelhouse/* + only: + - master + - daven/* + +tests: + image: registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev + stage: test + variables: + #CI_DEBUG_TRACE: "true" + CIC_PACKAGE_REGISTRY_PROJECT_ID: 27624814 + script: + - ls + - python -m pip install --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple --extra-index-url https://pip.grassrootseconomics.net:8433 install -r requirements.txt -r test_requirements.txt -r sql_requirements.txt + - python -m pip freeze + - ls + - > + if [ -z $PYTHONPATH ]; then + export PYTHONPATH=. + else + export PYTHONPATH=$PYTHONPATH:. + fi + - PYTHONPATH=. bash run_tests.sh + + only: + - master + - daven/0.0.0 + From 299312eb2f8dc05c86fa6e43df23c33abc2314cf Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Wed, 15 Sep 2021 15:50:16 +0000 Subject: [PATCH 2/3] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ade371..4d906c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ build_and_push: CIC_PACKAGE_REGISTRY_PROJECT_ID: 27624814 script: #- python -m pip install --upgrade setuptools wheel pip twine semver - - python -m pip install --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple --extra-index-url https://pip.grassrootseconomics.net:8433 install -r requirements.txt -r test_requirements.txt -r sql_requirements.txt + - python -m pip install --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple --extra-index-url https://pip.grassrootseconomics.net:8433 install -r requirements.txt - python setup.py sdist bdist_wheel - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --skip-existing --repository-url ${CI_API_V4_URL}/projects/${CIC_PACKAGE_REGISTRY_PROJECT_ID}/packages/pypi dist/* # Below are the built dependencies From 67ba77c83f717c0579f0f98c6b3286cd63a91cd5 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Wed, 15 Sep 2021 15:52:33 +0000 Subject: [PATCH 3/3] Update run_tests.sh --- run_tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 9ac346f..abb74bf 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -2,7 +2,9 @@ set -e set -x -#export PYTHONPATH=${PYTHONPATH:.} +default_pythonpath=$PYTHONPATH:. +export PYTHONPATH=${default_pythonpath:-.} +>&2 echo using pythonpath $PYTHONPATH for f in `ls tests/*.py`; do python $f done