Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automated-problem-generation-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUNI-KYPO-CRP
backend-python
automated-problem-generation-lib
Commits
a3406654
Commit
a3406654
authored
3 years ago
by
Juraj Paluba
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab ci.yml file
parent
b28e4e77
No related branches found
No related tags found
1 merge request
!3
Update .gitlab ci.yml file
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+15
-28
15 additions, 28 deletions
.gitlab-ci.yml
with
15 additions
and
28 deletions
.gitlab-ci.yml
+
15
−
28
View file @
a3406654
...
@@ -22,30 +22,27 @@ test:
...
@@ -22,30 +22,27 @@ test:
-
pip install pytest-cov
-
pip install pytest-cov
-
coverage run -m pytest
-
coverage run -m pytest
-
coverage report
-
coverage report
-
pytest --junitxml=report.xml
only
:
only
:
-
branches
-
branches
-
tags
-
tags
tags
:
-
shared-fi
artifacts
:
when
:
always
reports
:
junit
:
report.xml
paths
:
-
dist
expire_in
:
1 day
build
:
build
:
stage
:
build
stage
:
build
script
:
script
:
# Get version. Variable CI_COMMIT_TAG is set only when tag was pushed.
-
export VERSION=$(if [[ "$CI_COMMIT_TAG" == "" ]]; then echo 0.0.0; else echo $CI_COMMIT_TAG | cut -c 2-; fi)
-
python3 setup.py setopt --command=metadata --option=version --set-value=$VERSION
-
echo VERSION=$VERSION
# Get package filename
-
export WHEEL_NAME=$(python3 setup.py --name | tr '-' '_')
-
export PACKAGE=$WHEEL_NAME-$VERSION-$PYTHON_TAG-$ABI_TAG-$PLATFORM_TAG.$PACKAGE_EXTENSION
-
echo PACKAGE=$PACKAGE
-
python3 setup.py bdist_wheel
-
python3 setup.py bdist_wheel
-
echo $PACKAGE > dist/.package-name
only
:
only
:
-
branches
-
branches
-
tags
-
tags
tags
:
-
shared-fi
artifacts
:
artifacts
:
paths
:
paths
:
-
dist
-
dist
...
@@ -53,24 +50,14 @@ build:
...
@@ -53,24 +50,14 @@ build:
deploy
:
deploy
:
stage
:
deploy
stage
:
deploy
variables
:
TWINE_PASSWORD
:
'
$CI_CUSTOM_REGISTRY_PASSWORD'
TWINE_USERNAME
:
'
$CI_CUSTOM_REGISTRY_USER'
script
:
script
:
-
echo "[distutils]" >> ~/.pypirc
-
export PACKAGE=$(cat dist/.package-name)
-
echo "index-servers = gitlab" >> ~/.pypirc
-
pip3 install twine
-
echo "[gitlab]" >> ~/.pypirc
-
python3 -m twine upload --repository-url $KYPO_PYPI_UPLOAD_URL dist/$PACKAGE
-
space=" "
-
echo "repository :$space https://gitlab.fi.muni.cz/api/v4/projects/14820/packages/pypi" >> ~/.pypirc
-
echo "username = __token__" >> ~/.pypirc
-
echo "password = $api_token" >> ~/.pypirc
-
python3 -m pip install --user --upgrade twine
#- echo 'import requests,sys' >> remover.py
#- echo "requests.delete('https://gitlab.fi.muni.cz/api/v4/projects/14820/packages/'+str(requests.get('https://gitlab.fi.muni.cz/api/v4/projects/14820/packages', headers={'PRIVATE-TOKEN':sys.argv[1],}).json()[-1]['id']), headers={'PRIVATE-TOKEN':sys.argv[1],})" >> remover.py
#- python3 -m pip install requests
#- python3 remover.py $api_token
-
python -m twine upload --repository gitlab dist/*
dependencies
:
dependencies
:
-
build
-
build
only
:
only
:
-
tags
-
tags
-
branches
tags
:
-
shared-fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment