You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docs): update docs and prompt to emphasize pushing of necessary files (#1981)
Previously, only the buildspec.yml needed to be added to the source repo in order to build a pipeline. But now the buildspec checks the pipeline manifest to see which environment stages to deploy to (and only upgrades those envs), so both files (and `.workspace`)need to be checked into the user's repo. This updates docs and CLI prompts to reflect that change.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
"Commit and push the generated buildspec and manifest file.",
216
-
fmt.Sprintf("Run %s to deploy your pipeline for the repository.", color.HighlightCode("copilot pipeline update")),
215
+
fmt.Sprintf("Commit and push the %s, %s, and %s files of your %s directory to your repository.", color.HighlightResource("buildspec.yml"), color.HighlightResource("pipeline.yml"), color.HighlightResource(".workspace"), color.HighlightResource("copilot")),
216
+
fmt.Sprintf("Run %s to create your pipeline.", color.HighlightCode("copilot pipeline update")),
217
217
}
218
218
}
219
219
@@ -544,7 +544,9 @@ func (o *initPipelineOpts) createPipelineManifest() error {
544
544
manifestMsgFmt="Pipeline manifest file for %s already exists at %s, skipping writing it.\n"
@@ -55,7 +55,7 @@ This won't create your pipeline, but it will create some local files that will b
55
55
56
56
### Step 2: Updating the Pipeline manifest (optional)
57
57
58
-
Just like your service has a simple manifest file, so does your pipeline. After you run `pipeline init`, two files are created: `pipeline.yml` and `buildspec.yml`, both in your `copilot/` directory. If you poke in, you'll see a file that looks something like this (for a service called "api-frontend" with two environments, "test" and "prod"):
58
+
Just like your service has a simple manifest file, so does your pipeline. After you run `pipeline init`, two files are created: `pipeline.yml` and `buildspec.yml`, both in your `copilot/` directory. If you poke in, you'll see that the `pipeline.yml` looks something like this (for a service called "api-frontend" with two environments, "test" and "prod"):
59
59
60
60
```yaml
61
61
# This YAML file defines the relationship and deployment ordering of your environments.
@@ -93,27 +93,31 @@ stages:
93
93
94
94
There are 3 main parts of this file: the `name` field, which is the name of your CodePipeline, the `source` section, which details the repository and branch to track, and the `stages` section, which lists the environments you want this pipeline to deploy to. You can update this anytime, but you must run `copilot pipeline update` afterwards.
95
95
96
-
Typically, you'll update this file if you add new environments you want to deploy to, or want to track a different branch.
96
+
Typically, you'll update this file if you add new environments you want to deploy to, or want to track a different branch. The pipeline manifest is also where you may add a manual approval step before deployment or commands to run tests (see "Adding Tests," below) after deployment.
97
97
98
98
### Step 3: Updating the Buildspec (optional)
99
99
100
100
Along with `pipeline.yml`, the `pipeline init` command also generated a `buildspec.yml` file in the `copilot/` directory. This contains the instructions for building and publishing your service. If you want to run any additional commands, besides `docker build`, such as unit tests or style checkers, feel free to add them to the buildspec's `build` phase.
101
101
102
102
When this buildspec runs, it pulls down the version of Copilot which was used when you ran `pipeline init`, to ensure backwards compatibility.
103
103
104
-
### Step 4: Creating your Pipeline
104
+
### Step 4: Pushing New Files to your Repository
105
105
106
-
Now that your `pipeline.yml` and `buildspec.yml` are created, check them in and push them to your repository. The `buildspec.yml` is needed for your pipeline's `build` stage to run successfully. Once you've done that, to actually create your pipeline run:
106
+
Now that your `pipeline.yml`, `buildspec.yml`, and `.workspace` files have been created, add them to your repository. These files in your `copilot/` directory are required for your pipeline's `build` stage to run successfully.
107
+
108
+
### Step 5: Creating your Pipeline
109
+
110
+
Here's the fun part! Run:
107
111
108
112
`copilot pipeline update`
109
113
110
-
This parses your `pipeline.yml`, creates a CodePipeline in the same account and region as your project and kicks off a pipeline execution. Log into the AWS Console to watch your pipeline go.
114
+
This parses your `pipeline.yml`, creates a CodePipeline in the same account and region as your project and kicks off a pipeline execution. Log into the AWS Console to watch your pipeline go, or run `copilot pipeline status` to check in on its execution.
Of course, one of the most important parts of a pipeline is the automated testing. To add your own test commands, include the commands you'd like to run after your deploy step in the `test_commands` section. If all the commands succeed, your change is promoted to the next stage.
120
+
Of course, one of the most important parts of a pipeline is the automated testing. To add tests, such as integration or end-to-end tests, that run after a deployment stage, include those commands in the `test_commands` section. If all the tests succeed, your change is promoted to the next stage.
117
121
118
122
Adding `test_commands` generates a CodeBuild project with the [aws/codebuild/amazonlinux2-x86_64-standard:3.0](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html) image - so most commands from Amazon Linux 2 (including `make`) are available for use.
0 commit comments