Skip to content
Snippets Groups Projects
Unverified Commit 8be296cc authored by Jaromír Hradil's avatar Jaromír Hradil
Browse files

Fixing image rotation pusblish errors

parent be10d728
No related branches found
No related tags found
1 merge request!93Fixing image rotation publish errors
...@@ -5,25 +5,14 @@ variables: ...@@ -5,25 +5,14 @@ variables:
build-test: build-test:
before_script: before_script: &before-script-build-deploy
- apk update - apk update
- apk add git - apk add git python3 py3-pip py3-yaml openssh-client curl moreutils
- apk add python3
- apk add py3-pip
- apk add py3-yaml
- apk add openssh-client
script: script:
- hugo --config config.toml -D --destination=./public - hugo --config config.toml -D --destination=./public
deploy_cpanel: deploy_cpanel:
before_script: before_script: *before-script-build-deploy
- apk update
- apk add git
- apk add python3
- apk add py3-pip
- apk add py3-yaml
- apk add openssh-client
- apk add curl
script: script:
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ics.muni.cz/cloud/hiera.git - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ics.muni.cz/cloud/hiera.git
- sed -i '11,$d' content/cloud/flavors/index.md - sed -i '11,$d' content/cloud/flavors/index.md
...@@ -34,7 +23,8 @@ deploy_cpanel: ...@@ -34,7 +23,8 @@ deploy_cpanel:
- cat content/cloud/flavors/index.md - cat content/cloud/flavors/index.md
- sed -i -e "s/BUILDIDTAG/$CI_COMMIT_SHORT_SHA/g" ./layouts/partials/site-footer.html - sed -i -e "s/BUILDIDTAG/$CI_COMMIT_SHORT_SHA/g" ./layouts/partials/site-footer.html
- curl https://cloud.gitlab-pages.ics.muni.cz/image-rotation/image-rotation-journal.md >> content/cloud/image-rotation/index.md - curl https://cloud.gitlab-pages.ics.muni.cz/image-rotation/image-rotation-journal.md >> content/cloud/image-rotation/index.md
- python3 ci/image_rotation_news_gen.py - 'grep -v "GeekdocHidden: true" "content/cloud/image-rotation/index.md" | sponge "content/cloud/image-rotation/index.md"'
- python3 ci/image_rotation_news_gen.py
- hugo --config config.toml -D --destination=./public - hugo --config config.toml -D --destination=./public
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
......
"""Generated dynamically image rotation news updates""" #!/usr/bin/env python3
"""
Script generates dynamically image rotation news updates
Actions performed:
generating of image rotation news
* if everything goes well
- image rotation news section is updated according to image rotation journal
Usage:
python3 ./image_rotation_news.gen.py
"""
import re import re
import datetime import datetime
...@@ -35,7 +48,7 @@ def generate_news(image_update_dates): ...@@ -35,7 +48,7 @@ def generate_news(image_update_dates):
update_date = datetime.datetime.strftime(update_date, "%Y-%m-%d") update_date = datetime.datetime.strftime(update_date, "%Y-%m-%d")
new_entry = [ new_entry = [
f"**{update_date}** Image rotation update, details [here](https://docs.cloud.muni.cz/" f"**{update_date}** Image rotation update, details [here](https://docs.cloud.muni.cz/"
f"cloud/image-rotation/image-rotation-update-from-{update_date})", f"cloud/image-rotation/#image-rotation-update-from-{update_date})",
] ]
news_content = ( news_content = (
news_content[:line_idx] + new_entry + [""] + news_content[line_idx:] news_content[:line_idx] + new_entry + [""] + news_content[line_idx:]
......
--- ---
title: "Image rotation journal"
date: 2022-01-23T20:31:35+02:00 date: 2022-01-23T20:31:35+02:00
draft: false draft: false
disableToc: true disableToc: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment