Answers: <blockquote>
  <p>how can I automate this process? I have an script to push dockerimage to AWS through ecr.</p>
  </blockquote>
  <p>You are on the right track. Yes, this should be an automated process from Git push or when someone merge a Pull Request.</p>
  <p>An important aspect of this is that this &quot;automated process&quot; should be on a dedicated system - such that it is <em>repeatable</em> in a <em>consistent</em> way. Typically this is called a &quot;Continuous Integration Server&quot; or just &quot;Build Server&quot;.</p>
  <p>Some popular choices for this kind of process:</p>
  <ul>
  <li><a href="https://www.jenkins.io/" rel="nofollow noreferrer">Jenkins</a> - old but popular</li>
  <li><a href="https://tekton.dev/" rel="nofollow noreferrer">Tekton</a> - Kubernetes native - but still in development</li>
  <li><a href="https://github.com/features/actions" rel="nofollow noreferrer">GitHub Actions</a> - probably most interesting if your Git repo is on GitHub</li>
  <li><a href="https://bitbucket.org/product/features/pipelines" rel="nofollow noreferrer">Bitbucket Pipelines</a> - probably most interesting if your Git repo is Bitbucket</li>
  <li><a href="https://aws.amazon.com/codebuild/" rel="nofollow noreferrer">AWS CodeBuild</a> - limited but may be interesting if you use AWS</li>
  <li><a href="https://docs.gitlab.com/ee/ci/" rel="nofollow noreferrer">GitLab CI</a> - probably most interesting if your Git repo is on GitLab</li>
  </ul>
  <p>What you need to do is to configure your Git repository system (e.g. GitHub, Bitbucket, Gitlab or AWS CodeCommit) to initiate Pipelines on the Build system (a product of those listed above)</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-03-22T08:10:31.543Z
Answers: Thank u very much for that answer :) It's really helpfull!
Answers: martin
Answers: CC BY-SA 4.0
Answers: 2021-03-21T20:23:44.037Z
Answers: 2021-03-21T20:23:44.037Z
Answers: Jonas
Body: <p>I'm new at DevOps, and I looking for solution to my problem.</p>
  <p>I have a private code repository where I have a some Flask apps in one of many folders. Example of structure:</p>
  <pre><code>- Project
  -- Django Apps
  --- django1_dir
  --- django2_dir
  --- django3_dir
  -- Flask Apps
  --- flaskApp_dir1 (dockerfile inside)
  --- flaskApp_dir2 (dockerfile inside)
  --- flaskApp_dir3 (dockerfile inside)
  </code></pre>
  <p>And I have a configured cluster on kubernetes on AWS instance. And a private docker repo. When I want to load new version of my flaskApp to cluster I need:</p>
  <ol>
  <li>Someone modify flaskApp on repo</li>
  <li>I need pull repo</li>
  <li>Locally build a new image based on new dockerfile</li>
  <li>Push app to repo</li>
  <li>Manually push docker image with new APPVersion to AWS trough ecr</li>
  <li>Then kubernetes change image to new version</li>
  </ol>
  <p>My question is:</p>
  <p>how can I automate this process? I have an script to push dockerimage to AWS through ecr.
  It is possible to create some kind of trigger that would work in such a way:</p>
  <ol>
  <li>Someone do a commit</li>
  <li>Script building a new docker image and push it to AWS automaticly</li>
  </ol>
  <p>I read something about it, but as I said I'm totaly new in DevOps so any hint will be awesome.
  Now I have configured kubernetes, that aws instances and repo for docker images. I read about git hooks, flux and some other solutions but it's quite unclear for me so I looking for best practice for that problem. I wouldn't particularly want to install huge new tools either.</p>
  <p>So maybe any hits or keywords I could get hooked on?</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-03-21T20:23:50.203Z
Comments: The term you are looking for is Continuous Deployment (CD)
Comments: Tom Knapen
Tags: <docker><kubernetes><automation>
Title: Auto build and upload to AWS new docker image after commit in repo
UserDisplayName: martin
ThreadText: # Auto build and upload to AWS new docker image after commit in repo
  
  (Asked by: username_0 on 2021-03-21)
  
  I'm new at DevOps, and I looking for solution to my problem.
  
  I have a private code repository where I have a some Flask apps in one of many folders. Example of structure:
  
  ```
  - Project
  -- Django Apps
  --- django1_dir
  --- django2_dir
  --- django3_dir
  -- Flask Apps
  --- flaskApp_dir1 (dockerfile inside)
  --- flaskApp_dir2 (dockerfile inside)
  --- flaskApp_dir3 (dockerfile inside)
  
  ```
  
  And I have a configured cluster on kubernetes on AWS instance. And a private docker repo. When I want to load new version of my flaskApp to cluster I need:
  
  1. Someone modify flaskApp on repo
  2. I need pull repo
  3. Locally build a new image based on new dockerfile
  4. Push app to repo
  5. Manually push docker image with new APPVersion to AWS trough ecr
  6. Then kubernetes change image to new version
  
  My question is:
  
  how can I automate this process? I have an script to push dockerimage to AWS through ecr.
  It is possible to create some kind of trigger that would work in such a way:
  
  1. Someone do a commit
  2. Script building a new docker image and push it to AWS automaticly
  
  I read something about it, but as I said I'm totaly new in DevOps so any hint will be awesome.
  Now I have configured kubernetes, that aws instances and repo for docker images. I read about git hooks, flux and some other solutions but it's quite unclear for me so I looking for best practice for that problem. I wouldn't particularly want to install huge new tools either.
  
  So maybe any hits or keywords I could get hooked on?
  
  **Tags:** docker, kubernetes, automation
  
  > **Comments:**
  > **username_1**: The term you are looking for is Continuous Deployment (CD)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-03-21. Score: 2 | Accepted answer
  
  > how can I automate this process? I have an script to push dockerimage to AWS through ecr.
  
  You are on the right track. Yes, this should be an automated process from Git push or when someone merge a Pull Request.
  
  An important aspect of this is that this "automated process" should be on a dedicated system - such that it is *repeatable* in a *consistent* way. Typically this is called a "Continuous Integration Server" or just "Build Server".
  
  Some popular choices for this kind of process:
  
  * [Jenkins](https://www.jenkins.io/) - old but popular
  * [Tekton](https://tekton.dev/) - Kubernetes native - but still in development
  * [GitHub Actions](https://github.com/features/actions) - probably most interesting if your Git repo is on GitHub
  * [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) - probably most interesting if your Git repo is Bitbucket
  * [AWS CodeBuild](https://aws.amazon.com/codebuild/) - limited but may be interesting if you use AWS
  * [GitLab CI](https://docs.gitlab.com/ee/ci/) - probably most interesting if your Git repo is on GitLab
  
  What you need to do is to configure your Git repository system (e.g. GitHub, Bitbucket, Gitlab or AWS CodeCommit) to initiate Pipelines on the Build system (a product of those listed above)
  
  > **Comments:**
  > **username_0**: Thank u very much for that answer :) It's really helpfull!  
  
  ---
  
  