Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a brew formula for autopilot #31

Closed
roi-codefresh opened this issue May 2, 2021 · 17 comments · Fixed by #69 or #78
Closed

Add a brew formula for autopilot #31

roi-codefresh opened this issue May 2, 2021 · 17 comments · Fixed by #69 or #78
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@roi-codefresh
Copy link
Contributor

No description provided.

@roi-codefresh roi-codefresh added enhancement New feature or request help wanted Extra attention is needed labels May 2, 2021
@sestegra
Copy link
Contributor

Started here #69

@sestegra
Copy link
Contributor

test block must be defined in Homebrew formula.
Future proof test needs to be implemented with the CLI output.

Could I use as is the current default CLI output?

For instance, argocd formula is implementing the following.

test do
  assert_match "argocd controls a Argo CD server",
    shell_output("#{bin}/argocd --help")

  assert_match "argocd-util has internal utility tools used by Argo CD",
    shell_output("#{bin}/argocd-util --help")

  # Providing argocd with an empty config file returns the contexts table header
  touch testpath/"argocd-config"
  assert_match "CURRENT  NAME  SERVER\n",
    shell_output("#{bin}/argocd context --config ./argocd-config")
end

See https://github.com/Homebrew/homebrew-core/blob/40de9472bc82866b7220b821fa93c772a2270aef/Formula/argocd.rb#L31

@roi-codefresh roi-codefresh linked a pull request May 31, 2021 that will close this issue
@roi-codefresh
Copy link
Contributor Author

test block must be defined in Homebrew formula.
Future proof test needs to be implemented with the CLI output.

Could I use as is the current default CLI output?

For instance, argocd formula is implementing the following.

test do
  assert_match "argocd controls a Argo CD server",
    shell_output("#{bin}/argocd --help")

  assert_match "argocd-util has internal utility tools used by Argo CD",
    shell_output("#{bin}/argocd-util --help")

  # Providing argocd with an empty config file returns the contexts table header
  touch testpath/"argocd-config"
  assert_match "CURRENT  NAME  SERVER\n",
    shell_output("#{bin}/argocd context --config ./argocd-config")
end

See https://github.com/Homebrew/homebrew-core/blob/40de9472bc82866b7220b821fa93c772a2270aef/Formula/argocd.rb#L31

Can we check that the version command is functioning?

@sestegra
Copy link
Contributor

See argocd-autopilot version test

test do
  assert_match "#{version}",
    shell_output("#{bin}/argocd-autopilot version")
end

@roi-codefresh
Copy link
Contributor Author

LGTM
@noam-codefresh ?

@roi-codefresh
Copy link
Contributor Author

Thanks @sestegra! Once we are able to install with brew, would you like to add some instructions to the docs on how to do it?

@sestegra
Copy link
Contributor

sestegra commented May 31, 2021

@roi-codefresh The issue isn't closed yet.
As soon as a new version is released, I will submit the formula to Homebrew/homebrew-core
Then, I will update the docs as well.

@roi-codefresh roi-codefresh reopened this Jun 1, 2021
@roi-codefresh
Copy link
Contributor Author

@sestegra just created release v0.1.9 which includes your changes

@sestegra
Copy link
Contributor

sestegra commented Jun 1, 2021

PR submitted to homebrew-core
Homebrew/homebrew-core#78460

@sestegra
Copy link
Contributor

sestegra commented Jun 1, 2021

@roi-codefresh macOS for ARM64 can't be built.

/opt/homebrew/Cellar/go/1.16.4/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

See full log from https://github.com/Homebrew/homebrew-core/pull/78460/checks?check_run_id=2716944236

@sestegra
Copy link
Contributor

sestegra commented Jun 1, 2021

My guess is because of following line in hack/build.sh

-extldflags '-static' \

@roi-codefresh
Copy link
Contributor Author

Hey @sestegra, I've just merged a PR to remove our dependency on packr. Guessing you need a new release that includes this?

@sestegra
Copy link
Contributor

sestegra commented Jun 2, 2021

Hey @roi-codefresh, in fact, I need a new release with your update.

@roi-codefresh roi-codefresh linked a pull request Jun 2, 2021 that will close this issue
@roi-codefresh roi-codefresh reopened this Jun 2, 2021
@roi-codefresh
Copy link
Contributor Author

@sestegra v0.1.10 is now out :)

@sestegra
Copy link
Contributor

sestegra commented Jun 2, 2021

@roi-codefresh Great, I've updated the Homebrew formula. We need to wait for homebrew-core's maintainer to approve the PR.

@sestegra
Copy link
Contributor

sestegra commented Jun 3, 2021

✅ Done

Formula and bottles available on macOS: homebrew-core/Formula/argocd-autopilot.rb
Formula and bottle available on Linux: linuxbrew-core/Formula/argocd-autopilot.rb

@roi-codefresh
Copy link
Contributor Author

Amazing!
Thank you very much @sestegra 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
2 participants