From 164a657e8199183950554a3bc8a0bb73b0ab0860 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 23 Oct 2026 09:56:39 +0200 Subject: [PATCH 1/3] Build with Jekyll 4 instead of the github-pages gem The github-pages gem pins Jekyll 3.9 and a restricted set of plugins. With the GitHub Actions build we can use current Jekyll. The Gemfile.lock is now committed so that local and CI builds use the same versions. The Freemarker code blocks are marked as text, because Rouge 4 maps 'ftl' to the Fluent lexer and marks most of the template syntax as errors. --- .gitignore | 3 +- Gemfile | 19 +- Gemfile.lock | 178 ++++++++++++++++++ _config.yml | 3 + .../generic-freemarker-generator.md | 26 +-- 5 files changed, 204 insertions(+), 25 deletions(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 93afcde..b32c476 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,11 @@ _site .sass-cache .jekyll-metadata +.jekyll-cache *.gem .bundle vendor/bundle -Gemfile.lock - # IDEs .idea *.iml diff --git a/Gemfile b/Gemfile index 850a97f..c513d5d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,17 +1,16 @@ source "https://rubygems.org" -ruby RUBY_VERSION -# to use GitHub Pages -gem "github-pages", group: :jekyll_plugins +gem "jekyll", "~> 4.4" -# If you have any plugins, put them here! group :jekyll_plugins do - gem "jekyll-feed" - gem "jekyll-sitemap" - gem "jekyll-redirect-from" - gem "jekyll-seo-tag" - gem "webrick" + gem "jekyll-feed" + gem "jekyll-sitemap" + gem "jekyll-redirect-from" + gem "jekyll-seo-tag" end +# needed for "jekyll serve" with Ruby 3 +gem "webrick" + # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem "tzinfo-data", platforms: [:windows, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..670b740 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,178 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + base64 (0.3.0) + bigdecimal (4.1.3) + colorator (1.1.0) + concurrent-ruby (1.3.8) + csv (3.3.6) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.17.4) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm-linux-gnu) + ffi (1.17.4-arm-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86-linux-gnu) + ffi (1.17.4-x86-linux-musl) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) + forwardable-extended (2.6.0) + google-protobuf (4.36.2) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-aarch64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-aarch64-linux-musl) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-arm64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-x86-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-x86-linux-musl) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-x86_64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-x86_64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.36.2-x86_64-linux-musl) + bigdecimal + rake (~> 13.3) + http_parser.rb (0.8.1) + i18n (1.15.2) + concurrent-ruby (~> 1.0) + jekyll (4.4.1) + addressable (~> 2.4) + base64 (~> 0.2) + colorator (~> 1.0) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3, >= 0.3.6) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-feed (0.18.0) + jekyll (>= 3.7, < 5.0) + jekyll-redirect-from (0.17.0) + jekyll (>= 3.3, < 5.0) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) + jekyll-seo-tag (2.9.1) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + json (2.21.2) + kramdown (2.5.2) + rexml (>= 3.4.4) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.10.1) + logger + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + mercenary (0.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (7.0.5) + rake (13.4.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rexml (3.4.4) + rouge (4.7.0) + safe_yaml (1.0.5) + sass-embedded (1.106.1) + google-protobuf (~> 4.31) + rake (~> 13.3) + sass-embedded (1.106.1-aarch64-linux-android) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-aarch64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-aarch64-linux-musl) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-arm-linux-androideabi) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-arm-linux-gnueabihf) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-arm-linux-musleabihf) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-arm64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-riscv64-linux-android) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-riscv64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-riscv64-linux-musl) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-x86_64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-x86_64-linux-android) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-x86_64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.106.1-x86_64-linux-musl) + google-protobuf (~> 4.31) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + webrick (1.9.2) + +PLATFORMS + aarch64-linux-android + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-androideabi + arm-linux-gnu + arm-linux-gnueabihf + arm-linux-musl + arm-linux-musleabihf + arm64-darwin + riscv64-linux-android + riscv64-linux-gnu + riscv64-linux-musl + ruby + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux + x86_64-linux-android + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + jekyll (~> 4.4) + jekyll-feed + jekyll-redirect-from + jekyll-seo-tag + jekyll-sitemap + tzinfo-data + webrick + +BUNDLED WITH + 2.7.2 diff --git a/_config.yml b/_config.yml index 426b8d2..f1cdd82 100644 --- a/_config.yml +++ b/_config.yml @@ -59,3 +59,6 @@ collections: news: permalink: /news/:year/:month/:day/:title/ output: true + +sass: + sourcemap: never diff --git a/_docs/generators/generic-freemarker-generator.md b/_docs/generators/generic-freemarker-generator.md index bed53ab..6c6a4bc 100644 --- a/_docs/generators/generic-freemarker-generator.md +++ b/_docs/generators/generic-freemarker-generator.md @@ -15,7 +15,7 @@ The generic generator is based on [Freemarker](https://freemarker.apache.org/) t ### Simple Example This simple example illustrates how the generator works. The following Freemarker template outputs the names of all Bounded Contexts on the Context Map: -```ftl +```text The Context Map '${contextMap.name}' contains the following Bounded Contexts: <#list contextMap.boundedContexts as bc> @@ -160,13 +160,13 @@ relationship #### Relationship Type Checking To respect the different structures when processing the relationship list, we provide a method that allows you to check the type of the relationship: -```ftl +```text <#if instanceOf(relationship, SymmetricRelationship)> ... ``` -```ftl +```text <#if instanceOf(relationship, UpstreamDownstreamRelationship)> ... @@ -174,13 +174,13 @@ To respect the different structures when processing the relationship list, we pr You can also check the type of concrete relationship: -```ftl +```text <#if instanceOf(relationship, Partnership)> ... ``` -```ftl +```text <#if instanceOf(relationship, CustomerSupplierRelationship)> ... @@ -255,7 +255,7 @@ boundedContext **Note:** The attribute _implementedDomainParts_ of the _BoundedContext_ returns a list of _DomainParts_. A _DomainPart_ can either be a _Domain_ or a _Subdomain_. Both have a _name_ and a _domainVisionStatement_. As long as you only use these two attributes you don't have to check for the type. However, if you want to access the _type_ attribute of a _Subdomain_ you have to check if the _DomainPart_ is a _Subdomain_ first: -```ftl +```text <#if instanceOf(domainPart, Subdomain)> ... @@ -315,7 +315,7 @@ We do not document the structures below Aggregates (Sculptor) here. Please consu To respect the different structures of these types, you again can use our _instanceOf_ method: -```ftl +```text <#if instanceOf(domainObject, Entity)> ... @@ -327,7 +327,7 @@ As already mentioned, you find the structure of all these domain objects in our ### Domains The _domains_ root element of the model contains a list of _DomainPart_ objects which can either be _Domains_ or _Subdomains_. Use our _instanceOf_ method to check of which type a _DomainPart_ is: -```ftl +```text <#if instanceOf(domainPart, Subdomain)> ... @@ -416,14 +416,14 @@ The following functions can be used in the Freemarker templates to help processi ### Bounded Context Filtering The functions _filterStructuralBoundedContexts_ and _filterTeams_ can be used to filter teams and Bounded Contexts which are not teams respectively. The following example lists all Bounded Contexts that are not teams: -```ftl +```text <#list filterStructuralBoundedContexts(boundedContexts) as bc> Bounded Context: ${bc.name} ``` This example on the other hand lists all teams: -```ftl +```text <#list filterTeams(boundedContexts) as bc> Bounded Context: ${bc.name} @@ -432,13 +432,13 @@ This example on the other hand lists all teams: ### Type Checking The meta-model behind CML contains a few inheritance hierarchies which make it unavoidable that you sometimes have to check of which type an object is. Examples with relationships and domains vs. subdomains have already been shown above. The function _instanceOf_ allows to check which type of relationship or subdomain an object has: -```ftl +```text <#if instanceOf(relationship, UpstreamDownstreamRelationship)> ... ``` -```ftl +```text <#if instanceOf(domainPart, Subdomain)> ... @@ -450,7 +450,7 @@ This part of the DSL is based on [Sculptor](https://sculptor.github.io/), and th [ComplexType](https://www.javadoc.io/doc/org.contextmapper/context-mapper-dsl/latest/org/contextmapper/tactic/dsl/tacticdsl/ComplexType.html) object. Depending on if it is primitive type or a reference to another type, rendering the type as a string is quite cumbersome. The function _getType_ which takes a [ComplexType](https://www.javadoc.io/doc/org.contextmapper/context-mapper-dsl/latest/org/contextmapper/tactic/dsl/tacticdsl/ComplexType.html) as a parameter returns a simple string representing the type: -```ftl +```text <#list simpleDomainObject.operations as operation> operation ${operation.name} returns type ${getType(operation.returnType)} From a714f8a5726a5094449437ca50405a2982959b7f Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 23 Oct 2026 09:56:40 +0200 Subject: [PATCH 2/3] Deploy with GitHub Actions and add manual preview deployments Pushes to master are built and deployed to GitHub Pages by a workflow; pull requests are built only. Any other branch can be deployed manually to Cloudflare Pages (protected by Cloudflare Access) to review it in the browser before merging. --- .github/workflows/deploy.yml | 53 +++++++++++++++++++++++++++++++++ .github/workflows/preview.yml | 55 +++++++++++++++++++++++++++++++++++ README.md | 17 ++++++----- 3 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4e7c4a1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,53 @@ +name: Build & Deploy Website + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +permissions: + contents: read + +# do not cancel a running production deployment +concurrency: + group: pages-${{ github.ref }} + cancel-in-progress: false + +jobs: + build: + name: Build Website + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + bundler-cache: true + - name: Build with Jekyll + run: bundle exec jekyll build + env: + JEKYLL_ENV: production + - name: Upload Pages artifact + if: github.ref == 'refs/heads/master' + uses: actions/upload-pages-artifact@v5 + + deploy: + name: Deploy to GitHub Pages + if: github.ref == 'refs/heads/master' + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..ec97f49 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,55 @@ +name: Deploy Preview (manual) + +# Deploys the selected branch to Cloudflare Pages (https://..pages.dev). +# The preview deployments are protected with Cloudflare Access (login required). +on: + workflow_dispatch: + +permissions: + contents: read + +env: + CLOUDFLARE_PROJECT: contextmapper-preview + +jobs: + preview: + name: Build & Deploy Preview + # master is deployed to contextmapper.org by the "Build & Deploy Website" workflow + if: github.ref != 'refs/heads/master' + runs-on: ubuntu-latest + environment: + name: preview + url: ${{ steps.deploy.outputs.pages-deployment-alias-url }} + + steps: + - uses: actions/checkout@v7 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + bundler-cache: true + - name: Build with Jekyll + run: bundle exec jekyll build + env: + JEKYLL_ENV: production + - name: Create Cloudflare Pages project (if it does not exist yet) + run: | + if ! npx --yes wrangler@4 pages project list --json | grep -q "\"$CLOUDFLARE_PROJECT\""; then + npx --yes wrangler@4 pages project create "$CLOUDFLARE_PROJECT" --production-branch=master + fi + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + - name: Deploy to Cloudflare Pages + id: deploy + uses: cloudflare/wrangler-action@v4 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy _site --project-name=${{ env.CLOUDFLARE_PROJECT }} --branch=${{ github.ref_name }} --commit-hash=${{ github.sha }} + - name: Summary + run: | + echo "### Preview deployed :rocket:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- Branch: ${{ steps.deploy.outputs.pages-deployment-alias-url }}" >> $GITHUB_STEP_SUMMARY + echo "- This deployment: ${{ steps.deploy.outputs.deployment-url }}" >> $GITHUB_STEP_SUMMARY diff --git a/README.md b/README.md index 8c0856d..019041d 100644 --- a/README.md +++ b/README.md @@ -5,26 +5,29 @@ This is the repository of Context Mapper's website [https://contextmapper.org/](https://contextmapper.org/). ## Running Locally -If you don't want to use Gitpod and want to preview the website locally, follow these steps: +To preview the website locally, follow these steps: - 1. Install Ruby and gem in case you don't have it already. - 2. Install the bundler: + 1. Install Ruby (3.2 or newer) and the bundler in case you don't have it already: ```bash gem install bundler ``` - 3. Install dependencies: - + 2. Install dependencies: + ```bash bundle install ``` - 4. Run Context Mapper website: - + 3. Run the Context Mapper website (http://localhost:4000): + ```bash bundle exec jekyll serve ``` +## Deployment and Previews + * **Production:** every push to `master` is built with Jekyll and deployed to [https://contextmapper.org/](https://contextmapper.org/) (GitHub Pages) by the [Build & Deploy Website](.github/workflows/deploy.yml) workflow. Pull requests are built (but not deployed) by the same workflow. + * **Previews:** to review changes in the browser before merging them, run the [Deploy Preview (manual)](.github/workflows/preview.yml) workflow on your branch (_Actions_ > _Deploy Preview (manual)_ > _Run workflow_ > select the branch). The branch is deployed to Cloudflare Pages and the URL is shown in the workflow run summary (`https://.contextmapper-preview.pages.dev`). The previews are protected by Cloudflare Access; ask a maintainer to get access. + ## Contribution If you think something is missing on our documentation website and you still have unanswered questions, we are happy if you create an issue [here](https://github.com/ContextMapper/contextmapper.github.io/issues) allowing us to improve the docs. PRs are always welcome as well! From 3b6acaae8dbe134c3a35ecc7103082e0a09822fc Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Fri, 23 Oct 2026 09:56:41 +0200 Subject: [PATCH 3/3] Remove the outdated Dockerfile and Gitpod configuration The Dockerfile (Alpine 3.7) was not used anymore and does not work with the current Gemfile; Gitpod Classic has been discontinued. --- .gitpod.yml | 4 ---- Dockerfile | 40 ---------------------------------------- nginx.conf | 43 ------------------------------------------- 3 files changed, 87 deletions(-) delete mode 100644 .gitpod.yml delete mode 100644 Dockerfile delete mode 100644 nginx.conf diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 6c08f4c..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,4 +0,0 @@ -image: gitpod/workspace-full - -tasks: - - init: bundle install diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 48a4b3b..0000000 --- a/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -ARG JEKYLL_BASEURL='' - -#################################### - -FROM alpine:3.7 as builder - -ENV LANGUAGE en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 - -ENV BUILD_PACKAGES \ - ruby \ - ruby-dev \ - ruby-rdoc \ - ruby-irb \ - gcc \ - make \ - libc-dev \ - libffi-dev \ - build-base - -RUN apk add --no-cache $BUILD_PACKAGES \ - && gem install bundle - -WORKDIR /jekyll -ADD . /jekyll -RUN bundle install - -ARG JEKYLL_BASEURL -RUN jekyll build --baseurl $JEKYLL_BASEURL - -#################################### - -FROM nginx:alpine - -ARG JEKYLL_BASEURL -COPY --from=builder /jekyll/_site /usr/share/nginx/html/$JEKYLL_BASEURL -COPY nginx.conf /etc/nginx/nginx.conf - -EXPOSE 80 diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 0f16eb8..0000000 --- a/nginx.conf +++ /dev/null @@ -1,43 +0,0 @@ -user nginx; -worker_processes 1; - - -error_log /dev/stderr warn; -pid /var/run/nginx.pid; - - -events -{ - worker_connections 1024; -} - - -http -{ - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /dev/stdout; - - sendfile off; - # tcp_nopush on; - - keepalive_timeout 65; - - gzip on; - - # serve static files - server - { - - location / - { - - root /usr/share/nginx/html; - } - } -}