Skip to content

Commit

Permalink
Use c2cciutils - Publish to GitHub Container Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 3, 2020
1 parent 1e2f293 commit cc071a1
Show file tree
Hide file tree
Showing 63 changed files with 238 additions and 339 deletions.
6 changes: 6 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ update_configs:
allowed_updates:
- match:
update_type: security
- package_manager: python
directory: /ci
update_schedule: live
automerged_updates:
- match:
update_type: all
17 changes: 14 additions & 3 deletions examples/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 110
quote_type = single

[*.js]
indent_size = 2

[*.yaml]
indent_size = 2

[Makefile]
indent_style = tab
5 changes: 3 additions & 2 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 2 * * *'

jobs:
main:
audit:
runs-on: ubuntu-20.04
name: Audit
timeout-minutes: 10
Expand All @@ -21,9 +21,10 @@ jobs:
- '3.23'
- '3.24'
- '3.25'
- master

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/clean-dockerhub-tag.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/clean.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Clean docker hub tags

on: delete

jobs:
clean:
runs-on: ubuntu-20.04
name: Clean docker hub tags
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: docker

- run: |
sudo rm /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt install --yes python3-wheel
- run: sudo python3 -m pip install --requirement=ci/requirements.txt

- name: Clean docker hub tags
run: c2cciutils-clean
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
CodeQL-Build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Code scanning
timeout-minutes: 15

Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/ci.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Continuous integration

on:
push:
pull_request:

jobs:
build:
Expand All @@ -13,11 +12,10 @@ jobs:
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"

env:
SUMMON_PROVIDER: /usr/local/bin/gopass
SECRETS: ${{ secrets.SECRETS }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Get tag
id: tag2
Expand All @@ -29,20 +27,28 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
- run: echo --${{ steps.tag2.outputs.replaced }}--

- run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- run: ci/test-eof-newline

- uses: camptocamp/initialise-gopass-summon-action@v1
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: pypi docker
if: env.SECRETS == 'TRUE'
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
if: env.SECRETS == 'TRUE'

- run: echo "enablePublishing=true" > gradle.properties
if: env.SECRETS == 'TRUE'

- run: |
sudo rm /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt install --yes python3-wheel
- run: sudo python3 -m pip install --requirement=ci/requirements.txt

- name: Checks
run: c2cciutils-checks

- run: make build
- run: make acceptance-tests-up
- run: make acceptance-tests-run
Expand Down Expand Up @@ -93,15 +99,8 @@ jobs:
path: /tmp/test_results
if: failure()

- run: mkdir -p ~/.docker
- name: Decrypt secrets
run: summon --environment dockerhub bash -c 'envsubst < ci/docker-config.json.tmpl > ~/.docker/config.json'
if: env.SECRETS == 'TRUE'

- name: publish
run: ci/publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: c2cciutils-publish
if: env.SECRETS == 'TRUE'

- id: version
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/rebuild-old.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
fail-fast: false
matrix:
branch:
- '3.20'
- '3.21'
- '3.22'
- '3.23'

steps:
Expand Down Expand Up @@ -48,13 +51,11 @@ jobs:
sudo apt update
sudo apt install fonts-liberation
- run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- run: ci/test-eof-newline

- uses: camptocamp/initialise-gopass-summon-action@v1
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: docker
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc

- name: Install Cadastra fonts for OEREB example
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ jobs:
timeout-minutes: 30
name: Rebuild

env:
SUMMON_PROVIDER: /usr/local/bin/gopass

strategy:
fail-fast: false
matrix:
branch:
- '3.25'
- '3.24'
- 'master'
- master

steps:
- run: echo ${{ github.ref }}

- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

Expand All @@ -39,16 +36,22 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
- run: echo --${{ steps.tag2.outputs.replaced }}--

- run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- run: ci/test-eof-newline

- uses: camptocamp/initialise-gopass-summon-action@v1
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: docker

- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc

- run: echo "enablePublishing=true" > gradle.properties

- run: |
sudo rm /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt install --yes python3-wheel
- run: sudo python3 -m pip install --requirement=ci/requirements.txt

- run: make build

# Extract artifacts
Expand Down Expand Up @@ -79,14 +82,8 @@ jobs:
path: /tmp/test_results
if: failure()

- run: mkdir -p ~/.docker
- name: Decrypt secrets
run: summon --environment dockerhub bash -c 'envsubst < ci/docker-config.json.tmpl > ~/.docker/config.json'

- name: publish
run: ci/publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: c2cciutils-publish --branch=${{matrix.branch}}

- run: ./gradlew :core:libSourcesJar
if: "startsWith(github.ref, 'refs/tags/')"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GIT_HEAD_ARG = --build-arg=GIT_HEAD=$(shell git rev-parse HEAD)

.PHONY: build
build:
# Requred and not nesseerly exists
# Required and not nesseerly exists
touch CI.asc

docker build $(GIT_HEAD_ARG) --target=builder --tag=mapfish_print_builder .
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
| 3.23 | 31/10/2021 |
| 3.24 | 31/12/2021 |
| 3.25 | 31/12/2021 |
| 3.26 | 31/06/2021 |
18 changes: 9 additions & 9 deletions ci/check-fonts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import requests


def main():
responce = requests.get("http://localhost:8080/print/fonts")
response = requests.get("http://localhost:8080/print/fonts")

assert responce.ok, responce.status_code
assert (
responce.headers["Content-Type"] == "application/json;charset=utf-8"
), responce.headers["Content-Type"]
fonts_result = responce.json()
assert response.ok, response.status_code
assert response.headers["Content-Type"] == "application/json;charset=utf-8", response.headers[
"Content-Type"
]
fonts_result = response.json()

fonts = [
"DejaVu Sans",
Expand Down Expand Up @@ -55,9 +55,9 @@ def main():
for font, fontconfig in fonts.items():
font_result = [f for f in fonts_result["fonts"] if f["family"] == font]
assert len(font_result) == 1
assert font_result[0]["fontconfig"] == fontconfig, "Invalid {}: ".format(
font
) + str(font_result[0]["fontconfig"])
assert font_result[0]["fontconfig"] == fontconfig, "Invalid {}: ".format(font) + str(
font_result[0]["fontconfig"]
)


if __name__ == "__main__":
Expand Down
57 changes: 0 additions & 57 deletions ci/clean-dockerhub-tag

This file was deleted.

15 changes: 15 additions & 0 deletions ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version:
tag_to_version_re:
- from: release/([0-9]+\.[0-9]+\.[0-9]+)
to: \1

checks:
codespell:
ignore_re:
- ^examples/src/test/resources/examples/.*
- ^examples/geoserver-data/.*
- ^core/src/test/java/org/mapfish/print/parser/MapfishParserTest\.java$
- ^core/src/test/resources/map-data/geojson/states\.json$
- ^core/src/test/resources/org/mapfish/print/parser/mapAttributeTest\.json$
- ^core/src/test/resources/map-data/openlayers/OpenLayers\.js$
- ^core/src/test/resources/map-data/geojson/ny-roads-3857\.json$
Loading

0 comments on commit cc071a1

Please sign in to comment.