Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Python Binary Wheel Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON Templates
Python Binary Wheel Package
Commits
46787a73
Commit
46787a73
authored
3 months ago
by
Hannes Feldt
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
cd467f0b
No related branches found
No related tags found
2 merge requests
!10
Add pre commit improve tox setup
,
!9
Draft: Add pre-commit hook and improve with better linting
Pipeline
#110024
failed
3 months ago
Stage: prepare
Stage: build
Stage: test
Pipeline: Python Binary Wheel Package
#110025
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+37
-49
37 additions, 49 deletions
.gitlab-ci.yml
project.gitlab-ci.yml
+122
-0
122 additions, 0 deletions
project.gitlab-ci.yml
with
159 additions
and
49 deletions
.gitlab-ci.yml
+
37
−
49
View file @
46787a73
include
:
-
local
:
"
{{cookiecutter.project_slug}}/.gitlab-ci.yml"
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
stages
:
-
prepare
-
build
-
test
trigger_prepare
:
stage
:
prepare
...
...
@@ -10,53 +9,42 @@ trigger_prepare:
strategy
:
depend
include
:
"
{{cookiecutter.project_slug}}/.prepare.gitlab-ci.yml"
default
:
# Generate template instance in my_awesome_app directory
build-template
:
stage
:
build
image
:
$CI_REGISTRY_IMAGE/ci-build-runner:$CI_COMMIT_REF_SLUG
# Bootstrap Cookiecutter template to test provided ci pipeline template
before_
script
:
script
:
-
python --version
# For debugging
-
git config --global user.name "unit test"
-
git config --global user.email "info@astron.nl"
-
cookiecutter --no-input --overwrite-if-exists --output-dir . .
-
cd my_awesome_app
# Override semgrep-sast before script
sast
:
before_script
:
-
python --version
# For debugging
# Override unit test before script
.run_unit_test_version_base
:
before_script
:
-
pip install cookiecutter
-
!reference
[
default
,
before_script
]
-
python --version
# For debugging
-
python -m pip install --upgrade pip
-
pip install --upgrade tox twine
# Override artifact directories
package_docs
:
stage
:
package
artifacts
:
expire_in
:
1w
paths
:
-
my_awesome_app/docs/build/*
# override package files before script
package_files
:
before_script
:
-
pip install cookiecutter
-
!reference
[
default
,
before_script
]
artifacts
:
expire_in
:
1w
paths
:
-
my_awesome_app/dist/*
# Override artifact directories
run_unit_tests_coverage
:
-
git init
-
git config user.email "ci-runner@example.com"
-
git config user.name "CI Runner"
-
source ./setup.sh
-
ls -lah
-
tox --version
-
pip install --upgrade tox
-
tox -e fix
-
rm -r .venv
-
rm -r .tox
# cannot use needs, for artifacts on child pipeline so must regenerate template!
artifacts
:
reports
:
coverage_report
:
coverage_format
:
cobertura
path
:
my_awesome_app/coverage.xml
paths
:
-
my_awesome_app/htmlcov/*
-
my_awesome_app/*
-
project.gitlab-ci.yml
# Spawn pipeline using the gitlab-ci.yml from generated template instance
# use project.gitlab.ci.yml for necessary job overrides from this template instance
# (due to changes in directories and paths etc)
project-pipeline
:
stage
:
test
trigger
:
strategy
:
depend
include
:
-
artifact
:
my_awesome_app/.gitlab-ci.yml
job
:
build-template
-
artifact
:
project.gitlab-ci.yml
job
:
build-template
variables
:
PARENT_PIPELINE_ID
:
$CI_PIPELINE_ID
This diff is collapsed.
Click to expand it.
project.gitlab-ci.yml
0 → 100644
+
122
−
0
View file @
46787a73
# This file overrides all the jobs defined in {{cookiecutter.project_slug}}/.gitlab.ci-yml
# this is to ensure they depend on the template installation artifact of the root
# .gitlab-ci.yml from job `build-template`
# The generated gitlab-ci.yml from this `build-template` job is used for the actual
# trigger include to prevent including jobs that still contain template arguments
trigger_prepare
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "parent_pipeline"
when
:
never
default
:
# Bootstrap Cookiecutter template to test provided ci pipeline template
before_script
:
-
cd my_awesome_app
run_lint
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
sast
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
dependency_scanning
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
secret_detection
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
.run_unit_test_version_base
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
# Run all unit tests for Python versions except the base image
run_unit_tests
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
# Run code coverage on the base image thus also performing unit tests
run_unit_tests_coverage
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
artifacts
:
reports
:
coverage_report
:
coverage_format
:
cobertura
path
:
my_awesome_app/coverage.xml
paths
:
-
my_awesome_app/htmlcov/*
package_files
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
artifacts
:
expire_in
:
1w
paths
:
-
my_awesome_app/dist/*
package_docs
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
artifacts
:
expire_in
:
1w
paths
:
-
my_awesome_app/docs/build/*
#docker_build:
# needs:
# - pipeline: $PARENT_PIPELINE_ID
# job: build-template
# - package_files
# before_script:
# - cd my_awesome_app
run_integration_tests
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
-
package_files
publish_on_gitlab
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
-
package_files
publish_on_test_pypi
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
-
package_files
publish_on_pypi
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
-
package_files
publish_to_readthedocs
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
-
package_docs
release_job
:
needs
:
-
pipeline
:
$PARENT_PIPELINE_ID
job
:
build-template
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