32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
|
# This would normally be part of the extra repos from where you want to upload Python packages to Nexus.
|
||
|
# TODO: Move to desired repo and rename to .gitlab-ci.yml
|
||
|
variables:
|
||
|
# placeholders for your actual variables
|
||
|
CICD_URL: git@xxx.com
|
||
|
NEXUS_IP: "x.x.x.x:8088"
|
||
|
NEXUS2_IP: "x.x.x.x:8088"
|
||
|
LATEST_BRANCH: "branch_xxx"
|
||
|
|
||
|
stages:
|
||
|
- Nexus_Upload_Libs
|
||
|
#------------------------------------------------------------
|
||
|
Nexus_Upload_Libs:
|
||
|
stage: Nexus_Upload_Libs
|
||
|
needs: []
|
||
|
tags:
|
||
|
- IPC-PLZ
|
||
|
script:
|
||
|
- export CICD_DIR=$(mktemp -d)
|
||
|
- git clone -q "CICD_URL" "CICD_DIR"
|
||
|
- cp -r $CICD_DIR/cicd* .
|
||
|
- cp -r $CICD_DIR/module_fetch.py .
|
||
|
- rm -r $CICD_DIR
|
||
|
- python3 -m venv venv
|
||
|
- source venv/bin/activate
|
||
|
- pip install -r cicd_requirements.txt
|
||
|
- echo -e "\e[32mChecking for missing libs on Nexus.\e[0m"
|
||
|
- python3 cicd_parser.py nexus_upload
|
||
|
rules:
|
||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && ( $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == LATEST_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" )
|
||
|
when: on_success
|