mirror of
https://github.com/semaphoreci/book-cicd-docker-kubernetes.git
synced 2026-02-14 15:59:50 +00:00
make Markdown footnotes and correct their urls
This commit is contained in:
@@ -88,10 +88,12 @@ Pipelines are represented in Workflow Builder as big gray boxes. Pipelines organ
|
||||
|
||||
**Agent**
|
||||
|
||||
The agent is the combination of hardware and software that powers the pipeline. The *machine type* determines the amount of CPUs and memory allocated to the virtual machine. The operating system is controlled by the *Environment Type* and *OS Image* settings.
|
||||
The agent is the combination of hardware and software that powers the pipeline. The *machine type* determines the amount of CPUs and memory allocated to the virtual machine[^vm-types]. The operating system is controlled by the *Environment Type* and *OS Image* settings.
|
||||
|
||||
The default machine is called `e1-standard-2` and has 2 CPUs, 4 GB RAM, and runs a custom Ubuntu 18.04 image.
|
||||
|
||||
[^vm-types]: To see all the available machines, go to <https://docs.semaphoreci.com/ci-cd-environment/machine-types>
|
||||
|
||||
**Jobs and Blocks**
|
||||
|
||||
Blocks and jobs define what to do at each step. Jobs define the commands that do the work. Blocks contain jobs with a common objective and shared settings.
|
||||
@@ -108,7 +110,9 @@ At this point, you should be seeing the Workflow Builder with the Docker Build s
|
||||
|
||||
{ width=95% }
|
||||
|
||||
Each line on the job is a command to execute. The first command in the job is `checkout`, which is a built-in script that clones the repository at the correct revision. The next command, `docker build`, builds the image using our `Dockerfile`.
|
||||
Each line on the job is a command to execute. The first command in the job is `checkout`, which is a built-in script that clones the repository at the correct revision[^sem-toolbox]. The next command, `docker build`, builds the image using our `Dockerfile`.
|
||||
|
||||
[^sem-toolbox]: You can find the complete Semaphore toolbox at <https://docs.semaphoreci.com/reference/toolbox-reference>
|
||||
|
||||
Replace the contents of the job with the following commands:
|
||||
|
||||
@@ -128,7 +132,9 @@ Each line has its purpose:
|
||||
- Line 4 builds a newer version of the image using the latest code.
|
||||
- Line 5 pushes the new image to the registry.
|
||||
|
||||
The perceptive reader will note that we introduced special environment variables; these come predefined in every job. The variables starting with `SEMAPHORE_REGISTRY_*` are used to access the private registry. Also, we’re using `SEMAPHORE_WORKFLOW_ID`, which is guaranteed to be unique for each run, to tag the image.
|
||||
The perceptive reader will note that we introduced special environment variables; these come predefined in every job[^environment]. The variables starting with `SEMAPHORE_REGISTRY_*` are used to access the private registry. Also, we’re using `SEMAPHORE_WORKFLOW_ID`, which is guaranteed to be unique for each run, to tag the image.
|
||||
|
||||
[^environment]: The full environment reference can be found at <https://docs.semaphoreci.com/ci-cd-environment/environment-variables>
|
||||
|
||||
{ width=95% }
|
||||
|
||||
@@ -167,7 +173,9 @@ docker run --net=host -it $SEMAPHORE_REGISTRY_URL/semaphore-demo-cicd-kubernetes
|
||||
docker run --net=host -it $SEMAPHORE_REGISTRY_URL/semaphore-demo-cicd-kubernetes:$SEMAPHORE_WORKFLOW_ID npm run migrate
|
||||
```
|
||||
|
||||
This job tests two things: that the container connects to the database (`ping`) and that it can create the tables (`migrate`). Obviously, we’ll need a database for this to work; fortunately, we have `sem-service`, which lets us start database engines like MySQL, Postgres, or MongoDB with a single command.
|
||||
This job tests two things: that the container connects to the database (`ping`) and that it can create the tables (`migrate`). Obviously, we’ll need a database for this to work; fortunately, we have `sem-service`, which lets us start database engines like MySQL, Postgres, or MongoDB with a single command[^sem-service].
|
||||
|
||||
[^sem-service]: For the complete list of services sem-service can manage check: <https://docs.semaphoreci.com/ci-cd-environment/sem-service-managing-databases-and-services-on-linux/>
|
||||
|
||||
Finally, add a third job called “Integration test” and type these commands:
|
||||
|
||||
|
||||
@@ -318,21 +318,3 @@ You have learned how to put together the puzzle of CI/CD, Docker, and Kubernetes
|
||||
- How to scale deployments and how to recover when things don’t go as planned.
|
||||
|
||||
Each of the pieces had its role: Docker brings portability, Kubernetes adds orchestration, and Semaphore CI/CD drives the test and deployment process.
|
||||
|
||||
## Footnotes
|
||||
|
||||
1. The full pipeline reference can be fount at <https://docs.semaphoreci.com/article/50-pipeline-yaml>
|
||||
|
||||
2. To see all the available machines, go to <https://docs.semaphoreci.com/article/20-machine-types>
|
||||
|
||||
3. For more details on the Ubuntu image see: <https://docs.semaphoreci.com/article/32-ubuntu-1804-image>
|
||||
|
||||
4. You can find the full toolbox reference here: <https://docs.semaphoreci.com/article/54-toolbox-reference>
|
||||
|
||||
5. sem-service can start a lot of popular database engines, for the full list check: <https://docs.semaphoreci.com/article/132-sem-service-managing-databases-and-services-on-linux>
|
||||
|
||||
6. The full environment reference can be found at <https://docs.semaphoreci.com/article/12-environment-variables>
|
||||
|
||||
7. For more details on secrets consult: <https://docs.semaphoreci.com/article/66-environment-variables-and-secrets>
|
||||
|
||||
8. For more information on pipelines check <https://docs.semaphoreci.com/article/67-deploying-with-promotions>
|
||||
|
||||
Reference in New Issue
Block a user