Skip to content

Instantly share code, notes, and snippets.

@aviadlevy
Last active July 17, 2023 17:11
Show Gist options
  • Save aviadlevy/c2dda5707d619c58d3bef65df77ac24a to your computer and use it in GitHub Desktop.
Save aviadlevy/c2dda5707d619c58d3bef65df77ac24a to your computer and use it in GitHub Desktop.
GitLab CI per project dynamic deploy
create deploy to dedicated prod:
stage: pre-prod-deploy
image: gitlab.***.net:4567/group/app-infra/ci-image:latest
script:
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.***.net/group/app-infra.git
- cd app-infra
- python3 scripts/generate_ci.py
- cp -r ci-out ..
artifacts:
paths:
- ci-out
except:
refs:
- schedules
only:
refs:
- master
deploy to dedicated prod:
stage: prod-deploy
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
PARENT_JOB_NAME: "create deploy to dedicated prod"
trigger:
include:
- artifact: ci-out/middle-ci.yml
job: "create deploy to dedicated prod"
strategy: depend
when: on_success
except:
refs:
- schedules
only:
refs:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment