Add bump version, add robots.txt

This commit is contained in:
Konstantin 2024-03-29 18:43:38 +01:00
parent e55aeb5c71
commit 6bd0df1f34
4 changed files with 57 additions and 3 deletions

View file

@ -1,10 +1,14 @@
.PHONY: help build publish
VERSION = 1.0.27
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
build:
@docker build -t code.headbright.be/konstantin/iamkonstantin:1.0.24 .
@docker build -t code.headbright.be/konstantin/iamkonstantin:$(VERSION) .
publish:
@docker push code.headbright.be/konstantin/iamkonstantin:1.0.24
@docker push code.headbright.be/konstantin/iamkonstantin:$(VERSION)
bump:
@bash ./bump_version.sh
upgrade: bump build publish

33
base/templates/robots.txt Normal file
View file

@ -0,0 +1,33 @@
User-agent: *
Allow: /*?v
Disallow: /calendar/action*
Disallow: /events/action*
Disallow: /*?
Crawl-delay: 3
User-agent: AdsBot-Google
User-agent: Amazonbot
User-agent: anthropic-ai
User-agent: Applebot
User-agent: AwarioRssBot
User-agent: AwarioSmartBot
User-agent: Bytespider
User-agent: CCBot
User-agent: ChatGPT-User
User-agent: ClaudeBot
User-agent: Claude-Web
User-agent: cohere-ai
User-agent: DataForSeoBot
User-agent: FacebookBot
User-agent: Google-Extended
User-agent: GoogleOther
User-agent: GPTBot
User-agent: ImagesiftBot
User-agent: magpie-crawler
User-agent: omgili
User-agent: omgilibot
User-agent: peer39_crawler
User-agent: peer39_crawler/1.0
User-agent: PerplexityBot
User-agent: YouBot
Disallow: /

16
bump_version.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
# Read the current version from the Makefile
current_version=$(sed -n 's/^VERSION = \(.*\)/\1/p' Makefile)
# Split the version into an array using '.' as the delimiter
IFS='.' read -ra version_parts <<< "$current_version"
# Increment the last part of the version
((version_parts[-1]++))
# Join the version parts back together with '.' as the delimiter
new_version=$(IFS=. ; echo "${version_parts[*]}")
# Replace the old version with the new one in the Makefile
sed -i "" "s/^VERSION = $current_version/VERSION = $new_version/g" Makefile

View file

@ -1,6 +1,7 @@
from django.conf import settings
from django.urls import include, path
from django.contrib import admin
from django.views.generic.base import TemplateView
from wagtail.admin import urls as wagtailadmin_urls
from wagtail import urls as wagtail_urls
@ -17,9 +18,9 @@ urlpatterns = [
path("search/", search_views.search, name="search"),
path("blog/feed/", RssBlogFeed(), name="blog_feed"),
path('sitemap.xml', sitemap),
path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type="text/plain"))
]
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns