Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
fix: update dockerfile commands
Browse files Browse the repository at this point in the history
  • Loading branch information
arantespp committed Jun 15, 2021
1 parent 8664d19 commit 547ff16
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
5 changes: 4 additions & 1 deletion packages/cli/src/deploy/cicd/cicd.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export const getRepositoryImageBuilder = () => ({
'RUN yarn config set cache-folder /home/yarn-cache',

'RUN yarn install',

// Used in case of yarn.lock is modified.
'RUN git checkout -- yarn.lock',
].join('\n'),
},
},
Expand Down Expand Up @@ -248,7 +251,7 @@ export const getCicdTemplate = ({
s3,
taskEnvironment = [],
}: {
pipelines: Pipeline[];
pipelines?: Pipeline[];
cpu?: string;
memory?: string;
s3: {
Expand Down
3 changes: 3 additions & 0 deletions packages/website/carlin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const {
getCicdTemplate,
getRepositoryImageBuilder,
ECR_REPOSITORY_LOGICAL_ID,
REPOSITORY_ECS_TASK_DEFINITION_LOGICAL_ID,
} = require('carlin/dist/deploy/cicd/cicd.template');

const { getComment, getComments, toHtml } = require('./comments');
Expand Down Expand Up @@ -186,6 +187,8 @@ module.exports = () => {
carlinCicdRepositoryImageBuilderDockerfile: getRepositoryImageBuilder().Properties.Environment.EnvironmentVariables.find(
({ Name }) => Name === 'DOCKERFILE',
).Value['Fn::Sub'],
carlinCicdRepositoryEcsTaskDefinition: getCicdTemplate({ s3 })
.Resources[REPOSITORY_ECS_TASK_DEFINITION_LOGICAL_ID].Properties,
testsCoverageThreshold: yaml.dump(testsCoverageThreshold),
};
},
Expand Down
8 changes: 8 additions & 0 deletions packages/website/docs/commands/deploy-cicd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { cicdTemplateGetEcrRepositoryComment } from '../../.docusaurus/carlin/de
import { cicdTemplateGetRepositoryImageBuilderComment } from '../../.docusaurus/carlin/default/cicdTemplateGetRepositoryImageBuilderComment';
import { carlinCicdRepositoryImageBuilderBuildSpec } from '../../.docusaurus/carlin/default/carlinCicdRepositoryImageBuilderBuildSpec';
import { carlinCicdRepositoryImageBuilderDockerfile } from '../../.docusaurus/carlin/default/carlinCicdRepositoryImageBuilderDockerfile';
import { carlinCicdRepositoryEcsTaskDefinition } from '../../.docusaurus/carlin/default/carlinCicdRepositoryEcsTaskDefinition';

## Overview

Expand Down Expand Up @@ -115,6 +116,13 @@ The [Dockerfile](https://docs.docker.com/engine/reference/builder/) used to buil
{carlinCicdRepositoryImageBuilderDockerfile}
</CodeBlock>

### ECS Fargate Task

Once we have the image on registry, the deploymend also creates an [ECS Fargate](https://aws.amazon.com/fargate) task definition. This task receives commands and execute them in a Docker container using the repository image.
The code below shows that base task configuration.

<Template json={carlinCicdRepositoryEcsTaskDefinition} />

### CI/CD REST API

<InnerHTML html={cicdApiV1HandlerComment} />
16 changes: 8 additions & 8 deletions packages/website/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ import { testsCoverageThreshold } from '../.docusaurus/carlin/default/testsCover
## History

This framework has been built for the last years, since 2018, as helpers scripts that support deploying AWS cloud resources.
The first scripts were used to deploy CloudFormation templates as we've started performing numerous deployments along with staging, production, development... environments.
We created the first scripts to deploy CloudFormation templates as we've started performing numerous deployments along with staging, production, development environments.

As the scripts grew, it was very useful put them all in a CLI using [Yargs](https://yargs.js.org/) and create an [NPM package](https://www.npmjs.com/package/carlin), this way it can be used by all team in all projects.
As the scripts grew, it was advantageous to put them all in a CLI using [Yargs](https://yargs.js.org/) and create an [NPM package](https://www.npmjs.com/package/carlin), to allow the whole team uses it in all projects.

We've changed <Carlin /> API at least five times trying to provide the better API possible. Currently, <Carlin /> has the best API that we could design and for that reason, we've decided to open-source it, joining as a [ttoss](https://github.com/ttoss) project. We hope this framework helps a lot of developers deploying AWS cloud resources. We're heavily using it in your projects at [Triângulos Tecnologia](https://triangulostecnologia.com).
We've changed <Carlin /> API at least five times, trying to provide the better API possible. Currently, <Carlin /> has the best API that we could design, and for that reason, we've decided to open-source it, joining as a [ttoss](https://github.com/ttoss) project. We hope this framework helps a lot of developers deploying AWS cloud resources. We're heavily using it in your projects at [Triângulos Tecnologia](https://triangulostecnologia.com).

We also would love feedbacks from community. We'll appreciate a lot if you want to give a try and send feedbacks to us of how might we improve the framework.
We also would love feedback from the community. We'll appreciate it a lot if you want to try and send feedback to us on how we might improve the framework.

## Should I use <Carlin /> in production ⚠️?

The short answer is **no**. To long answer is **it depends**. We've been using it for a long time and it suits very well for us. We recommend using it if you have these two conditions:
**It depends**. We've been using it for a long time, and it suits us very well. We recommend using it if you have these two conditions:

1. **You know all <Carlin /> algorithms.**

2. **You know how to fix a deployment manually if some error occur.**
2. **You know how to fix a deployment manually if some error occurs.**

Also, it isn't recommeneded because it isn't well tested. We're creating the tests little by little and there are a lot of core scritps that don't have automated tests yet.
Currently, our [tests coverage](https://en.wikipedia.org/wiki/Code_coverage) threshold are:
Also, it's essential to say that this framework doesn't have many tests yet. We're creating the tests little by little, and some core scripts still don't have unit tests.
Currently, our [tests coverage](https://en.wikipedia.org/wiki/Code_coverage) threshold is:

<CodeBlock className="json">{testsCoverageThreshold}</CodeBlock>
1 change: 1 addition & 0 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"dev": "docusaurus start",
"build-carlin": "yarn workspace carlin build",
"prebuild": "yarn run build-carlin",
"build": "docusaurus build",
Expand Down

0 comments on commit 547ff16

Please sign in to comment.