Skip to content

Commit 7c564fe

Browse files
authored
Codefresh Cron Triggers (#127)
1 parent 21113ec commit 7c564fe

File tree

12 files changed

+74
-10
lines changed

12 files changed

+74
-10
lines changed

content/documentation/getting-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check out our [terraform-root-modules](https://github.com/cloudposse/terraform-r
1717

1818
# Local Development
1919

20-
1. Get your [local environment](/local-dev-environments/) setup
20+
1. Get your [local environment]({{< relref "local-dev-environments/_index.md" >}}) setup
2121
2. Make sure you're familiar with [`make`](/tools/make/) and [`Makefiles`]({{< relref "tools/make/makefile-examples.md" >}}) because we use them extensively for "executable documentation".
2222
3. Review Docker compose
2323
4. Docker composition monorepo strategy
@@ -67,11 +67,11 @@ Our standard [CI/CD pipeline]({{< relref "release-engineering/cicd-process/_inde
6767

6868
Codefresh runs docker containers for each build step. We provide a dockerized [build-harness]({{< relref "release-engineering/build-harness.md">}}) to distribute common build tools that we use as part of the build steps in the `codefresh.yml`.
6969

70-
Learn how [codefresh]({{< relref "release-engineering/codefresh-kubernetes-integration.md" >}}) is integrated with kubernetes.
70+
Learn how [Codefresh]({{< relref "release-engineering/codefresh/kubernetes-integration.md" >}}) is integrated with kubernetes. This is also the same process used to add integrations for multiple clusters.
7171

72+
We use some terraform modules to provision resources for codefresh like a [chamber user](https://github.com/cloudposse/terraform-aws-iam-chamber-user).
7273

73-
* We use some terraform modules to provision resources for codefresh like a chamber user
74-
* Deploy [apps with secrets]({{< relref "secrets-management/cicd.md" >}})
74+
Securely deploy [apps with secrets]({{< relref "secrets-management/cicd.md" >}}).
7575

7676
## Backing Services (*Coming Soon*)
7777

content/faq/how-to-perform-rollbacks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ How to rollback application to previous version?
1414

1515
# Answer
1616

17-
[Helm]({{< relref "tools/helm.md" >}}) handles rollbacks out-of-the-box. Everytime a helm replease is performed, it creates a new revision. By pinpointing a specific helm revision and performing a rollback, the previous version will be redeployed.
17+
[Helm]({{< relref "tools/helm.md" >}}) handles rollbacks out-of-the-box. Everytime a helm release is performed, it creates a new revision. By pinpointing a specific helm revision and performing a rollback, the previous version will be redeployed.
1818

1919
There are a couple ways we recommend performing rollbacks.
2020

@@ -60,7 +60,7 @@ sh-3.2 $ helm rollback $RELEASE_NAME $REVISION_NUMBER
6060

6161
The other option is to use the Codefresh UI to perfom the rollback. The benefit with this is no console access is required.
6262

63-
[Codefresh]({{< relref "release-engineering/codefresh.md" >}}) provides native integration
63+
[Codefresh]({{< relref "release-engineering/codefresh/_index.md" >}}) provides native integration
6464
with Kubernetes and Helm. Here's an example of how you can use their UI to perform a rollback.
6565

6666
1. Open the [Helm Releases](https://g.codefresh.io/helm/releases/releases/) page

content/glossary/init-terraform.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "init-terraform"
3+
description: 'The `init-terraform` script is a helper for configuring and then initializing terraform remote state in combination with the terraform-aws-tfstate-backend module.'
4+
terms:
5+
- init-terraform
6+
tags:
7+
- tfstate
8+
---
9+
10+
{{% dialog type="info" icon="fa fa-book" title="Read More" %}}
11+
- This [`init-terraform`](https://github.com/cloudposse/geodesic/blob/master/rootfs/usr/local/bin/init-terraform) script is provided as part of geodesic.
12+
- The [terraform-aws-tfstate-backend]({{< relref "terraform-modules/supported/terraform-aws-tfstate-backend.md" >}}) module provides an encrypted S3 bucket for persisting state and a DynamoDB table for state locking.
13+
{{% /dialog %}}

content/kubernetes-platform-services/dashboard/cluster-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in the GitHub `organization` and in the `team` belonging to it.
4343
For more details read [Creating organization](https://help.github.com/articles/creating-a-new-organization-from-scratch/)
4444
and [Organizing members into teams](https://help.github.com/articles/organizing-members-into-teams/)
4545

46-
In our example we will use `example-org` as the organization and `staging-team` as the team.
46+
In our example we will use `example-com` as the organization and `staging-team` as the team.
4747

4848
## Installing on Kubernetes
4949

content/kubernetes-platform-services/dashboard/examples/portal-helmfile-sync.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ chamber write kops PORTAL_HOSTNAME portal.us-west-2.staging.example.com
22
chamber write kops PORTAL_INGRESS ingress.us-west-2.staging.example.com
33
chamber write kops PORTAL_OAUTH2_PROXY_GITHUB_CLIENT_ID e76XXXXXXXXXXXXXX9a0
44
chamber write kops PORTAL_OAUTH2_PROXY_GITHUB_CLIENT_SECRET b24XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXa1c
5-
chamber write kops PORTAL_OAUTH2_PROXY_GITHUB_ORGANIZATION example-org
5+
chamber write kops PORTAL_OAUTH2_PROXY_GITHUB_ORGANIZATION example-com
66
chamber write kops PORTAL_OAUTH2_PROXY_GITHUB_TEAM staging-team
77
chamber write kops PORTAL_OAUTH2_PROXY_COOKIE_NAME $(uuidgen)
88
chamber write kops PORTAL_OAUTH2_PROXY_COOKIE_SECRET $(uuidgen)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "Codefresh Cron Triggers"
3+
description: "Cron triggers allow you to schedule jobs to run periodically using a cron-style time specifier."
4+
tags:
5+
- Codefresh
6+
- crontab
7+
- cronjob
8+
- pipeline
9+
---
10+
11+
Codefresh supports [triggers](https://codefresh.io/docs/docs/pipeline-triggers/introduction-triggers/) which can execute a pipeline based on external webooks or cronjobs.
12+
13+
# Configuration
14+
15+
1. First setup a pipeline the way you would for any other kind of build.
16+
17+
2. Navigate to the "Configuration" and select "Add Trigger"
18+
{{< img src="/assets/cron-trigger-7ac0cd4f.png" title="Pipeline Configuration" >}}
19+
20+
3. Select "CRON" as the type and click "Next"
21+
{{< img src="/assets/cron-trigger-ad77ad30.png" title="Cronjob" >}})
22+
23+
4. Pick a schedule
24+
{{< img src="/assets/cron-trigger-4d99f7d0.png" title="Pick Schedule" >}}
25+
26+
{{% dialog type="important" icon="fa fa-exclamation-triangle" title="Important" %}}
27+
If rebuilding docker images, you may need to [disable docker caching](https://codefresh.io/docs/docs/troubleshooting/common-issues/disabling-codefresh-caching-mechanisms/) by adding `no_cache: true` to the `type: build` step in the pipeline.
28+
29+
```
30+
build_image:
31+
title: Build image
32+
type: build
33+
description: Build Postgres image with dataset for local development
34+
image_name: dataset
35+
dockerfile: Dockerfile
36+
no_cache: true
37+
```
38+
39+
{{% /dialog %}}
40+
41+
# References
42+
43+
- https://codefresh.io/docs/docs/pipeline-triggers/configure-cron-trigger/
44+
- https://github.com/codefresh-io/cronus/blob/master/docs/expression.md

content/release-engineering/codefresh-kubernetes-integration.md renamed to content/release-engineering/codefresh/kubernetes-integration.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: "Codefresh Kubernetes Integration"
33
description: "Easily add Kubernetes Clusters in Codefresh"
4+
tags:
5+
- Codefresh
6+
- kubernetes
47
---
58

69
# Setup
@@ -29,6 +32,10 @@ https://github.com/cloudposse/geodesic/blob/master/rootfs/usr/local/bin/codefres
2932

3033
Enter the outputs of the script into the form and click save.
3134

35+
{{% dialog type="info" icon="fa fa-info-circle" title="Note" %}}
36+
We recommend naming the configuration after the cluster name (e.g. `us-west-2-staging-example-com`).
37+
{{% /dialog %}}
38+
3239
## Enter Kubernetes Credentials
3340

3441
![Enter Kubernetes API Details](/assets/c5273c7-Screen_Shot_2018-04-16_at_5.20.30_PM.png)
@@ -48,7 +55,7 @@ create_namespace:
4855
title: Create an Example Namespace
4956
image: cloudposse/build-harness:0.5.4
5057
environment:
51-
- KUBE_CONTEXT=us-west-2-staging-example-org
58+
- KUBE_CONTEXT=us-west-2-staging-example-com
5259
commands:
5360
- "kubectl create namespace example"
5461
```

content/tools/helmfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Helmfile depends on the following `cli` tools.
4444

4545
Prior to using `helmfile`, you'll need a valid [`kubectl` context]({{< relref "geodesic/module/with-kops.md#export-kubecfg" >}}).
4646

47-
Alternatively, set the [`KUBE_CONTEXT`]({{< relref "release-engineering/codefresh-kubernetes-integration.md#usage" >}}) when using `helmfile` with a Codefresh pipeline.
47+
Alternatively, set the [`KUBE_CONTEXT`]({{< relref "release-engineering/codefresh/kubernetes-integration.md#usage" >}}) when using `helmfile` with a Codefresh pipeline.
4848

4949
# Configuration File
5050

95 KB
Loading
46.5 KB
Loading
72.6 KB
Loading

0 commit comments

Comments
 (0)