Skip to content

Commit 3f2325f

Browse files
Merge branch 'master' into master
2 parents 53b91a4 + 0683409 commit 3f2325f

File tree

21 files changed

+490
-18
lines changed

21 files changed

+490
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

CATALOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
## Stable Plugins
44

5-
| Plugin | Description | Tags |
6-
| -------------------------------------------- | -------------------------- | --------------------------------- |
7-
| [Deploy Helm](stable/helm/README.md) | Deploy a Helm chart | `kubernetes` `helm` |
8-
| [Slack](stable/slack/README.md) | Send message to slack | `slack` `notify` |
9-
| [Deploy to ECS](stable/ecs-deploy/README.md) | Deploy docker image to ECS | `ecs` `deploy` `containers` `aws` |
5+
| Plugin | Author | Description | Tags |
6+
| ----------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------- |
7+
| [Codefresh Cli](stable/codefresh-cli/README.md) | @itai-codefresh | Operate on Codefresh resources | `cli` `codefresh` |
8+
| [Deploy Helm](stable/helm/README.md) | @alexeil-led | Deploy a Helm chart | `kubernetes` `helm` |
9+
| [Slack](stable/slack/README.md) | @olegs-codefresh | Send message to slack | `slack` `notify` |
10+
| [Deploy to ECS](stable/ecs-deploy/README.md) | @verchol | Deploy docker image to ECS | `ecs` `deploy` `containers` `aws` |
11+
| [Deploy Kompose](stable/kompose/README.md) | @alexei-led | Deploy Docker Compose to Kubernetes cluster with Kubernetes [Kompose](http://kompose.io) | `docker` `docker-compose` `kompose` `deploy` `kubernetes` |
12+
| [GitHub PR](stable/github-pr/README.MD) | @nick-codefresh | Creates pull request to GitHub
1013

1114
## Incubator Plugins
1215

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ This repository is used by Plugin developers for maintaining the official plugin
99

1010
### How to Contribute a Plugin
1111

12-
1. Fork this repository, develop and test your Plugin.
12+
1. Fork this repository, develop and test your Plugin
1313
2. Choose the correct folder for your plugin based on the information in the [Repository Structure](README.md#repository-structure) section
14-
3. Ensure your Plugin follows the [technical](#technical-requirements) and [documentation](#documentation-requirements) guidelines, described below.
15-
4. Submit a pull request.
14+
3. Ensure your Plugin follows the [technical](#technical-requirements) and [documentation](#documentation-requirements) guidelines, described below
15+
4. Update [Plugin Catalog](CATALOG.md)
16+
5. Submit a pull request
1617

1718
***NOTE***: In order to make testing and merging of PRs easier, please submit changes to multiple plugins in separate PRs.
1819

incubator/docker-service/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Codefresh docker-service plugin
2+
3+
Use Codefresh docker-service plugin to create docker daemon and then use run on it any of
4+
`docker build|run|...` or `docker-compose` on your repository
5+
6+
See https://github.com/codefresh-io/docker-service

incubator/docker-service/plugin.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
image: codefresh/docker-service
2+
tag: master
3+
version: 0.1.0
4+
description: Codefresh docker-service plugin
5+
keywords:
6+
- docker
7+
- docker-machine
8+
- docker-compose
9+
home: https://github.com/codefresh-io/docker-service
10+
sources:
11+
- https://github.com/codefresh-io/docker-service
12+
maintainers: # (optional)
13+
- name: Kosta Klevensky
14+
email: kosta@codefresh.io

stable/codefresh-cli/NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Notes

stable/codefresh-cli/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Codefresh Cli Plugin
2+
3+
Use Codefresh Cli plugin to perform operations on your Codefresh resources
4+
5+
## Usage
6+
7+
8+
```yaml
9+
---
10+
version: '1.0'
11+
12+
steps:
13+
14+
...
15+
16+
annotate_image:
17+
image: codefresh/cli
18+
description: annotates image with metadata
19+
command: annotate image IMAGE_ID -a key1=value1 -a key2=value2
20+
21+
run_pipeline:
22+
image: codefresh/cli
23+
description: run a pipeline
24+
command: run pipeline PIPELINE_NAME REPO_OWNER REPO_NAME -b master
25+
...
26+
27+
```
28+
29+
## Environment Variables
30+
31+
- `CFCONFIG` - Path for cfconfig file path (default: ${HOME}/.cfconfig

stable/codefresh-cli/plugin.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
image: codefresh/cli
2+
version: 0.1.0
3+
description: Operate on Codefresh resources
4+
keywords:
5+
- cli
6+
home: https://github.com/codefresh-io/codefresh
7+
sources:
8+
- https://github.com/codefresh-io/codefresh
9+
icon: http://cdn.osxdaily.com/wp-content/uploads/2014/08/terminal-icon-osx.png
10+
envs:
11+
- name: CFCONFIG
12+
description: Path for cfconfig file path

stable/ecs-deploy/README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
# cf-ecs-deploy
3+
Deployment to Amazon ECS Service
4+
5+
### Prerequiests
6+
- Configured ECS Cluster with at least one running instance.
7+
- Configured ECS Service and task definition with an image being deployed.
8+
See http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html
9+
10+
- AWS Credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) with following priviledges:
11+
```json
12+
{
13+
"Version": "2012-10-17",
14+
"Statement": [
15+
{
16+
"Sid": "Stmt1479146904000",
17+
"Effect": "Allow",
18+
"Action": [
19+
"ecs:DescribeServices",
20+
"ecs:DescribeTaskDefinition",
21+
"ecs:DescribeTasks",
22+
"ecs:ListClusters",
23+
"ecs:ListServices",
24+
"ecs:ListTasks",
25+
"ecs:RegisterTaskDefinition",
26+
"ecs:UpdateService"
27+
],
28+
"Resource": [
29+
"*"
30+
]
31+
}
32+
]
33+
}
34+
```
35+
36+
### Deployment with Codefresh
37+
- Add encrypted environment variables for aws credentials.
38+
* AWS_ACCESS_KEY_ID
39+
* AWS_SECRET_ACCESS_KEY
40+
- Add "deploy to ecs" step to codefresh.yml which runs codefresh/cf-deploy-ecs image with command cfecs-update
41+
Specify the aws region, ecs cluster and service names. See `cfecs-update -h` for parameter references
42+
43+
```yaml
44+
# codefresh.yml example with deploy to ecs step
45+
version: '1.0'
46+
47+
steps:
48+
build-step:
49+
type: build
50+
image-name: repo/image:tag
51+
52+
push to registry:
53+
type: push
54+
candidate: ${{build-step}}
55+
tag: ${{CF_BRANCH}}
56+
57+
deploy to ecs:
58+
image: codefresh/cf-deploy-ecs
59+
commands:
60+
- cfecs-update <aws-region> <ecs-cluster-name> <ecs-service-name>
61+
environment:
62+
- AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}
63+
- AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}
64+
65+
when:
66+
- name: "Execute for 'master' branch"
67+
condition: "'${{CF_BRANCH}}' == 'master'"
68+
```
69+
70+
71+
### Deployment Flow
72+
- get ECS service by specified aws region, ecs cluster and service names
73+
- create new revision from current task definition of the service. If --image-name and --image-tag are provided, replace the tag of the image
74+
- launch update-service with new task definition revision
75+
- wait for deployment to complete (by default, if running withou --no-wait)
76+
* deployment is considered as completed successfully if runningCount == desiredCount for PRIMARY deployment - see `aws ecs describe-service`
77+
* cfecs-update exits with timeout if after --timeout (default = 900s) runningCount != desiredCount script exits with timeout
78+
* cfecs-update exits with error if --max-failed (default = 2) or more ecs tasks were stopped with error for the task definition being deployed.
79+
ECS retries failed tasks continuously
80+
81+
### Usage with docker
82+
83+
```bash
84+
docker run --rm -it -e AWS_ACCESS_KEY_ID=**** -e AWS_SECRET_ACCESS_KEY=**** codefresh/cf-ecs-deploy cfecs-update [options] <aws-region> <ecs-cluster-name> <ecs-service-name>
85+
```
86+
87+
### cfecs-update -h
88+
```
89+
usage: cfecs-update [-h] [-i IMAGE_NAME] [-t IMAGE_TAG] [--wait | --no-wait]
90+
[--timeout TIMEOUT] [--max-failed MAX_FAILED] [--debug]
91+
region_name cluster_name service_name
92+
93+
Codefresh ECS Deploy
94+
95+
positional arguments:
96+
region_name AWS Region, ex. us-east-1
97+
cluster_name ECS Cluster Name
98+
service_name ECS Service Name
99+
100+
optional arguments:
101+
-h, --help show this help message and exit
102+
--wait Wait for deployment to complete (default)
103+
--no-wait No Wait for deployment to complete
104+
--timeout TIMEOUT deployment wait timeout (default 900s)
105+
--max-failed MAX_FAILED
106+
max failed tasks to consider deployment as failed
107+
(default 2)
108+
--debug show debug messages
109+
110+
-i IMAGE_NAME, --image-name IMAGE_NAME
111+
Image Name in ECS Task Definition to set new tag
112+
-t IMAGE_TAG, --image-tag IMAGE_TAG
113+
Tag for the image
114+
```

stable/ecs-deploy/plugin.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
image: codefresh/ecs
2+
tag: 2.7.2
3+
version: 1.1.0
4+
description: Release a Helm chart (update or install)
5+
keywords:
6+
- ecs
7+
- deploy
8+
- containers
9+
home: https://github.com/codefresh-io/cf-deploy-ecs.git
10+
sources:
11+
- https://github.com/codefresh-io/cf-deploy-ecs.git
12+
maintainers: # (optional)
13+
- name: Oleg Verhovsky
14+
email: oleg@codefresh.io
15+
icon: https://www.metricly.com/wp-content/uploads/2017/07/ECSIcon.png
16+
envs:
17+
- name: AWS_ACCESS_KEY_ID
18+
type: required
19+
description: Amazon access key ID
20+
- name: AWS_SECRET_ACCESS_KEY
21+
type: required
22+
description: amazon secret key (make sure it's encrypted)
23+
- name: aws-region
24+
type: required
25+
description: Helm release name
26+
- name : region
27+
type : required
28+
description : aws region
29+
- name : cluster_name
30+
type : required
31+
description : ecs cluster name
32+
- name : service_name
33+
type : required
34+
description : ecs service name
35+
context:
36+
- kind: Amazon ECS

0 commit comments

Comments
 (0)