te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>Gitlab Triggering "Merge Master to Develop" Merge Request - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Gitlab Triggering "Merge Master to Develop" Merge Request - Stack Overflow

programmeradmin3浏览0评论

ok, so this is a weird one...

I am using GitLab for pipeline management, the usual reasons, it's a system I have inherited, so lots of stuff done before my time... We have noticed that when we merge the development branch to master it triggers a build. When that build finishes it triggers a "Merge Master with Development" merge request, and we don't know why.

Has anyone else come across this before or know where this trigger might be based?

I had a look in the repo settings but can't see anything in WebHooks, the settings themselves or CD/CI settings.

Here is my .gitlab-ci.yml

image: alpine:3.10

variables:
  GIT_STRATEGY: clone

cache: &global_cache
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - node_modules/
  policy: pull-push

before_script:
  - apk update
  - apk add openssh-client
  - apk -Uuv add groff less python3 py-pip bash git curl gcc python3-dev musl-dev
  - export PYTHONPATH=/usr/lib/python3.7
  - alias pip=pip3
  - alias python3=python
  - pip install awscli

stages:
  - deploy
  - trigger

sonarcloud-check:
  stage: deploy
  allow_failure: true
  image: openjdk:17-jdk-slim
  variables:
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
    SONAR_TOKEN: "${CI_SONAR_TOKEN}
    SONAR_HOST_URL: "${CI_SONAR_HOST_URL}
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  before_script:
    - apt-get update && apt-get install -y wget unzip curl git
    - wget -qO /tmp/sonar-scanner.zip ".0.1.3006-linux.zip"
    - unzip /tmp/sonar-scanner.zip -d /opt
    - mv /opt/sonar-scanner-* /opt/sonar-scanner
    - export PATH="/opt/sonar-scanner/bin:$PATH"
  script:
    - sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.token=$SONAR_TOKEN
  only:
    - merge_requests
    - development

review:
  stage: deploy
  environment:
    name: review/$CI_COMMIT_REF_NAME
    url: http://REDACTED/$CI_COMMIT_REF_NAME/sitemap.html
  variables:
    REDACTED
  script:
    - apk add nodejs-npm
    - npm ci
    - >
      if [ "$RUN_CMS_ONLY" == "true" ]; then
        npm run clean
        aws s3 sync --acl public-read ./build/ s3://REDACTED-review/$CI_COMMIT_REF_NAME/
      else
        npm run build
        aws s3 sync --delete --acl public-read ./build/ s3://REDACTED-review/$CI_COMMIT_REF_NAME/
      fi
  except:
    - development
    - master
  cache:
    <<: *global_cache
    policy: pull
  artifacts:
    paths:
      - build/


development:
  stage: deploy
  environment:
    name: development
    url: http://REDACTED/sitemap.html
  variables:
    REDACTED
  script:
    - apk add nodejs-npm
    - npm ci
    - >
      if [ "$RUN_CMS_ONLY" == "true" ]; then
        npm run clean
        aws s3 sync --acl public-read ./build/ s3://REDACTED-develop
      else
        npm run build
        aws s3 sync --delete --acl public-read ./build/ s3://REDACTED-develop
      fi
  only:
    - development
  artifacts:
    paths:
      - build/

production1:
  stage: deploy
  environment:
    name: production1
    url: https://REDACTED/sitemap.html
  variables:
    REDACTED
  script:
    - apk add nodejs-npm
    - REDACTED
    - npm ci
    - >
      if [ "$RUN_CMS_ONLY" == "true" ]; then
        npm run clean
        aws s3 sync --acl public-read ./build/ s3://REDACTED-prod1
      else
        npm run build
        aws s3 sync --delete --acl public-read ./build/ s3://REDACTED-prod1
      fi
  only:
    - master
  cache:
    <<: *global_cache
    policy: pull
  artifacts:
    paths:
      - build/

npm_templates:
  image: node:14-alpine
  variables:
    NPM_TOKEN: $CI_JOB_TOKEN
  stage: trigger
  script:
    - |
      {
        echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
        echo "${CI_API_V4_URL#http*:}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=\${CI_JOB_TOKEN}"
      } >> .npmrc
    - >
      if [ "$RUN_CMS_ONLY" == "true" ]; then
        echo "do not run npm templates on cms build"
      else
        npm i no-dependencies -g
        no-dependencies --before
        npm i @semantic-release/[email protected]
        npx [email protected]
        curl --request POST --form "token=$PREVIEW_TRIGGER_TOKEN" --form ref=${CI_COMMIT_REF_NAME} 
      fi
  only:
    refs:
      - master
      - development
    changes:
      - REDACTED
  cache:
    <<: *global_cache
    policy: pull

发布评论

评论列表(0)

  1. 暂无评论