Cordoba and Gitlab CI

I currently use GitLab as the main repository for Cordova and Build PhoneGet projects for continuous integration, but they do not work together very well, and as far as I know, GitLab has its own builder.

Could you tell me if such a function exists, and if so, which functions should I use?

+4
source share
2 answers

Presumably, this should have been possible using some of the built-in methods.

“Just a quick update, we added the ability to link your PhoneGap Build account to an existing BitBucket or GitLab account. This will allow you to create your own private BitBucket or GitLab repository without resorting to insecure basic authentication (yes, people do it!). ( Http : //phonegap.com/blog/2016/04/11/bitbucket-and-gitlab-repo-oauth-supported/ )

But I could not find this integration, I wrote a script to automate the deployment from Gitlab CI, Pipelines, to Phonegap. The following are the setup steps:

  • npm install -D phonegap-build
  • You have a script that uses the phonegap-build function to log in and create a project in the cloud of cloud messages in your repository.

For example, the following code:

#!/usr/bin/env node
var phonegapbuild = require('phonegap-build')

console.log('Logging in...')
phonegapbuild.login({
    username: process.env.PHONEGAP_BUILD_USERNAME,
    password: process.env.PHONEGAP_BUILD_PASSWORD
}, function(e) {
    console.log('logged in!')
    var options = { platforms: ['android'], }

    if(e) error(e)
    else {
        console.log('Calling `build` function...')
        phonegapbuild.build(options, function(e) {
            if (e) error(e)
            else console.log('Success!')
        })
    }
})

const error = (err) => { console.error(err); process.exitCode = 1 }
  1. Pipelines, gitlab CI, script. .gitlab-ci.yml . , docs:

    : GIT_DEPTH: "1" Dev: : node: : allow_failure: false script:   - npm   -./scripts/gitlab-ci_deploy.js

  2. git commit && git push, .

+2

GitLab . Enterprise Edition, Community Edition.

: https://about.gitlab.com/gitlab-ci/

GitLab CI: http://doc.gitlab.com/ce/ci/README.html

, .

0

All Articles