Skip to content

Commit

Permalink
Update examples & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
olereidar committed May 14, 2019
1 parent 92179c7 commit c5ea049
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Entur - CircleCI Helm Orb
This orb tries to simply huge CircleCI configuration files by adding common Helm functionality.

## Requirements
An executor that has `curl` and `gcloud` pre-installed.

## Usage

Import the orb and give it a name. Add this to the `orbs`-key in your CircleCI-configuration:
Expand All @@ -16,7 +19,10 @@ Use the orb like this:
jobs:
your-job-name:
steps:
- helm/install-helm-client
- helm/install-helm-chart:
chart: Chart.yaml
namespace: development
release-name: my-release
# do more CircleCI stuff.
```
Expand All @@ -39,14 +45,8 @@ Validate that the orb is valid:
circleci orb validate orb.yml
```

Publish a dev version of the orb (note: dev orbs are mutuable. E.g. you can publish many times):
```bash
circleci orb publish entur orb.yml entur/helm@dev:first
```
After commit & push to the repository, the orb will be automatically published as part of the workflow in CircleCI.

When ready, promote the orb to production:
```bash
circleci orb publish promote entur/helm@dev:first patch
```
A dev-orb will be published as: `entur/helm@dev:YOUR-BRANCH-NAME`. Release orbs are created on push to the master branch.

You can read more here: https://circleci.com/docs/2.0/creating-orbs/
32 changes: 32 additions & 0 deletions examples/authenticate-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
description: |
Demonstrate authenticating to gcp with this orb.
usage:
version: 2.1

orbs:
helm: entur/helm@volatile # Use volatile if you always want the newest version.


jobs:
deploy-application:
docker:
- image: entur/cci-toolbox:2.0 # This executor comes with a lof of pre-installed features; including gcloud.


steps:
- helm/authenticate-gcp:
gcp-service-key: "{'json':'here'}" # If not provided, the command will look for the environment variable GCLOUD_SERVICE_KEY
gcp-container-cluster: "mycluster" # If not provided, the command will look for the environment variable CLOUDSDK_CONTAINER_CLUSTER

# Note: It is recommended not to have the gcp-service-key and gcp-container-cluster in plain text here.
# Add the required keys as environment variables either in the CircleCI context (and include it via the workflow) or directly to the project.

workflows:
version: 2.1

my-workflow:
jobs:
- deploy-application:
name: deploy-to-kubernetes
context: a-context-that-contain-gcp-env-varialbes # You can add the gcp-service-key & gcp-container-cluster in the context.
8 changes: 4 additions & 4 deletions examples/install-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
description: |
Demonstrate installing a helm chart with this orb
Demonstrate installing a helm chart with this orb.
usage:
version: 2.1

orbs:
helm: entur/helm@volatile # This orb is not registered yet. 07.05.2019 - Ole Reidar
helm: entur/helm@volatile # Use volatile if you always want the newest version.


jobs:
deploy-application:
docker:
- image: google/cloud-sdk:latest
- image: entur/cci-toolbox:2.0 # This executor comes with a lof of pre-installed features; including gcloud.


steps:
- helm/install-helm-chart:
Expand All @@ -20,7 +21,6 @@ jobs:
release-name: $CIRCLE_PROJECT_REPONAME-my-release-$NAMESPACE # output: projectname-my-release-namespace
wait: true # default true, this step is not needed


workflows:
version: 2.1

Expand Down
24 changes: 24 additions & 0 deletions examples/install-helm-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: |
Demonstrate installing the helm client with this orb.
usage:
version: 2.1

orbs:
helm: entur/helm@volatile # Use volatile if you always want the newest version.


jobs:
deploy-application:
docker:
- image: circleci/image:version # Use an executor that supports curl. All official circleci images curl pre-installed (with a few exceptions)

steps:
- helm/install-helm-client # This command doesn't have any parameters.

workflows:
version: 2.1

my-workflow:
jobs:
- deploy-application

0 comments on commit c5ea049

Please sign in to comment.