This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
score-humanitec delta | |
--org $HUMANITEC_ORG | |
--app $APPLICATION_ID | |
--env $TARGET_ENVIRONMENT | |
--token $HUMANITEC_TOKEN | |
--file score.yaml | |
--extensions humanitec.cronjob.yaml | |
--deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: score.dev/v1b1 | |
metadata: | |
name: score-cronjob | |
containers: | |
greeter: | |
image: hello-world:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: humanitec.org/v1b1 | |
profile: "humanitec/default-cronjob" | |
spec: | |
schedules: | |
carbon-efficient: | |
containers: | |
score-cronjob: | |
args: [] | |
command: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get Carbon Optimized Schedule: | |
stage: api | |
image: python:3-alpine | |
variables: | |
REGION: germanywestcentral | |
CRONJOB_DURATION: 10 | |
before_script: | |
- pip3 install chevron pyyaml | |
script: | |
# get carbon optimized timestamps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"location": "de", | |
"windowSize": 10, | |
"optimalDataPoints": [ | |
{ | |
"timestamp": "2023-10-10T10:43:28+00:00", | |
"value": 34.938 | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy With Score: | |
stage: deploy | |
image: golang:1.19 | |
variables: | |
HUMANITEC_ORG: noordsestern | |
APPLICATION_ID: score-cronjob | |
TARGET_ENVIRONMENT: development | |
before_script: | |
- wget https://github.com/score-spec/score-humanitec/releases/download/0.6.0/score-humanitec_0.6.0_linux_amd64.tar.gz | |
- tar -xvzf score-humanitec_0.6.0_linux_amd64.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:3-alpine | |
before_script: | |
- pip3 install chevron pyyaml | |
script: | |
- > | |
echo "{ | |
'CARBON_OPTIMIZED_HOURS':$CARBON_OPTIMIZED_HOURS, | |
'CARBON_OPTIMIZED_MINUTES':$CARBON_OPTIMIZED_MINUTES, | |
'IMAGE':'${IMAGE_NAME}:$CI_PIPELINE_IID', | |
'FTP_URL':$FTP_URL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "{'IMAGE_VERSION':${CI_PIPELINE_IID}" > mustache_data.json | |
chevron -d mustache_data.json score.yaml > score.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: score.dev/v1b1 | |
metadata: | |
name: score-cronjob | |
containers: | |
greeter: | |
image: hello-world:{{ IMAGE_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: score.dev/v1b1 | |
metadata: | |
name: score-cronjob | |
containers: | |
greeter: | |
image: hello-world:${IMAGE_TAG} |
NewerOlder