winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.04k stars 196 forks source link

default plugin to use when compiling to a specific target #5292

Open ekeren opened 10 months ago

ekeren commented 10 months ago

Use Case

I want all my tf-aws compilation to use TF backend plugin.

Proposed Solution

Some ~/.wing/ configuration that defines default plugins

Implementation Notes

No response

Component

CLI

Community Notes

ekeren commented 10 months ago

Created a small workaround

Added an function that masks wing command inside my ~/.zshrc that adds -t ~/.wing/plugin.static-backend.js if tf-aws is found on the wing command parameters

# ~/.zshrc
wing(){
if echo "$*" | grep tf-aws ; then
  echo plugin.static-backend.js plugin added
  command wing $* -t ~/.wing/plugin.static-backend.js
else
  command wing $*
fi
}

Followed https://www.winglang.io/docs/guides/terraform-backends for the tf backend instructions

Chriscbr commented 10 months ago

Related: https://github.com/winglang/wing/issues/1792

(edit: fixed link)

ekeren commented 10 months ago

Related: https://github.com/winglang/wing/issues/5292

You probably mean a different one