diff --git a/README.md b/README.md index 1ed8c96..29c9e20 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. ``` @@ -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/ \ No newline at end of file diff --git a/examples/authenticate-gcp.yml b/examples/authenticate-gcp.yml new file mode 100644 index 0000000..12a76e7 --- /dev/null +++ b/examples/authenticate-gcp.yml @@ -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. diff --git a/examples/install-helm-chart.yml b/examples/install-helm-chart.yml index 62afbac..0af803f 100644 --- a/examples/install-helm-chart.yml +++ b/examples/install-helm-chart.yml @@ -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: @@ -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 diff --git a/examples/install-helm-client.yml b/examples/install-helm-client.yml new file mode 100644 index 0000000..6e10b04 --- /dev/null +++ b/examples/install-helm-client.yml @@ -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