Verified Commit 596fc9fa authored by Laurent Heirendt's avatar Laurent Heirendt

harmonize rules

parent 304c4457
Pipeline #30389 failed with stages
in 2 minutes
...@@ -15,7 +15,7 @@ prepare:index: ...@@ -15,7 +15,7 @@ prepare:index:
image: python image: python
stage: prepare stage: prepare
rules: rules:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_REF_NAME
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE !~ /tmpBranch/ && $CI_COMMIT_MESSAGE !~ /Update index/' - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE !~ /tmpBranch/ && $CI_COMMIT_MESSAGE !~ /Update index/'
script: script:
- python .ci/generateIndex.py - python .ci/generateIndex.py
...@@ -72,7 +72,7 @@ build:pages: ...@@ -72,7 +72,7 @@ build:pages:
paths: paths:
- build - build
rules: rules:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_REF_NAME
- if: $CI_MERGE_REQUEST_ID - if: $CI_MERGE_REQUEST_ID
before_script: before_script:
- apt-get -qq update - apt-get -qq update
...@@ -104,9 +104,6 @@ generate:searchIndex: ...@@ -104,9 +104,6 @@ generate:searchIndex:
script: script:
- bash .ci/build_indices.sh - bash .ci/build_indices.sh
- mv build processed_build - mv build processed_build
rules:
- if: $CI_COMMIT_BRANCH
- if: $CI_MERGE_REQUEST_ID
artifacts: artifacts:
expire_in: 1 day expire_in: 1 day
paths: paths:
...@@ -120,8 +117,7 @@ pages: ...@@ -120,8 +117,7 @@ pages:
image: alpine:3.11.3 image: alpine:3.11.3
stage: deploy stage: deploy
rules: rules:
- if: '$CI_PROJECT_NAMESPACE != "R3" && $CI_PROJECT_NAMESPACE != "R3-core"' - if: '$CI_MERGE_REQUEST_ID && $CI_PROJECT_NAMESPACE != "R3" && $CI_PROJECT_NAMESPACE != "R3-core"'
- if: $CI_MERGE_REQUEST_ID
script: script:
- mv processed_build public - mv processed_build public
artifacts: artifacts:
...@@ -133,6 +129,8 @@ pages: ...@@ -133,6 +129,8 @@ pages:
deploy:vm: deploy:vm:
stage: deploy stage: deploy
image: alpine:3.1 image: alpine:3.1
rules:
- if: $CI_COMMIT_REF_NAME
before_script: before_script:
- 'which ssh-agent || ( apk add --update openssh )' - 'which ssh-agent || ( apk add --update openssh )'
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
...@@ -142,10 +140,10 @@ deploy:vm: ...@@ -142,10 +140,10 @@ deploy:vm:
- echo "$KNOWNHOSTS" > ~/.ssh/known_hosts - echo "$KNOWNHOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts
rules: rules:
- if: '$CI_COMMIT_BRANCH == "develop" && $CI_PROJECT_PATH == "R3/howto-cards"' - if: '$CI_COMMIT_REF_NAME == "develop" && $CI_PROJECT_PATH == "R3/howto-cards"'
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "R3/howto-cards"' - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PROJECT_PATH == "R3/howto-cards"'
script: script:
- ssh -p $SSHPORT $SSHCONNECT "mkdir -p ~/$CI_COMMIT_BRANCH/sources/public/$CI_JOB_ID ~/$CI_COMMIT_BRANCH/public" - ssh -p $SSHPORT $SSHCONNECT "mkdir -p ~/$CI_COMMIT_REF_NAME/sources/public/$CI_JOB_ID ~/$CI_COMMIT_REF_NAME/public"
- scp -P $SSHPORT -r processed_build/* $SSHCONNECT:~/$CI_COMMIT_BRANCH/sources/public/$CI_JOB_ID - scp -P $SSHPORT -r processed_build/* $SSHCONNECT:~/$CI_COMMIT_REF_NAME/sources/public/$CI_JOB_ID
- ssh -p $SSHPORT $SSHCONNECT "cd ~/$CI_COMMIT_BRANCH/public && ln -fs ../sources/public/$CI_JOB_ID/* . && cd ~/$CI_COMMIT_BRANCH/sources/public/ && find . -type d -not -newermt '-1 minutes' -exec rm -rf {} +;" - ssh -p $SSHPORT $SSHCONNECT "cd ~/$CI_COMMIT_REF_NAME/public && ln -fs ../sources/public/$CI_JOB_ID/* . && cd ~/$CI_COMMIT_REF_NAME/sources/public/ && find . -type d -not -newermt '-1 minutes' -exec rm -rf {} +;"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment