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

feat: add latest tag #100

Merged
merged 14 commits into from
Dec 28, 2023
Merged

feat: add latest tag #100

merged 14 commits into from
Dec 28, 2023

Conversation

DanilaKazakevich
Copy link
Contributor

Summary

Task: https://saritasa.atlassian.net/browse/SD-373

Why?

It is needed for xrayimg project. We have develepment env on the project placed on PC in Krasnoyarsk office -> Hyper-V server -> Virtual machine -> docker compose. Also all future production servers will be created with in same way (VM and docker compose is 100%).

We deploy the new version of backend on the servers with watchtower. It checks AWS ECR for the new uploaded image and update running containers. The easiest way to do it is :latest tag. It is here: https://github.com/saritasa-nest/xrayimg-infra-aws/blob/feature/local-server/private/docker-compose.yaml#L12

How?

We can add both tags ${env}-${commit_hash} (i.e. :dev-dsjfh43) and :latest on the built image in tekton-pipelines.

It isn't default behaviour now. You must enable this by adding below code in triggerBinding:

        triggerBinding:
          - name: docker_registry_repository
            value: 833737135757.dkr.ecr.us-east-2.amazonaws.com/nmbl/staging/frontend
....
....
          - name: add_tag_latest
            value: 'true'

By default we will continue to push images only in ${env}-${commit_hash} format!

Exmaples:

NOTE: I decided to test it on ygm staging to don't affect rocks cluster, so don't be confused with it.

Output from buildpacks step:

Saving 190499200307.dkr.ecr.us-west-2.amazonaws.com/ygm/staging/backend:staging-802d5f2...
*** Images (sha256:9e15b5041fec79448e25948503ddd68ee8563d7d3bacacb4f3f20c1e5a23b891):
      190499200307.dkr.ecr.us-west-2.amazonaws.com/ygm/staging/backend:staging-802d5f2
      190499200307.dkr.ecr.us-west-2.amazonaws.com/ygm/staging/backend:latest

Some images:
How parameter looks:
latest_tag
How images look in ECR:
2023-11-21_12-56

luciano-buono
luciano-buono previously approved these changes Nov 21, 2023
Copy link
Contributor

@kseniyashaydurova kseniyashaydurova left a comment

Choose a reason for hiding this comment

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

@DanilaKazakevich pls make minor improvements)

charts/tekton-apps/templates/general/triggerbindings.yaml Outdated Show resolved Hide resolved
charts/tekton-apps/Chart.yaml Show resolved Hide resolved
populov
populov previously approved these changes Nov 23, 2023
Copy link
Contributor

@kseniyashaydurova kseniyashaydurova left a comment

Choose a reason for hiding this comment

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

@DanilaKazakevich pls generate docs in the correct way.

udaltsovra
udaltsovra previously approved these changes Nov 28, 2023
populov
populov previously approved these changes Nov 28, 2023
luciano-buono
luciano-buono previously approved these changes Dec 6, 2023
udaltsovra
udaltsovra previously approved these changes Dec 7, 2023
charts/terraform-pod/README.md Show resolved Hide resolved
charts/terraform-pod/README.md Outdated Show resolved Hide resolved
populov
populov previously approved these changes Dec 7, 2023
@DanilaKazakevich DanilaKazakevich merged commit 9d6a417 into main Dec 28, 2023
6 of 7 checks passed
@MikhailKorol-saritasa MikhailKorol-saritasa deleted the feature/add-latest-tag branch January 8, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.