Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Common CI Configuration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
hive
Common CI Configuration
Commits
8a378f08
Commit
8a378f08
authored
1 year ago
by
Mateusz Żebrak
Committed by
Bartek Wrona
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Extract the common part - deploy_wheel_base
parent
7bacd502
No related branches found
No related tags found
1 merge request
!22
Create additional job template deploying to the official PyPI
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/python_projects.gitlab-ci.yml
+11
-8
11 additions, 8 deletions
templates/python_projects.gitlab-ci.yml
with
11 additions
and
8 deletions
templates/python_projects.gitlab-ci.yml
+
11
−
8
View file @
8a378f08
...
@@ -101,7 +101,7 @@ variables:
...
@@ -101,7 +101,7 @@ variables:
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| DEPLOY |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| DEPLOY |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.deploy_wheel_
templat
e
:
.deploy_wheel_
bas
e
:
extends
:
.configuration_template
extends
:
.configuration_template
when
:
manual
when
:
manual
variables
:
variables
:
...
@@ -110,13 +110,6 @@ variables:
...
@@ -110,13 +110,6 @@ variables:
before_script
:
before_script
:
-
!reference
[
.configuration_template
,
before_script
]
-
!reference
[
.configuration_template
,
before_script
]
-
rm build_wheel.env
# to keep the git status clean
-
rm build_wheel.env
# to keep the git status clean
script
:
-
echo -e "${TXT_BLUE}Deploying python wheel...${TXT_CLEAR}"
-
ls -al
-
poetry version
-
poetry config repositories.gitlab "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
-
poetry config http-basic.gitlab gitlab-ci-token "${CI_JOB_TOKEN}"
-
poetry publish --repository gitlab
after_script
:
after_script
:
# Job extending this template will depend on the build_wheel job, so we can use the same variable and pass it further
# Job extending this template will depend on the build_wheel job, so we can use the same variable and pass it further
# so jobs depending on deploy_wheel won't have to include build_wheel also just to get the version
# so jobs depending on deploy_wheel won't have to include build_wheel also just to get the version
...
@@ -129,4 +122,14 @@ variables:
...
@@ -129,4 +122,14 @@ variables:
reports
:
reports
:
dotenv
:
deploy_wheel.env
dotenv
:
deploy_wheel.env
.deploy_wheel_to_gitlab_template
:
extends
:
.deploy_wheel_base
script
:
-
echo -e "${TXT_BLUE}Deploying python wheel to the GitLab PyPI registry...${TXT_CLEAR}"
-
ls -al
-
poetry version
-
poetry config repositories.gitlab "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
-
poetry config http-basic.gitlab gitlab-ci-token "${CI_JOB_TOKEN}"
-
poetry publish --repository gitlab
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| DEPLOY |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| DEPLOY |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
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