Skip to content

Commit

Permalink
build: 4.9.1-0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
WoozyMasta committed Dec 15, 2021
1 parent ad3b0e3 commit 342549c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is installed in the container.

<!-- markdownlint-disable -->
<p align="center" width="100%">
<img src="https://raw.githubusercontent.com/WoozyMasta/archimate-ci-image/master/scheme.png" />
<img src="https://raw.githubusercontent.com/WoozyMasta/archimate-ci-image/master/extras/scheme.png" />
</p>

For ease of use, the entrypoint.sh script is run in the container,
Expand All @@ -38,9 +38,9 @@ You can check the operation of the container using the [example][]

You can pull image from registries:

* `ghcr.io/woozymasta/archimate-ci:4.9.1-0.8`
* `quay.io/woozymasta/archimate-ci:4.9.1-0.8`
* `docker.io/woozymasta/archimate-ci:4.9.1-0.8`
* `ghcr.io/woozymasta/archimate-ci:4.9.1-0.9`
* `quay.io/woozymasta/archimate-ci:4.9.1-0.9`
* `docker.io/woozymasta/archimate-ci:4.9.1-0.9`

## Run Container

Expand All @@ -57,7 +57,7 @@ docker run --rm -ti \
-e ARCHI_JASPER_REPORT_ENABLED=false \
-e ARCHI_CSV_REPORT_ENABLED=true \
-e ARCHI_EXPORT_MODEL_ENABLED=true \
ghcr.io/woozymasta/archimate-ci:4.9.1-0.8
ghcr.io/woozymasta/archimate-ci:4.9.1-0.9
```

An example with handling a local repository:
Expand All @@ -70,13 +70,13 @@ chmod o+rw ./report
docker run --rm -ti \
-v $(pwd):/archi/project \
-v $(pwd)/report:/archi/report \
ghcr.io/woozymasta/archimate-ci:4.9.1-0.8
ghcr.io/woozymasta/archimate-ci:4.9.1-0.9
```

Working with the CLI directly:

```bash
docker run --rm -ti ghcr.io/woozymasta/archimate-ci:4.9.1-0.8 --help
docker run --rm -ti ghcr.io/woozymasta/archimate-ci:4.9.1-0.9 --help
```

## Configuration
Expand Down Expand Up @@ -142,6 +142,8 @@ All inputs equivalent to environment variables:

## GitHub Actions Example

Add a configuration like this to your actions:

```yml
jobs:
archi_report:
Expand All @@ -156,7 +158,7 @@ jobs:

- name: Deploy Archi report
id: archi
uses: WoozyMasta/[email protected].8
uses: WoozyMasta/[email protected].9
with:
archiHtmlReportEnabled: true
archiJasperReportEnabled: true
Expand All @@ -166,13 +168,19 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
```
In the repository settings, set the branch for publishing pages that you
specified in `githubPagesBranch` or the `GITHUB_PAGES_BRANCH` variable
(`gh-pages` by default).

![pages](extras/github_pages.png)

## GitLab CI Example

```yml
pages:
stage: build
image:
name: woozymasta/archimate-ci-image:4.9.1-0.8
name: woozymasta/archimate-ci-image:4.9.1-0.9
script:
- /opt/Archi/docker-entrypoint.sh
Expand Down Expand Up @@ -203,8 +211,8 @@ pages:

```bash
docker build \
--tag archimate-ci:4.9.1-0.8 \
--build-arg="ARCHI_VERSION=4.9.1-0.8" \
--tag archimate-ci:4.9.1-0.9 \
--build-arg="ARCHI_VERSION=4.9.1-0.9" \
--build-arg="COARCHI_VERSION=0.8.1.202112061132" \
./
```
Expand All @@ -227,7 +235,7 @@ podman run --rm -ti \
-v $(pwd)/report:/archi/report \
-e GIT_REPOSITORY=https://github.com/WoozyMasta/archimate-ci-image-example.git \
-e ARCHI_JASPER_REPORT_ENABLED=false \
ghcr.io/woozymasta/archimate-ci:4.9.1-0.8
ghcr.io/woozymasta/archimate-ci:4.9.1-0.9
```

---
Expand All @@ -242,12 +250,16 @@ docker run --rm -ti \
-e GIT_REPOSITORY=https://github.com/WoozyMasta/archimate-ci-image-example.git
--network=host
--add-host="$(getent hosts gitlab.internal.tld | awk '{print $2 ":" $1}')"
ghcr.io/woozymasta/archimate-ci:4.9.1-0.8
ghcr.io/woozymasta/archimate-ci:4.9.1-0.9
```

<!-- links -->

[Archi]: https://www.archimatetool.com "The Open Source modelling toolkit for creating ArchiMate models and sketches."
[Archi repository]: https://github.com/archimatetool/archi "Archi: ArchiMate Modelling Tool "
[coArchi]: https://github.com/archimatetool/archi-modelrepository-plugin "coArchi – Model Collaboration for Archi"
[example]: https://github.com/WoozyMasta/archimate-ci-image-example.git "Example Archi model for archimate-ci-image"

[example-gh]: https://github.com/WoozyMasta/archimate-ci-image-example.git
[demo-gh-pages]: https://woozymasta.github.io/archimate-ci-image-example/?view=6213
[example-gl]: https://gitlab.com/WoozyMasta/archimate-ci-image-example
[demo-gl-pages]: https://woozymasta.gitlab.io/archimate-ci-image-example
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branding:
color: blue
runs:
using: docker
image: docker://ghcr.io/woozymasta/archimate-ci-image:4.9.1-0.8
image: docker://ghcr.io/woozymasta/archimate-ci-image:4.9.1-0.9
env:
GITHUB_TOKEN: ${{ inputs.githubToken }}
ARCHI_HTML_REPORT_ENABLED: ${{ inputs.archiHtmlReportEnabled }}
Expand Down
13 changes: 8 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ urlencode() {
update_html() {
if [ "${ARCHI_CSV_REPORT_ENABLED,,}" == true ]; then
for item in {elements,properties,relations}; do
_li="<li><a href=\"/${item}.csv\" class=\"go\">${item^}</a></li>"
_li="<li><a href=\"${item}.csv\" class=\"go\">${item^}</a></li>"
sed "/modal.*i18n-about/i $_li" -i "$ARCHI_REPORT_PATH/index.html"
done
fi

if [ "${ARCHI_JASPER_REPORT_ENABLED,,}" == true ]; then
for item in ${ARCHI_JASPER_REPORT_FORMATS//,/ }; do
_li="<li><a href=\"/$_project.${item,,}\" class=\"go\">${item^^}</a></li>"
_li="<li><a href=\"$_project.${item,,}\" class=\"go\">${item^^}</a></li>"
sed "/modal.*i18n-about/i $_li" -i "$ARCHI_REPORT_PATH/index.html"
done
fi

if [ "${ARCHI_EXPORT_MODEL_ENABLED,,}" == true ]; then
_li="<li><a href=\"/$_project.archimate\" class=\"go\">Model</a></li>"
_li="<li><a href=\"$_project.archimate\" class=\"go\">Model</a></li>"
sed "/modal.*i18n-about/i $_li" -i "$ARCHI_REPORT_PATH/index.html"
fi
}
Expand Down Expand Up @@ -197,8 +197,11 @@ if [ "${GITHUB_ACTIONS:-}" == true ]; then
# Commit and push subtree
git add --force $GIT_SUBTREE_PREFIX
git commit --message "Archimate report ${GITHUB_ACTION:-0}:${GITHUB_JOB:-0}"
git subtree push --squash --prefix $GIT_SUBTREE_PREFIX \
origin "$GITHUB_PAGES_BRANCH"

_subtree="$(
git subtree split --squash --prefix $GIT_SUBTREE_PREFIX "$GITHUB_REF_NAME"
)"
git push origin "$_subtree:$GITHUB_PAGES_BRANCH" --force

exit 0

Expand Down
Binary file added extras/github_pages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 342549c

Please sign in to comment.