github.com/ratanraj/packer@v1.3.2/website/source/guides/packer-on-cicd/upload-images-to-artifact.html.md (about)

     1  ---
     2  layout: guides
     3  sidebar_current: guides-packer-on-cicd-upload-image-to-artifact-store
     4  page_title: Upload VirtualBox Image to S3
     5  ---
     6  
     7  # Upload VirtualBox Image to S3
     8  
     9  Once the image is generated it will be used by other parts of your operations
    10  workflow. For example, it is common to build VirtualBox images with Packer to
    11  be used as base boxes in Vagrant.
    12  
    13  The exact process for uploading images depends on the artifact store and CI
    14  system you use. TeamCity provides a [Build
    15  Artifacts](https://confluence.jetbrains.com/display/TCD9/Build+Artifact)
    16  feature which can be used to store the newly generated image. Other CI/CD
    17  services also have similar build artifacts features built in, like [Circle CI
    18  Build Artifacts](https://circleci.com/docs/2.0/artifacts/). In addition to the
    19  built in artifact stores in CI/CD tools, there are also dedicated universal
    20  artifact storage services like
    21  [Artifactory](https://confluence.jetbrains.com/display/TCD9/Build+Artifact).
    22  All of these are great options for image artifact storage.
    23  
    24  The following example uses TeamCity and Amazon S3.
    25  
    26  ## Example: Uploading to S3 in a TeamCity Build
    27  
    28  On the agent machine responsible for building images, install the [AWS Command
    29  Line Tool](https://aws.amazon.com/cli/). Since this is a one-time operation,
    30  this can be incorporated into the initial agent provisioning step when
    31  installing other dependencies. The AWS Command Line tool may require installing
    32  additional
    33  [dependencies](http://docs.aws.amazon.com/cli/latest/userguide/installing.html)
    34  prior.
    35  
    36  ```shell
    37  pip install awscli
    38  ```
    39  
    40  In your build configuration in TeamCity Server, add an additional **Build Step:
    41  Command Line** and set the **Script content** field to the following:
    42  
    43  ```shell
    44  awscli s3 cp . s3://bucket/ --exclude “*” --include “*.ovf"
    45  ```