Migrate from AWS
This document provides an overview of how to migrate from AWS CodeCommit to CircleCI.
Tips provided by ImagineX Consulting |
Source control setup
If you are using AWS CodeCommit, you will first need to migrate your source code to GitHub, Bitbucket or GitLab. See the following for details on how to import your code:
GitHub Enterprise
Following are the steps required for using the git command line tool to import your code into GitHub Enterprise:
-
Create an empty repository on your GitHub Enterprise instance.
-
Create a bare clone of your external repository on your local machine, fetching all remote tags (refs/tags/*) and copying all remote branch heads (refs/heads/\*) directly to their corresponding local branch heads.
git clone https://external-host.com/extuser/repo.git --bare
-
Add your GitHub Enterprise repository as a remote reference in your local clone.
cd [repo-name] git remote add enterprise git@[hostname]:[owner]/[repo-name].git
-
Push all local references (refs/*) up to your remote GitHub Enterprise repository.
git push enterprise --mirror
Once you have imported your code into GitHub, Bitbucket or GitLab, you can start creating a project in CircleCI using the Getting Started guide.
Build configuration
Next, you will need to migrate your build configuration. On AWS CodeBuild, the build configuration is either defined in the web interface or in a file called buildspec.yml
in the root directory of your source code repository. If you use shell scripts to perform your build, you can reuse those scripts in CircleCI.
First, create a CircleCI build configuration file. In the root directory of your source code repository, create a folder named .circleci
and create a file in that folder named config.yml
. Next, follow the CircleCI documentation here to learn how to configure the config.yml
file.
The AWS CodeBuild and CircleCI configurations will be different. It may be helpful to have both AWS DevOps and CircleCI reference documentation open side-by-side to help with the conversion of the build steps:
Configuration comparison
Using Docker? Authenticating Docker pulls from image registries is recommended when using the Docker execution environment. Authenticated pulls allow access to private Docker images, and may also grant higher rate limits, depending on your registry provider. For further information see Using Docker authenticated pulls. |
AWS | CircleCI |
---|---|
Define a job that executes a single build step. | |
| |
Specify a Docker image to use for a job. | |
| |
Define a multi-stage build pipeline. Job1 and Job2 run concurrently. Once they are done, Job3 runs. Once Job3 is done, Job4 runs. An AWS CodeBuild project runs all commands sequentially. If you are running concurrent commands, you are probably using CodePipeline and multiple CodeBuild projects. | |
| |
Execute jobs on multiple platforms. An AWS CodePipeline project can target a single platform only. If you are targeting multiple platforms, you’re probably using CodePipeline and multiple CodeBuild projects. CircleCI provides executors for Docker, Linux and macOS that can be combined in a single build definition. | |
| |
Cache dependencies. | |
| |
For larger and more complex build files, we recommend moving over the build steps in phases until you get comfortable with the CircleCI platform. We recommend this order:
-
Execution of shell scripts and Docker compose files