NativeScript / nativescript-remote-builds

A NativeScript plugin for remote builds when running and publishing NativeScript apps without env setup.
Apache License 2.0
26 stars 9 forks source link

Unable to integrate project #14

Open martintschemernjak opened 4 years ago

martintschemernjak commented 4 years ago

Hi,

I followed the tutorial but i can not get it to work... I'm on a windows machine and i try to build a nativescript app for ios.

This is how my .nsremote.config.json looks like:

{ "circleci": { "sshRepositoryURL": "git@github.com:**********************************.git" } }

my .nsremote.env.json:

{ "local": { "CIRCLE_CI_API_ACCESS_TOKEN": "**********************************" } }

I followed the setup for CircleCI, created an account there, linked it to my Github account and uploaded a ssh key. The same ssh key i have localy.

If I try to build the app with tns build ios, I get the following message:

Unable to integrate the "*****" project with Circle CI. Make sure that "****" is an initialized GitHub repository and the Circle CI OAuth application is authorized in your GitHub organization - https://circleci.com/integrations/github

If I take a look into CircleCI I see that the build failed, but the error message there is the following:

!/bin/sh -eo pipefail No configuration was found in your project. Please refer to https://circleci.com/docs/2.0/ to get started with your configuration.

Warning: This configuration was auto-generated to show you the message above. Don't rerun this job. Rerunning will have no effect. false

If I now create a .circleci/config.yml file like this:

version: 2
jobs:
   build:
     docker:
       - image: node:13
     steps:
       - checkout

       - restore_cache:
           keys:
           - v1-dependencies-{{ checksum "package.json" }}
           # fallback to using the latest cache if no exact match is found
           - v1-dependencies-

       - run: npm install

       - save_cache:
           paths:
             - node_modules
           key: v1-dependencies-{{ checksum "package.json" }}

the build runs through on CircleCI, but I still get the error message "Unable to integrate the project" like above.

So my questions are now:

Thank you very much, Best regards, Martin

EdJones commented 3 years ago

I got this, too. Any resolutions? (I tried upgrading to NS 7, which ended with #17 )

EdJones commented 3 years ago

This error is generated when

const followRepoResponse = await this.$httpClient.httpRequest({
                url: `https://circleci.com/api/v1.1/project/github/${this.gitRepositoryName}/follow?circle-token=${this.circleCiApiAccessToken}`,
                method: "POST"
            });

fails. Barring a network or server issue, the problem is likely the CIRCLE_CI_API_ACCESS_TOKEN. Set one here: https://app.circleci.com/settings/user/tokens And make sure it's the one entered in nsremote.env.json:

{
    "local": {

       "CIRCLE_CI_API_ACCESS_TOKEN": "*******************************************"
    },
    "remote": {
        ...
      }}

I believe that nativescript-remote-builds creates its own .config.yml. Although, like you, I got movement when I created one.

We used the "httpsRepositoryURL": "https://github.com/<account name>/<repo name>.git" format in nsremote.config.json.

The remote service is also looking for a GITHUB_ACCESS_TOKEN, either in nsremove.env.json, or on your machine.

IvanGrigorov commented 2 years ago

One other remark on the failed integration can be found here:

24