Quantcast
Channel: CircleCI Discuss - Latest posts
Viewing all 14720 articles
Browse latest View live

Circleci gives me Are you sure you want to continue connecting (yes/no/[fingerprint])? when trying to pull from another private repo during terraform init

$
0
0

My job run on 2.0 and I am trying to run a simple terraform pipeline with init, plan… etc… It used to work fine, but we decided to use our modules in a separate repository and they’re both private repositories. Well, the problem is that now during the terraform init command I get an error because it looks like circleci is trying to ssh to the repo and is waiting for an answer to the following:

terraform init .
terraform plan
Initializing modules...
Downloading githubDOTcom/my-modules-repo.git for module_name...

The authenticity of host 'github(140.82.113.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? Step was canceled

By googling it I found a few tricks that could probably solve it, such as including ssh-keyscan 40.89.139.99 >> ~/.ssh/known_hosts or even mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config. None worked for me. In fact, when I include that ip, I receive a new one on the console… so it’s always a different one, which makes me believe it should have a better solution to this.

Here’s my current configuration: (Oh, and since new users can’t post more than two links here, I changed the urls to githubDOTcom

defaults: &defaults
working_directory: /tmp/build
docker:
- image: hashicorp/terraform:light

version: 2
jobs:
checkout:
<<: *defaults
steps:
- checkout
- persist_to_workspace:
root: /tmp/build
paths:
- .

plan_prod:
<<: *defaults
steps:
#- add_ssh_keys:
# fingerprints:
# - “nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8”
- attach_workspace:
at: /tmp/build
#- run:
# name: Avoid hosts unknown for github
# command: mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
- run:
name: Feature branch terraform plan o
command: |
mkdir ~/.ssh/
ssh-keyscan 140.82.113.3 >> ~/.ssh/known_hosts
ssh-keyscan 192.30.253.112 >> ~/.ssh/known_hosts
ssh-keyscan 140.82.114.4 >> ~/.ssh/known_hosts
#mkdir ~/.ssh/ && echo -e “Host githubDOTcom\n\tStrictHostKeyChecking no\n” > ~/.ssh/config
terraform init .
terraform plan
- persist_to_workspace:
root: /tmp/build
paths:
- .

workflows:
version: 2
Init and Plan:
jobs:
- checkout
- plan_prod:
requires:
- checkout
filters:
branches:
only: ReadmeFiles

Any tips? Thanks.


Windows build with CMake?

$
0
0

Hey Ciaran, this is how I download and extract CMake in my own project:

    $ProgressPreference = "SilentlyContinue"
    Invoke-WebRequest -URI https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-win64-x64.zip -OutFile $Env:HOMEPATH\cmake-3.16.4-win64-x64.zip
    Expand-Archive $Env:HOMEPATH\cmake-3.16.4-win64-x64.zip -DestinationPath $Env:HOMEPATH

I use this in my own project:

I'm trying to trigger the job via the api

$
0
0

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Pronto produces no output

$
0
0

on my branch locally I get output as follows:

$ bundle exec pronto run --exit-code
config/initializers/shrine.rb:4 W: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
config/initializers/shrine.rb:8 W: Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
config/initializers/shrine.rb:14 W: Layout/LineLength: Line is too long. [102/80]
config/initializers/shrine.rb:15 W: Layout/LineLength: Line is too long. [110/80]
config/initializers/shrine.rb:17 W: Layout/LineLength: Line is too long. [92/80]

.circleci/config.yml

# run pronto - rubocop etc
  - run:
      name: run pronto
      command: |
        git fetch && git merge-base origin/master HEAD
        bundle exec pronto run --exit-code

ouput on circle:

#!/bin/bash -eo pipefail
git fetch && git merge-base origin/master HEAD
bundle exec pronto run --exit-code

Circle ci 2.0 yarn dependencies

$
0
0

Hey Kyle!

I am also following the prescribed instructions from CircleCI on yarn cached deps, but seeing dependencies never get cached.

--frozen-lockfile should yield a failure if the lockfile requires any change or even if it needs to get created. Additionally, if the cache lockfile were changing everytime, a new cache would be created for the key, but I’m seeing that Circle is identifying a cache at the location!

Cannot find a job named `build` to run in the `jobs:` section of your configuration file - again

$
0
0

I am completely new to circleci, but our expert has left our company. I’m trying to debug our script by running it locally. This is the original. Becasue it is version 2.1 it won’t run locally

version: 2.1
executors:
  mac_exe:
    macos:
      xcode: "10.1.0"
  linux_exe:
    docker:
      - image: gcr.io/rmx-staging/circleci:0.0.13
  elm_exe:
    docker:
      - image: gcr.io/rmx-staging/elm:0.19.1

jobs:
  side_chain_tests:
    ...

workflows:
  build_and_test:
    jobs:
      - side_chain_tests
      - side_chain_build
      - elm_runtime_build
      - web_upload_assets:
          requires:
            - side_chain_build
            - elm_runtime_build
      - web_release:
         filters:
           branches:
             only: master
         requires:
           - side_chain_tests
           - web_upload_assets

Folowing the cli instructions I did

circleci config process .circleci/config.yml> .circleci/config2.yml
circleci build --config .circleci/config2.yml

But that gives me

Docker image digest: sha256:6331ae078d92837f2513d5aca3f6344189531ab1bdf79bd7231392c7a4b0aa45

====>> Spin up Environment

Build-agent version 1.0.10191-59d6c584 (2019-04-04T09:13:55+0000)

Error: Configuration errors: 1 error occurred:

* Cannot find a job named `build` to run in the `jobs:` section of your configuration file.

If you expected a workflow to run, check your config contains a top-level key called 'workflows:'

Step failed

Task failed

Error: 1 error occurred:

* Cannot find a job named `build` to run in the `jobs:` section of your configuration file.

If you expected a workflow to run, check your config contains a top-level key called 'workflows:'

circlecli2.yml concludes with

workflows:
  build_and_test:
    jobs:
    - side_chain_tests
    - side_chain_build
    - elm_runtime_build
    - web_upload_assets:
        requires:
        - side_chain_build
        - elm_runtime_build
    - web_release:
        filters:
          branches:
            only: master
        requires:
        - side_chain_tests
        - web_upload_assets
  version: 2

What could I do next?

Xcode 11.1 Swift Package Manager and BitBucket private repo issue

Circleci orb validate is valid but circleci config validate raises schema violation

$
0
0

I’m developing Orb and published suzuki-shunsuke/tfenv@dev:first.
This Orb seems to be valid.

$ circleci version
0.1.6915+e5767b0

$ circleci orb source suzuki-shunsuke/tfenv@dev:first | circleci orb validate -
Orb input is valid.

But when I try to use this orb, schema violations occur.

$ cat .circleci/config.yml
version: 2.1
orbs:
  tfenv: suzuki-shunsuke/tfenv@dev:first
jobs:
  clone:
    docker:
      - image: alpine:3.11.3
    steps:
      - run:
          command: echo hello

workflows:
  build:
    jobs:
      - clone

$ circleci config validate
Error: ERROR IN CONFIG FILE:
[#] 32 schema violations found
...

I uploaded orb.yml and the perfect output of circleci config validate at Gist.

When I comment out the orb declaration, the configuration seems to be valid.

$ cat .circleci/config.yml
version: 2.1
# orbs:
#   tfenv: suzuki-shunsuke/tfenv@dev:first
jobs:
  clone:
    docker:
      - image: alpine:3.11.3
    steps:
      - run:
          command: echo hello

workflows:
  build:
    jobs:
      - clone

$ circleci config validate
Config file at .circleci/config.yml is valid.

What is the orb wrong?

I’m using macOS Catalina 10.15.3 .

Thank you.


How to trigger PR pipelines in CircleCI for BitBucket

$
0
0

Thanks for your solution. Do you have any idea how to escape a branchname if is has an “/” in it?
ie:
feature/my-feature-branch

Xcode 11.1 Swift Package Manager and BitBucket private repo issue

$
0
0

Hi, thanks for the heads up about the article. Can you help point to documentation on how to authenticate with BitBucket via an app password through Xcode? It works locally, but I’m not sure if there is a specific environment variable that I should set for the app password or how that works since Xcode controls that interaction.

thanks!

Split-by=timings on Elixir project fails to find stored timings, possibly missing file names in JUnit XML

$
0
0

FOLLOW-UP: The issue is indeed that the junit-formatter XML output does not include
the file name in <testcase>s. Local testing of a forked branch has proved that including the file name allows CircleCI CLI to split by timings. I have opened a PR to add a configuration to optionally add the file name to the output.

Setting up AWS credentials with serverless framework not working when using SSM integration

$
0
0

Just solved this. For future readers: the AWS libraries that serverless depends on to decrypt values from SSM expect the ~/.aws/credentials file to be exactly at ~/.aws/credentials (/home/*your username*/.aws/credentials). Anywhere else and it won’t work. Make sure that if you are using sls config credentials to setup your credentials, you are running it from ~/ (or don’t be lazy like me and properly configure your credentials in CircleCI).

Good luck :slight_smile:

Circleci orb validate is valid but circleci config validate raises schema violation

$
0
0

My problem was resolved.
I removed an unneeded job then circleci config validate passed.

Push to another branch on github

$
0
0

Did you figure this out? We always had jenkins check for branches prefixed with “submit_*****” and only build those branches by “git checkout {branchname}”, then “git merge master”, then “./gradlew build” and finally if all 3 of those passed, we would then run “git checkout master” and “git merge {branchname}” to complete the cycle so that master was always a working build. Trying to see if we can do that with circle ci or if we just install jenkins on a server computer instead.

'checkout' not working - I'm stuck on master?

$
0
0

Did you figure this out at all? We want to only build branches prefixed with “submit_” then

  1. Run git checkout {branchname}
  2. Run git merge master
  3. If fails, bail, else next…
  4. Run the build
  5. If fails, bail, else next…
  6. Run git checkout master
  7. Run git merge {branchname}
  8. Run git push (to put these changes on master)

We keep a git hook for master so no users but our build can checkin to master. How do we do this with circle CI though? (we used to do this with jenkins so that master was always a successful solid build except for flaky tests of course).


Rollout of pipelines functionality

Rollout of pipelines functionality

$
0
0

Hi Matt,

I’m sorry to hear that you have had issues upgrading from config version 2 to 2.1. I’m on the team that implemented the 2.1 config, and I’d like to share some of the context around the breaking changes that we made.

One thing to note is that config version 2.1 is opt-in, and is not required for pipelines.

We arrived at what is now “config version 2” after a bunch of iteration, where we built the 2.0 platform using early versions of the 2.0 config ourselves, and later in a closed beta with some partners. All the time we were iterating on the config format. When we finally called CircleCI 2.0 “released”, the config file format had a sizeable amount of backwards compatibility shims in it under the hood, from where we had iterated on the config schema. This lead to us having some really poor error messages for invalid config, because we had some hand-written schema checks which allowed a lot of questionable yaml to build. The 2.0 release was iterative, where we on-boarded more and more customers over time, with a closed beta, and open beta, etc, so we never had a single “release” where we would have been able to define the “finished” config schema (and break the builds of customers who had adopted 2.0 early).

When we started the project to add the features that we added in config version 2.1 (commands, parameters, orbs, etc), we found that we couldn’t add these new features into config 2.0 in a manner which was backwards compatible without compromising the design, or in a way that produced useful error messages. We decided to make a clean break, and bump the config version to 2.1.

Config version 2.1 is a lot more strict about what it accepts than 2.0 was, especially in regards to additional keys that are not expected. In particular, in config 2.0 you could add extra keys nearly anywhere in the YAML document, and our parser would ignore them. This lead to cases where a typo would be silently ignored. When we looked at the data, we found that the resource_class was the most commonly misspelled key. The pitfall here is that if you add resource_class: large to your config file but you misspell resource, our config validation for 2.0 would ignore the key, and your job would run on the medium resource class.

The other area that we tightened up was the names that we allow – we restricted the character set and length of a bunch of fields in the config file. The one that has affected you here was job names. We added a lot of restrictions on the contents or orbs, since they are stored in a registry, passed through an API, processed in the command line tool, etc. Since jobs can be contained within orbs, we restricted what a job can be called, and the restriction is global, and affects all jobs in the config file.

So that’s the context :slight_smile:

In your case, do you know what the error message produced was? I’ve added a job with a : in the name, and when I run circleci config validate in the CLI tool I get the following:

marc@blaster ~/dev/circleci/circle $ circleci config validate
Error: ERROR IN CONFIG FILE:
[#/jobs/job-with-a-:-in-the-name] string [job-with-a-:-in-the-name] does not match pattern ^[A-Za-z][A-Za-z\s\d_-]*$

Did you get a similar error message? Echoing the regex back to the user as part of the error message is not the most clear way for us to convey the issue here. Do you have any thoughts on what error message that we could show to make it clear to you what the problem is?

Thanks,

Marc

Schema issues when trying to use persist_to_workspace

$
0
0

persist_to_workspace should be a key which maps to its arguments, e.g.

- persist_to_workspace:
    root: ./
    paths:
      - ./

-Gordon

Schema issues when trying to use persist_to_workspace

$
0
0

Isn’t that what I wrote in the config?

Schema issues when trying to use persist_to_workspace

$
0
0

No, your config has a single list item with several keys, in JSON it would look like:

{"persist_to_workspace": null,
 "root": "./",
 "paths": ["./"]}

It needs to look like:

{"persist_to_workspace": {"root": "./",
                          "paths": ["./"]}}

which is what you get from the extra level of YAML indentation

Hope this helps

-Gordon

Viewing all 14720 articles
Browse latest View live