Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versionning a NodeJS project using GitLab CI not working in verify conditions section #155

Closed
BilelK91 opened this issue Jul 6, 2020 · 4 comments

Comments

@BilelK91
Copy link

BilelK91 commented Jul 6, 2020

Environment

  • semantic-release version: ^15.0.0
  • CI environment: GitLab CI
  • Plugins used:

semantic-release/commit-analyzer : ^8.0.0
release-notes-generator : ^9.0.0
gitlab : ^6.0.4
git : ^7.0.0

  • semantic-release configuration:
    .releaserc.yml
plugins:
  - "@semantic-release/commit-analyzer"
  - "@semantic-release/release-notes-generator"
  - "@semantic-release/git"
  - "@semantic-release/gitlab"
      
branches:
  - "master"
  - "+([0-9])?(.{+([0-9]),x}).x"
  - name: "alpha"
    prerelease: "alpha"

.gitlab-ci.yml

    auto_increment:
      stage: auto_increment
      image: https://git.registry/dockerimages/node:13.16.3-stretch-git
      only:
        refs:
        - master
        - alpha
        # This matches maintenance branches
        - /^(([0-9]+)\.)?([0-9]+)\.x/
        # This matches pre-releases
        - /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
      script:
      - rm -f package-lock.json
      - npm install semantic-release --save-dev
      - npm install @semantic-release/gitlab 
      - npx semantic-release --debug
  • CI logs:
[12:42:28 PM] [semantic-release] › ℹ  Running semantic-release version 15.14.0
 2020-07-06T12:42:28.229Z semantic-release:config load config from: /builds/bk/NodejsApp/.releaserc.yml
 2020-07-06T12:42:28.240Z semantic-release:config options values: {
   branch: 'master',
   repositoryUrl: 'https://[secure]@GitLabURI/bk/NodejsApp.git',
   tagFormat: 'v${version}',
   plugins: [
     '@semantic-release/commit-analyzer',
     '@semantic-release/release-notes-generator',
     '@semantic-release/git',
     '@semantic-release/npm',
     '@semantic-release/gitlab'
   ],
   branches: [
     'master',
     '+([0-9])?(.{+([0-9]),x}).x',
     { name: 'alpha', prerelease: 'alpha' }
   ],
   _: [],
   debug: true,
   '$0': 'node_modules/.bin/semantic-release'
 }
 2020-07-06T12:42:28.433Z semantic-release:plugins options for @semantic-release/git/verifyConditions: {}
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
 2020-07-06T12:42:28.435Z semantic-release:plugins options for @semantic-release/npm/verifyConditions: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/gitlab/verifyConditions: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {}
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/git/prepare: {}
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/npm/prepare: {}
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/gitlab"
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/npm/publish: {}
 2020-07-06T12:42:28.438Z semantic-release:plugins options for @semantic-release/gitlab/publish: {}
 [12:42:28 PM] [semantic-release] › ✔  Run automated release from branch master
 [12:42:29 PM] [semantic-release] › ✔  Allowed to push to the Git repository
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
 [12:42:29 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
 [12:42:29 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/gitlab"
 [12:42:29 PM] [semantic-release] [@semantic-release/gitlab] › ℹ  Verify GitLab authentication (https://GitLabURI/api/v4)
 2020-07-06T12:42:29.039Z semantic-release:gitlab apiUrl: 'https://GitLabURI/api/v4'
 2020-07-06T12:42:29.039Z semantic-release:gitlab repoId: 'bk/NodejsApp'
 [12:42:29 PM] [semantic-release] › ✖  Failed step "verifyConditions" of plugin "@semantic-release/gitlab"
 [12:42:29 PM] [semantic-release] › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'statusCode' of undefined
     at module.exports (/builds/bk/NodejsApp/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
   pluginName: '@semantic-release/gitlab'
 }
 AggregateError: 
     TypeError: Cannot read property 'statusCode' of undefined
         at module.exports (/builds/bk/NodejsApp/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
     at /builds/bk/NodejsApp/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
     at processTicksAndRejections (internal/process/task_queues.js:97:5)
     at async Object.pluginsConf.<computed> [as verifyConditions] (/builds/bk/NodejsApp/node_modules/semantic-release/lib/plugins/index.js:80:11)
     at async run (/builds/bk/NodejsApp/node_modules/semantic-release/index.js:84:3)
     at async module.exports (/builds/bk/NodejsApp/node_modules/semantic-release/index.js:176:22)
     at async module.exports (/builds/bk/NodejsApp/node_modules/semantic-release/cli.js:55:5)
 ERROR: Job failed: command terminated with exit code 1
@yyynnn
Copy link

yyynnn commented Aug 3, 2020

this could be bypassed with NODE_TLS_REJECT_UNAUTHORIZED = 0
env variable, but..

@mokhos
Copy link

mokhos commented Nov 10, 2020

Hi there.
I have the same problem. What is the solution? What is the cause anyway?
Is there any other environment variable than GITLAB_TOKEN needed?

P.S: I have on-premise GitLab!

@fgreinacher
Copy link
Contributor

This looks a bit similar to #139. Is it still happening for you in current Node versions?

@fgreinacher
Copy link
Contributor

Closing this as I assume it is fixed in current Node versions. Feel free to reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants