A plugin for Hashicorp Waypoint that allows to deploy artifacts on Cloud Foundry | Read-only mirror of https://github.com/swisscom/waypoint-plugin-cloudfoundry — Swisscom. Issues & pull requests at the source.
  • Go 85%
  • Nix 8.6%
  • Makefile 3.2%
  • HCL 1.9%
  • Dockerfile 0.7%
  • Other 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-09-29 10:48:47 +02:00
.github/workflows seperate build and release workflow 2022-07-05 11:59:07 +02:00
cloudfoundry Add cf health-check configuration to deployment 2021-11-23 12:21:46 +01:00
example initial commit 2021-04-20 10:15:52 +02:00
nix chore: add nix based on Hashicorp Waypoint repo 2021-11-23 12:19:39 +01:00
platform Only validate if healtChek field is present in deployment stanza 2021-11-23 12:51:21 +01:00
release camel case stop_old_instances 2022-06-30 16:23:18 +02:00
utils feat: Update waypoint and plugin sdk to support 0.8x 2022-06-03 14:35:31 +02:00
.gitignore Stop old application instances 2021-11-09 21:10:06 +01:00
CHANGELOG.md update changelog 2022-09-29 10:48:47 +02:00
Dockerfile feat: Update waypoint and plugin sdk to support 0.8x 2022-06-03 14:35:31 +02:00
generate-tag.sh chore: improve build-docker and add push-docker targets 2021-07-28 10:45:17 +02:00
go.mod feat: Update waypoint and waypoint sdk to support 0.10.x 2022-09-28 11:13:13 +02:00
go.sum feat: Update waypoint and waypoint sdk to support 0.10.x 2022-09-28 11:13:13 +02:00
LICENSE add license 2021-04-20 10:59:52 +02:00
main.go refactor, start to implement status for release 2021-07-30 18:04:37 +02:00
Makefile add arm64 to make file 2022-06-30 16:26:25 +02:00
print_arch initial commit 2021-04-20 10:15:52 +02:00
README.md fix: use snake_case everywhere (BREAKING!) 2021-11-23 12:29:53 +01:00
shell.nix chore: add nix based on Hashicorp Waypoint repo 2021-11-23 12:19:39 +01:00

waypoint-plugin-cloudfoundry

Plugin for waypoint that adds support for the Cloud Foundry platform.

Usage

Check out the project in the example folder to get an idea of how exactly to use the platform.

Cloud Foundry deployment

deploy {
   use "cloudfoundry" {
      organisation = "cf organisation"
      space = "waypoint-test"

      # App name can be overwritten, otherwise the application name from above is used.
      # app_name = "hello-world"

      # Make sure to create and rename this file, if needed
      # it should contain username:password as base64 encoded string
      docker_encoded_auth = file(abspath("./docker_encoded_credentials.secret"))

      # Defines an Health Check configuration
      health_check {
         type = "http" # required
         endpoint = "/health" # required if type = "http"
         timeout = 60
         invocation_timeout = 60
      }
}

Cloud Foundry release

release {
   use "cloudfoundry" {
      domain = "cfapp.swisscom.com"

      # Hostname can be specifically set, if it is different than the app name
      # hostname = my-example-app-url
      
      # To stop old instances of the app after release
      # stopOldInstances = true
   }
}

Initial setup

Mac OS

Install go: brew install go

Install protoc-gen-go: go get google.golang.org/protobuf/cmd/protoc-gen-go

Build: make

Install locally (make sure the folder $HOME/.config/waypoint/plugins/ exists, if not create beforehand): make install

Building with Docker

To build plugins for release you can use the build-docker Makefile target, this will build your plugin for all architectures and create zipped artifacts which can be uploaded to an artifact manager such as GitHub releases.

The built artifacts will be output in the ./releases folder.

make build-docker

rm -rf ./releases
docker build --output releases --progress=plain .
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#...

#14 [export_stage 1/1] COPY --from=build /go/plugin/bin/*.zip .
#14 DONE 0.1s

#15 exporting to client
#15 copying files 36.45MB 0.1s done
#15 DONE 0.1s

Building and releasing with GitHub Actions

The action has two main phases:

  1. Build - This phase builds the plugin binaries for all the supported architectures. It is triggered when pushing to a branch or on pull requests.
  2. Release - This phase creates a new GitHub release containing the built plugin. It is triggered when pushing tags which starting with v, for example v0.1.0.