CircleCI-Public / orb-tools-orb

Various tools for authoring and publishing CircleCI orbs
https://circleci.com/orbs/registry/orb/circleci/orb-tools
MIT License
51 stars 76 forks source link

Help with migration script: sed errors #143

Closed mathomp4 closed 2 years ago

mathomp4 commented 2 years ago

Orb version:

Not sure how to answer...I guess 10 → 11??

What happened:

I was trying to follow the Migration Guide and got to the "run migrate.sh" step and:

❯ bash migrate.sh
Namespace: geos-esm
Orb name: circleci-tools
Context name: orb-publishing
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   997  100   997    0     0   3720      0 --:--:-- --:--:-- --:--:--  3706
sed: can't read s/<namespace>/geos-esm/g: No such file or directory
sed: can't read s/<orb-name>/circleci-tools/g: No such file or directory
sed: can't read s/<publishing-context>/orb-publishing/g: No such file or directory
sed: can't read s/<namespace>/geos-esm/g: No such file or directory
sed: can't read s/<orb-name>/circleci-tools/g: No such file or directory
sed: can't read s/<publishing-context>/orb-publishing/g: No such file or directory
Successfully upgraded config files.
You must now open "test-deploy.yml" and add your integrations tests.
Docs: https://circleci.com/docs/2.0/testing-orbs/#integration-testing

When complete, delete the '.bak' files in the .circleci directory.
Commit your changes and the next version of your orb will be published when a tag is created.

And if I look in the produced .circleci/config.yml file:

      - orb-tools/publish:
          orb-name: <namespace>/<orb-name>
          vcs-type: << pipeline.project.type >>
          requires:
            [orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check]
          # Use a context to hold your publishing token.
          context: <publishing-context>
          filters: *filters

I'm guessing those should have been sed'd to what I provided? (Note: I'm not even sure if what I provided was correct. I'm not an Orb expert...

Expected behavior:

I'm guessing no sed errors?

Additional Information:

I am on a macOS machine and perhaps this script assumes GNU sed? I mean, I do have GNU sed from Homebrew and I've symlinked my sed to be the gsed from Homebrew:

❯ which sed
/Users/mathomp4/bin/sed
❯ sed --version
sed (GNU sed) 4.8
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.

This sed program was built without SELinux support.

GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.

But maybe the script assumes something? Or it's picking up the horrible BSD sed that macOS comes with?

KyleTryon commented 2 years ago

Or it's picking up the horrible BSD sed that macOS comes with?

I believe it should work but this is likely it.

Would you be willing to brew install gnused?

sed --version
gsed (GNU sed) 4.8
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.

This sed program was built without SELinux support.

GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.

Perhaps we should detect and warn on the version

mathomp4 commented 2 years ago

I'm closing this as I just tried the migrate script and it worked. Of course, I now need to figure out what to do after it ran...so confused. but that's for another issue!