#! 'Client' object has no attribute 'host'
1 messages · Page 1 of 1 (latest)
👋 are you running this within a module?
the dag variable in a module doesn't have a host function
I'm confused how to run dagger functions outside a module. If I write anything outside of dagger/src/neuralbey_cicd/main.py dagger commend does not see it anymore and is not listed in dagger functions.
i'm using python sdk
that's the thing, in modules, you need all the entrypoint functios to be declared in your module's main file
from there, your module can import other files and make the necessary calls it needs
@viscid sun is there any chance you can provide a concrete example of what you're trying to do here?
Then do I need to define a function outside the main to use dag.host() then import it and call it in the main.py
what i want to do is puch back a repo to git dag.container().from_("alpine").with_exec(["apk", "--no-cache", "add", "git", "openssh-client"]).with_unix_socket(sshAuthSock, dag.host().unix_socket(sshAuthSock)).with_env_variable(sshSockEnvName, sshAuthSock).with_file("~/.ssh/known_hosts", dag.host().file("~/.ssh/known_hosts")).with_directory("/src", self.gitops(source)).with_workdir("/src").with_exec([""])
Then run these commends:
git config --global user.email "habibvs123@protonmail.com"
git config --global user.name "habib"
git add guestbook-ui-deployment.yaml
git commit -m "CI Deploy to 2"
git push origin master
yes, that's correct
the way to do this is by sending the sshAuthSock in your function arguments