Open stv-io opened 1 year ago
For anyone in a similar situation as me, this is a copy-paste version of what I did to build and expose the commands.
docker run -it -v $(pwd):/builds --entrypoint bash golang:1.13.15
# within the container
git clone https://github.com/CheckPointSW/terraform-provider-checkpoint.git $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-checkpoint
make fmt
make build
export GOOS=darwin
export GOARCH=amd64
cd commands/publish/
go build publish.go
mv publish /builds/
cd ../logout/
go build logout.go
mv logout /builds/
cd ../discard/
go build discard.go
mv discard /builds/
cd ../approve_session/
go build approve_session.go
mv approve_session /builds/
cd ../reject_session/
go build reject_session.go
mv reject_session /builds/
cd ../submit_session/
go build submit_session.go
mv submit_session /builds/
cd ../install_policy/
go build install_policy.go
mv install_policy /builds/
Hi @stv-io, Thanks for suggesting this feature. Currently it's not supported but we might be able to add this logic as part of the repository CI/CD workflows. We encourage our community to contribute and take part in developing the provider since it's open source project so if you want, you can share possible changes in PR and we will review it.
Regards, Roy
Currently, and according to the docs, for the Post Apply/Destroy commands (publish / logout / discard etc) as documented in the provider, a few commands / binaries are required.
Given some of the commands are built with older versions of golang (1.13), it is not easy to obtain a version of these.
Although there are probably better long term ways of managing this, a quick short term improvement would be to publish and release these binaries, for the more common developer architectures and platforms.
As an example, I myself, on mac os intel, have golang 1.20 installed and will need to go through the process of running the build using docker and moving a lot of things around