From eac4968857077676a7805b8049c394d0fe6caadc Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Mon, 13 Sep 2021 16:27:00 +0000 Subject: [PATCH 1/7] Add new file --- .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bdc3806 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +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 + - 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 + - python -m pip freeze + - ls + - export PYTHONPATH=$PYTHONPATH:. + - PYTHONPATH=. bash run_tests.sh + + only: + - master + - daven/0.0.0 + +# rules: +# - if: $CI_PIPELINE_SOURCE == "merge_request_event" From 17f95c3a4cf3bbe7ad3b851899dbed274f57f2f1 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Mon, 13 Sep 2021 18:47:01 +0000 Subject: [PATCH 2/7] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3a4fb2a..89828f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ alembic==1.4.2 SQLAlchemy==1.3.20 confini>=0.4.1a1,<0.5.0 pyxdg~=0.27 -chainlib~=0.0.9a7 +chainlib~=0.0.9a13 From e4761a3c5ccc3317fa99bb8d5648716579aac8b8 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Mon, 13 Sep 2021 18:56:23 +0000 Subject: [PATCH 3/7] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 89828f0..5965683 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ alembic==1.4.2 SQLAlchemy==1.3.20 confini>=0.4.1a1,<0.5.0 pyxdg~=0.27 -chainlib~=0.0.9a13 +chainlib~=0.0.9a10 From 047a0701143b0565623c900a3d33493a5b8c4daf Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Mon, 13 Sep 2021 19:00:51 +0000 Subject: [PATCH 4/7] Update test_requirements.txt --- test_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_requirements.txt b/test_requirements.txt index 7b4f8ca..96d1a07 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1 +1 @@ -chainlib==0.0.3rc2 +chainlib==0.0.9a10 From 65ad5b98f917f7d17f0c776d7ce6458c6b956629 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Tue, 14 Sep 2021 17:21:22 +0000 Subject: [PATCH 5/7] 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 bdc3806..33da99c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,7 +31,7 @@ tests: - 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 - python -m pip freeze - ls - - export PYTHONPATH=$PYTHONPATH:. + - export PYTHONPATH=. - PYTHONPATH=. bash run_tests.sh only: From 782377adbb48d656ce022cc66b0f59b4126e1ebe Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Tue, 14 Sep 2021 18:06:30 +0000 Subject: [PATCH 6/7] 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 492d4e1..c5f8d45 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 if [ $? -gt 0 ]; then From 8c689c860573eada1effe9a12086bce1e781cca5 Mon Sep 17 00:00:00 2001 From: Daven Savoie Date: Wed, 15 Sep 2021 05:52:38 +0000 Subject: [PATCH 7/7] Update .gitlab-ci.yml --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33da99c..424f4a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,7 +31,12 @@ tests: - 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 - python -m pip freeze - ls - - export PYTHONPATH=. + - > + if [ -z $PYTHONPATH ]; then + export PYTHONPATH=. + else + export PYTHONPATH=$PYTHONPATH:. + fi - PYTHONPATH=. bash run_tests.sh only: