Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kypo-terraform-client
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
Container 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
kypo-terraform-client
Commits
e147c4d5
Commit
e147c4d5
authored
3 years ago
by
Juraj Paluba
Browse files
Options
Downloads
Patches
Plain Diff
create gitlab-ci
parent
ba4885c4
No related branches found
No related tags found
Loading
Pipeline
#144548
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+46
-0
46 additions, 0 deletions
.gitlab-ci.yml
with
46 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
46
−
0
View file @
e147c4d5
image
:
python:3.8
variables
:
PYTHON_TAG
:
py3
ABI_TAG
:
none
PLATFORM_TAG
:
any
PACKAGE_EXTENSION
:
whl
stages
:
-
build
-
deploy
build
:
stage
:
build
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
-
echo $PACKAGE > dist/.package-name
only
:
-
branches
-
tags
artifacts
:
paths
:
-
dist
expire_in
:
1 day
deploy
:
stage
:
deploy
variables
:
TWINE_PASSWORD
:
'
$CI_CUSTOM_REGISTRY_PASSWORD'
TWINE_USERNAME
:
'
$CI_CUSTOM_REGISTRY_USER'
script
:
-
export PACKAGE=$(cat dist/.package-name)
-
pip3 install twine
-
python3 -m twine upload --repository-url $KYPO_PYPI_UPLOAD_URL dist/$PACKAGE
dependencies
:
-
build
only
:
-
tags
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