.gitlab-ci.yml 1.14 KB
Newer Older
Laurent Heirendt's avatar
Laurent Heirendt committed
1
stages:
Laurent Heirendt's avatar
Laurent Heirendt committed
2 3
  - convert
  - deploy
Laurent Heirendt's avatar
Laurent Heirendt committed
4

Laurent Heirendt's avatar
Laurent Heirendt committed
5
convert:
Laurent Heirendt's avatar
Laurent Heirendt committed
6
  image: python
Laurent Heirendt's avatar
Laurent Heirendt committed
7
  stage: convert
Laurent Heirendt's avatar
Laurent Heirendt committed
8
  rules:
Laurent Heirendt's avatar
Laurent Heirendt committed
9
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Laurent Heirendt's avatar
Laurent Heirendt committed
10 11 12 13
  before_script:
    - pip install casq
  script:
    - python .ci/convertCASQ.py
Laurent Heirendt's avatar
Laurent Heirendt committed
14 15 16
  artifacts:
    expire_in: 1 day
    paths:
Laurent Heirendt's avatar
Laurent Heirendt committed
17
      - "Executable Modules"
Laurent Heirendt's avatar
Laurent Heirendt committed
18 19

commit:
Laurent Heirendt's avatar
Laurent Heirendt committed
20
  image:
Laurent Heirendt's avatar
Laurent Heirendt committed
21
    name: alpine/git:v2.26.2
Laurent Heirendt's avatar
Laurent Heirendt committed
22
    entrypoint: [""]
Laurent Heirendt's avatar
Laurent Heirendt committed
23 24
  stage: deploy
  rules:
Laurent Heirendt's avatar
Laurent Heirendt committed
25
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE !~ /tmpBranch/ && $CI_COMMIT_MESSAGE !~ /Update models/'
26
  before_script:
Laurent Heirendt's avatar
Laurent Heirendt committed
27
    - git fetch --all
28
    - url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
Laurent Heirendt's avatar
Laurent Heirendt committed
29
    - git remote set-url origin "https://$GIT_ACCESS_USER:$GIT_ACCESS_TOKEN@${url_host}"
30 31
    - git config user.name $GIT_ACCESS_USER
    - git config user.email $GIT_ACCESS_EMAIL
Laurent Heirendt's avatar
Laurent Heirendt committed
32
  script:
Laurent Heirendt's avatar
Laurent Heirendt committed
33
    - git branch -D tmpBranch || true
Laurent Heirendt's avatar
Laurent Heirendt committed
34
    - git checkout -b tmpBranch
Laurent Heirendt's avatar
Laurent Heirendt committed
35
    - git add --all
36
    - git commit -m "Update models" || true
Laurent Heirendt's avatar
Laurent Heirendt committed
37
    - git checkout $CI_COMMIT_REF_NAME
Laurent Heirendt's avatar
Laurent Heirendt committed
38
    - git pull origin $CI_COMMIT_REF_NAME
Laurent Heirendt's avatar
Laurent Heirendt committed
39
    - git merge tmpBranch --ff
Laurent Heirendt's avatar
Laurent Heirendt committed
40
    - git push origin $CI_COMMIT_REF_NAME || true
Laurent Heirendt's avatar
Laurent Heirendt committed
41
    - git branch -D tmpBranch