Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

add packaging guide #12

Merged
merged 7 commits into from
May 18, 2020
Merged

add packaging guide #12

merged 7 commits into from
May 18, 2020

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented May 16, 2020

motivation: provide guidance around how an aplication can be packaged for deployments

changes: add packaging.md wih instructions for docker, tarball and source distributions

motivation: provide guidance around how an aplication can be packaged for deployments

changes: add packaging.md wih instructions for docker, tarball and source distributions
tomerd and others added 2 commits May 16, 2020 09:33
Co-authored-by: Yim Lee <yim_lee@apple.com>
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall :) Had some questions / ideas... perhaps overdoing it, depends how polished we want these to be.

# Packaging Applications for Deployment

Once an application is built for production, it still needs to be packaged before it can be deployed to servers. There are several strategies for packaging Swift applications for deployment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question about how to host those guides really... Are we intending to keep those guides as md files, or is this until we have a better place for them?

Normally it'd be nice to have a ToC here so one can skim what options there are and jump to one, rather than scroll the document IMO. It'd be a bit nicer if those are to be official guides if we could present them "well" 🤔

Just a thought, back to reviewing the content

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point @ktoso, once we have enough content I think some of these will go into swift.org.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Let's stick to simple .md until then, then 👍

To test the local image use the `docker run` command, .e.g.:

```bash
$ docker run <my-app>:<my-app-version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest that we amend a bit the style we do code snippets with user filled in things a bit?

It's nice if before we start there's a

export MY_APP=<my-app> 
export MY_APP_VERSION=<...>

and then in all snippets we use those; this allows people to set their values and copy paste the steps if they want to.

(as silly as it is to encourage copy paste i think it helps some folks and eases the barrier to try things out).

Just an idea

Co-authored-by: Yim Lee <yim_lee@apple.com>
Co-authored-by: Konrad `ktoso` Malawski <konrad.malawski@project13.pl>
@tomerd
Copy link
Contributor Author

tomerd commented May 18, 2020

/cc @swift-server/sswg

tomerd and others added 3 commits May 18, 2020 12:09
Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
Copy link
Contributor

@weissi weissi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, LGTM!

-v "$PWD:/workspace" \
-w /workspace \
swift:5.2-bionic \
/bin/bash -cl "swift build -c release"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/bin/bash -cl "swift build -c release"
/bin/bash -xcl "swift -version && swift build -c release"

feel free to ignore but I prefer to always see the version number as that's often important.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like -x because it prints all the random env variables that may be important when debugging stuff (but it does make the output a little bit uglier ofc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sample output:

$ jw-docker-swift-5.2 /bin/bash -xcl "swift -version && swift build -c release"
+ '[' '' ']'
+ '[' -d /etc/profile.d ']'
+ for i in /etc/profile.d/*.sh
+ '[' -r /etc/profile.d/01-locale-fix.sh ']'
+ . /etc/profile.d/01-locale-fix.sh
+++ /usr/bin/locale-check C.UTF-8
++ eval
+ unset i
+ '[' /bin/bash ']'
+ '[' -f /root/.bashrc ']'
+ . /root/.bashrc
++ '[' -z '' ']'
++ return
+ mesg n
+ true
+ swift -version
Swift version 5.2.3 (swift-5.2.3-RELEASE)
Target: x86_64-unknown-linux-gnu
+ swift build -c release
[39/39] Linking NIOPerformanceTester

@tomerd tomerd merged commit d099c39 into swift-server:master May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants