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 }
Pipelines, gitlab CI, script. .gitlab-ci.yml . , docs:
: GIT_DEPTH: "1"
Dev: : node: : allow_failure: false script: - npm -./scripts/gitlab-ci_deploy.js
git commit && git push, .