Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to deploying the config version #143

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

djmb
Copy link
Collaborator

@djmb djmb commented Mar 22, 2023

If we don't supply a version when deploying we'll use the result of docker image ls to decide which image to boot. But that doesn't necessarily correspond to the one we have just built.

E.g. if you do something like:

mrsk deploy        # deploys git sha AAAAAAAAAAAAAA
git commit --amend # update the commit message
mrsk deploy        # deploys git sha BBBBBBBBBBBBBB

In this case running docker image ls will give you the same image twice (because the contents are identical) with tags for both SHAs but the image we have just built will not be returned first. Maybe the order is random, but it always seems to come second as far as I have seen.

i.e you'll get something like:

REPOSITORY    TAG              IMAGE ID       CREATED          SIZE
foo/bar       AAAAAAAAAAAAAA   6272349a9619   31 minutes ago   791MB
foo/bar       BBBBBBBBBBBBBB   6272349a9619   31 minutes ago   791MB

Since we already know what version we want to deploy from the config, let's just pass that through.

djmb and others added 2 commits March 22, 2023 16:14
If we don't supply a version when deploying we'll use the result of
docker image ls to decide which image to boot. But that doesn't
necessarily correspond to the one we have just built.

E.g. if you do something like:

```
mrsk deploy        # deploys git sha AAAAAAAAAAAAAA
git commit --amend # update the commit message
mrsk deploy        # deploys git sha BBBBBBBBBBBBBB
```

In this case running `docker image ls` will give you the same image
twice (because the contents are identical) with tags for both SHAs but
the image we have just built will not be returned first. Maybe the order
is random, but it always seems to come second as far as I have seen.

i.e you'll get something like:

```
REPOSITORY    TAG              IMAGE ID       CREATED          SIZE
foo/bar       AAAAAAAAAAAAAA   6272349a9619   31 minutes ago   791MB
foo/bar       BBBBBBBBBBBBBB   6272349a9619   31 minutes ago   791MB
```

Since we already know what version we want to deploy from the config,
let's just pass that through.
@dhh
Copy link
Member

dhh commented Mar 23, 2023

Couldn't we just get rid of the whole docker image ls stuff together too, then? If we're always passing a version?

`docker image ls` doesn't tell us what the latest deployed image is (e.g
if we've rolled back). Pull the latest image tag through to the server
so we can use it instead.
@djmb
Copy link
Collaborator Author

djmb commented Mar 23, 2023

If you do mrsk app boot or mrsk app exec I think you would want the most recently deployed version, not what you have locally.

With 1ed4a37 we pull the latest tag onto the hosts and use it instead - how does that sound?

@dhh
Copy link
Member

dhh commented Mar 24, 2023

Way nicer! Excellent.

@dhh dhh merged commit c89b771 into basecamp:main Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants