Back

[SOLVED] Deploying swift function to self hosted environment

  • 0
  • Self Hosted
  • Functions
Triple Gelato
22 Nov, 2023, 21:19

Are there any guides regarding deploying Swift functions to self hosted appwrite docker? Would be massively helpful.

The one I found is out of date https://dev.to/appwrite/create-and-run-welcome-email-appwrite-cloud-function-with-swift-2m1h

TL;DR
User encountered an issue with deploying a Swift function to a self-hosted environment. They tried deploying with the code in the 'starter' template and it succeeded. The only significant difference was the folder structure and package name. User has attached the folder structure and settings. Other users ask for version info and provide documentation links. The issue was resolved by following the structure in the 'starter' template. Solution: Follow the structure in the 'starter' template and try deploying the function.
Drake
22 Nov, 2023, 22:14

deploying to self-hosted vs cloud should be pretty much the same, so you'd follow the same docs: https://appwrite.io/docs/products/functions/deployment

Triple Gelato
23 Nov, 2023, 16:56

I've tried with official doc a simple function results in error when deploying

Drake
23 Nov, 2023, 17:41

what version of appwrite do you have?

Triple Gelato
23 Nov, 2023, 22:02

1.4.9

Drake
24 Nov, 2023, 00:32

What's your folder structure. How did you deploy and what are your function path and entrypoint settings?

Triple Gelato
24 Nov, 2023, 08:27

I used manual deployment and uploaded code.tar.gz as attachement, folder structure as screenshot. Also included settings on appwrite.

Meldiron
24 Nov, 2023, 11:27

Comparing with our starter template: https://github.com/appwrite/templates/blob/main/swift/starter/Sources/index.swift

The only significant difference is nesting (folder phone), and package name in Package.swift. Can you please try to copy what we do in starter? Once we have your function up and running, we can better spot what exact change is causing this fail, and implement a proper fix

Triple Gelato
24 Nov, 2023, 22:59

After I trying with the code in starter the deployment is successful. However tried deploying again with the previous structure and it also succeeded

Drake
25 Nov, 2023, 03:10

So we can mark this as solved now?

Triple Gelato
25 Nov, 2023, 09:51

Yes

fafa
25 Nov, 2023, 14:36

Heyo, please mark this as solved by adding [Solved] at the beginning of the title, thanks!

Drake
25 Nov, 2023, 20:47

[SOLVED] Deploying swift function to self hosted environment

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more