En kubernetes cronjobb för att tömma redis stream
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

180 lines
5.1 KiB

resource_types:
- name: slack-notification
type: docker-image
source:
repository: cfcommunity/slack-notification-resource
tag: latest
- name: kubernetes
type: docker-image
source:
repository: zlabjp/kubernetes-resource
tag: "1.10"
- name: kubernetes_2
type: docker-image
source:
repository: ferrologic/concourse-kubernetes
tag: "1.1.0"
resources:
- name: se-gitea
type: git
source:
uri: https://git.smartenergi.org/smartenergi/redis_clean_trigger.git
branch: master
username: ((git_username))
password: ((git_password))
- name: docker-repository
type: docker-image
source:
repository: 935062023832.dkr.ecr.eu-west-1.amazonaws.com/redis_clean_trigger
aws_access_key_id: ((aws_access_key_id))
aws_secret_access_key: ((aws_secret_access_key))
- name: version
type: semver
source:
initial_version: 1.0.0
driver: git
uri: https://git.smartenergi.org/smartenergi/versionfiles.git
branch: master
file: redis_clean_trigger-version
username: ((git_username))
password: ((git_password))
- name: notify
type: slack-notification
source:
url: https://hooks.slack.com/services/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
insecure: true
- name: kubernetes_io
type: kubernetes_2
source:
cluster_url: https://api.k8s.smartenergi.io
namespace: k2
cluster_ca: ((kube_cluster_ca))
admin_key: ((kube_admin_key))
admin_cert: ((kube_admin_cert))
resource_type: cronjob
resource_name: redis-clean-trigger
- name: kubernetes_demo
type: kubernetes_2
source:
cluster_url: https://api.k8s.smartenergi.org
namespace: k2
cluster_ca: ((demo_kube_cluster_ca))
admin_key: ((demo_kube_admin_key))
admin_cert: ((demo_kube_admin_cert))
resource_type: cronjob
resource_name: redis-clean-trigger
- name: pull_image
type: docker-image-resource
source:
repository: 935062023832.dkr.ecr.eu-west-1.amazonaws.com/redis_clean_trigger
aws_access_key_id: ((aws_access_key_ecr))
aws_secret_access_key: ((aws_secret_key_ecr))
- name: push_image
type: docker-image-resource
source:
repository: smartenergi/redis_clean_trigger
username: ((dockerhub_user))
password: ((dockerhub_password))
jobs:
- name: "Build"
public: true
serial: true
plan:
- get: version
params: { bump: patch }
- get: se-gitea
trigger: true
- put: docker-repository
params:
build: se-gitea
tag: version/number
tag_as_latest: true
- put: version
params: { bump: patch }
- put: notify
params:
text: |
*Result*: Success!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Build & Test
*URL*: http://cicd.smartenergi.io:8080/builds/$BUILD_ID
on_failure:
put: notify
params:
text: |
*Result*: Failure!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Build & Test
*URL*: http://cicd.smartenergi.io:8080/builds/$BUILD_ID
- name: "Deploy to internal"
public: true
plan:
- get: docker-repository
trigger: true
passed:
- "Build"
- get: version
- put: kubernetes_io
params:
image_name: docker-repository/repository
image_tag: version/number
- put: notify
params:
text: |
*Result*: Success!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Deployment to Internal
*URL*: http://pipeline.smartenergi.io:8080/builds/$BUILD_ID
on_failure:
put: notify
params:
text: |
*Result*: Failure!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Deploy to internal
*URL*: http://pipeline.smartenergi.io:8080/builds/$BUILD_ID
- name: "Deploy to demo"
public: true
plan:
- get: docker-repository
trigger: false
passed:
- "Deploy to internal"
- get: version
- put: kubernetes_demo
params:
image_name: docker-repository/repository
image_tag: version/number
- put: notify
params:
text: |
*Result*: Success!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Deployment to Demo
*URL*: http://pipeline.smartenergi.io:8080/builds/$BUILD_ID
on_failure:
put: notify
params:
text: |
*Result*: Failure!
*Build Pipeline Name*: $BUILD_PIPELINE_NAME
*Job*: Deploy to demo
*URL*: http://pipeline.smartenergi.io:8080/builds/$BUILD_ID
- name: Pull_and_push_2_hub
public: true
serial: false
plan:
- get: version
trigger: true
passed: ["Build"]
- get: pull_image
params:
save: true
- put: push_image
params:
load: pull_image
tag_file: version/number
get_params: { skip_download: true }