From 332e5a7669c39eff0feef36d054acb5766069fd7 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 3 Sep 2020 16:27:01 -0400 Subject: [PATCH 01/40] Run pre-commit autoupdate --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52b647303..2689bb0cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + rev: v3.2.0 hooks: - id: check-executables-have-shebangs - id: check-json @@ -33,7 +33,7 @@ repos: args: - --config=.mdl_config.json - repo: https://github.com/adrienverge/yamllint - rev: v1.23.0 + rev: v1.24.2 hooks: - id: yamllint - repo: https://github.com/detailyang/pre-commit-shell @@ -47,7 +47,7 @@ repos: additional_dependencies: - flake8-docstrings - repo: https://github.com/asottile/pyupgrade - rev: v2.7.0 + rev: v2.7.2 hooks: - id: pyupgrade - repo: https://github.com/PyCQA/bandit @@ -57,7 +57,7 @@ repos: args: - --config=.bandit.yml - repo: https://github.com/python/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black - repo: https://github.com/asottile/seed-isort-config @@ -65,16 +65,16 @@ repos: hooks: - id: seed-isort-config - repo: https://github.com/timothycrosley/isort - rev: 5.0.7 + rev: 5.5.0 hooks: - id: isort - repo: https://github.com/ansible/ansible-lint.git - rev: v4.3.0a3 + rev: v4.3.4 hooks: - id: ansible-lint # files: molecule/default/playbook.yml - repo: https://github.com/antonbabenko/pre-commit-terraform.git - rev: v1.31.0 + rev: v1.37.0 hooks: - id: terraform_fmt # There are ongoing issues with how this command works. This issue @@ -98,7 +98,7 @@ repos: hooks: - id: docker-compose-check - repo: https://github.com/prettier/prettier - rev: 2.0.5 + rev: 2.1.1 hooks: - id: prettier - repo: https://github.com/pre-commit/mirrors-mypy From 3e9441c837ce7d34a4043a8348f1bbcccaf2608b Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 3 Sep 2020 16:29:38 -0400 Subject: [PATCH 02/40] Update CODEOWNERS to resolve #50 --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a3619be9e..7735a5257 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # the repo. Unless a later match takes precedence, # these owners will be requested for review when someone # opens a pull request. -* @dav3r @felddy @hillaryj @jsf9k @mcdonnnj @cisagov/team-ois +* @dav3r @felddy @hillaryj @jsf9k @mcdonnnj From ae4aa123c81c0915bb1ce3da2ee19b41a98c9846 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 3 Sep 2020 16:31:23 -0400 Subject: [PATCH 03/40] Update lint job to resolve #49 --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a908a0f..7a9284136 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: ${{ env.PRE_COMMIT_CACHE_DIR }} key: "lint-${{ runner.os }}-py${{ env.PY_VERSION }}-\ ${{ hashFiles('**/requirements-test.txt') }}-\ + ${{ hashFiles('**/requirements.txt') }}-\ ${{ hashFiles('**/.pre-commit-config.yaml') }}" restore-keys: | lint-${{ runner.os }}-py${{ env.PY_VERSION }}- From d8f14e845b4054e8a45fc1f9a38c8537bcf30bfb Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Thu, 3 Sep 2020 16:32:30 -0400 Subject: [PATCH 04/40] Sort .gitignore while I'm here --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e00826d95..4b15d7774 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ +__pycache__ .mypy_cache .python-version -__pycache__ From c400e5450093ee3033508696a34f966b4cd7ba4b Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Mon, 5 Oct 2020 23:35:42 -0400 Subject: [PATCH 05/40] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..6ba09abdf --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at abuse@geekpad.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 106c0edfcd951cba8e8987270998c9b662f41824 Mon Sep 17 00:00:00 2001 From: Felddy Date: Mon, 5 Oct 2020 23:41:47 -0400 Subject: [PATCH 06/40] Correct linter errors in generated code of conduct. --- CODE_OF_CONDUCT.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6ba09abdf..4232ceb12 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -67,10 +67,12 @@ members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +[https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html) [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq +) From 6a4164dfbac372fde6babd98ece2ab61c9b5e380 Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 7 Oct 2020 12:41:47 -0400 Subject: [PATCH 07/40] Bump build workflow python-version to 3.9 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a9284136..3493928e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Store installed Python version run: | echo "::set-env name=PY_VERSION::"\ From c9c00f1d03d2185dfa4a7cab0ec45bd76387c95a Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 7 Oct 2020 12:42:59 -0400 Subject: [PATCH 08/40] Replace deprecated set-env workflow syntax See: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3493928e3..d0563b81b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,9 @@ jobs: python-version: 3.9 - name: Store installed Python version run: | - echo "::set-env name=PY_VERSION::"\ - "$(python -c "import platform;print(platform.python_version())")" + echo "PY_VERSION="\ + "$(python -c "import platform;print(platform.python_version())")" \ + >> $GITHUB_ENV - name: Cache linting environments uses: actions/cache@v2 with: From 7389a1b0cfa7e6d1b50fccef2381d3c28d31e49c Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 7 Oct 2020 12:43:54 -0400 Subject: [PATCH 09/40] Enable weekly dependabot scans of github-actions and pip --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..1fd2ed3bb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +--- + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" From 7bda363b9cec319574bb12eec20104ce5c900ab1 Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 7 Oct 2020 13:41:19 -0400 Subject: [PATCH 10/40] Update CodeQL workflow with changes from template The new template builds a language matrix to run the workflow. --- .github/workflows/codeql-analysis.yml | 34 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 946cb3008..59f872b75 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,20 +1,35 @@ --- + +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. name: "CodeQL" on: push: - branches: [develop] pull_request: # The branches below must be a subset of the branches above branches: [develop] schedule: - - cron: '0 8 * * 6' + - cron: '0 21 * * 6' jobs: - analyse: - name: Analyse + analyze: + name: Analyze runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', + # 'python'] + language: ['javascript', 'python'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -31,10 +46,13 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 - # Override language selection by uncommenting this and choosing your - # languages - # with: - # languages: go, javascript, csharp, python, cpp, java + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a + # config file. By default, queries listed here will override any + # specified in a config file. Prefix the list here with "+" to use + # these queries and those in the config file. queries: + # ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or # Java). If this step fails, then you should remove it and run the build From 04c046a6fae54f0584f82133ac31fa7f01a6d857 Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 7 Oct 2020 14:37:56 -0400 Subject: [PATCH 11/40] Add Docker ecosystem to dependabot configuration --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1fd2ed3bb..fa93c024f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,11 @@ version: 2 updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" directory: "/" schedule: From e64d87783d6fac5fd6eed881dfcbbf47556a82a0 Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Thu, 8 Oct 2020 13:26:11 -0400 Subject: [PATCH 12/40] Update build.yml Bump workflow test Python version to 3.9. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 071e31e1a..786781ab5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Cache testing environments uses: actions/cache@v2 with: From 3de4b852b8635bf8948d4736156149e0ac701677 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2020 17:31:12 +0000 Subject: [PATCH 13/40] Bump actions/download-artifact from v1 to v2.0.5 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from v1 to v2.0.5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v1...c3f5d00c8784369c43779f3d2611769594a61f7a) Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 786781ab5..c796b4cc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: python -m pip install --upgrade pip pip install --upgrade --requirement requirements-test.txt - name: Download docker image artifact - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v2.0.5 with: name: dist - name: Load docker image From d28c382f48f7d48bd963c68626679a72cdbf7109 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2020 17:31:12 +0000 Subject: [PATCH 14/40] Bump actions/upload-artifact from v1 to v2.2.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from v1 to v2.2.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v1...27bce4eee761b5bc643f46a8dfb41b430c8d05f6) Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 786781ab5..a7d738776 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: version=$(./bump_version.sh show) docker save $IMAGE_NAME:latest | gzip > dist/image.tar.gz - name: Upload artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2.2.0 with: name: dist path: dist From df407a7fc08bcbf41963ae41cf94c6a2dcea4a00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2020 17:31:12 +0000 Subject: [PATCH 15/40] Bump python from 3.7-alpine to 3.9.0-alpine Bumps python from 3.7-alpine to 3.9.0-alpine. Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba75023f4..67d029533 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG GIT_COMMIT=unspecified ARG GIT_REMOTE=unspecified ARG VERSION=unspecified -FROM python:3.7-alpine +FROM python:3.9.0-alpine ARG GIT_COMMIT ARG GIT_REMOTE From 1dcbc83d8c23e63d22fd25957374afb1b46b7497 Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Thu, 8 Oct 2020 13:42:01 -0400 Subject: [PATCH 16/40] Fix download-artifact incompatibility See: https://github.com/actions/download-artifact#compatibility-between-v1-and-v2 --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c796b4cc4..3a7d8e534 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,6 +97,7 @@ jobs: uses: actions/download-artifact@v2.0.5 with: name: dist + path: dist - name: Load docker image run: docker load < dist/image.tar.gz - name: Run tests From 53501f578ed38c7387746763c9efc648364b9a87 Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Thu, 8 Oct 2020 13:57:54 -0400 Subject: [PATCH 17/40] Relax upload-artifact version pin. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7d738776..60bccc590 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: version=$(./bump_version.sh show) docker save $IMAGE_NAME:latest | gzip > dist/image.tar.gz - name: Upload artifacts - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v2 with: name: dist path: dist From 5307661b4c8bb163f32852b9420c6a333749e6d0 Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Thu, 8 Oct 2020 14:03:56 -0400 Subject: [PATCH 18/40] Relax base image version pin. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 67d029533..b4f4e61a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG GIT_COMMIT=unspecified ARG GIT_REMOTE=unspecified ARG VERSION=unspecified -FROM python:3.9.0-alpine +FROM python:3.9-alpine ARG GIT_COMMIT ARG GIT_REMOTE From 98f237f180b95060c2efe1cff1ab2e64521c048d Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 8 Oct 2020 14:33:04 -0400 Subject: [PATCH 19/40] Add missing cache keys for test job. Fixes #30 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b52302a5b..f8267a236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,9 @@ jobs: with: path: ${{ env.PIP_CACHE_DIR }} key: "test-${{ runner.os }}-\ - ${{ hashFiles('**/requirements-test.txt') }}" + ${{ hashFiles('**/requirements-test.txt') }}-\ + ${{ hashFiles('**/requirements.txt') }}-\ + ${{ hashFiles('**/.pre-commit-config.yaml') }}" restore-keys: | test-${{ runner.os }}- - name: Install dependencies From e0beef276313fde355efc51fa2a56571763ff598 Mon Sep 17 00:00:00 2001 From: Mark Feldhousen Date: Fri, 9 Oct 2020 14:22:05 -0400 Subject: [PATCH 20/40] Update .github/workflows/build.yml Co-authored-by: Nick M. <50747025+mcdonnnj@users.noreply.github.com> --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8267a236..4ff7cec28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,8 +87,7 @@ jobs: path: ${{ env.PIP_CACHE_DIR }} key: "test-${{ runner.os }}-\ ${{ hashFiles('**/requirements-test.txt') }}-\ - ${{ hashFiles('**/requirements.txt') }}-\ - ${{ hashFiles('**/.pre-commit-config.yaml') }}" + ${{ hashFiles('**/requirements.txt') }}" restore-keys: | test-${{ runner.os }}- - name: Install dependencies From 21f512c2e11776db2545bc594387e2579f8eba10 Mon Sep 17 00:00:00 2001 From: Felddy Date: Fri, 9 Oct 2020 14:33:27 -0400 Subject: [PATCH 21/40] Replace echo statements with logging. --- patches/hotfix_2020062801-0.6.4.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/hotfix_2020062801-0.6.4.sh b/patches/hotfix_2020062801-0.6.4.sh index 202a0f3ee..20820b5e7 100644 --- a/patches/hotfix_2020062801-0.6.4.sh +++ b/patches/hotfix_2020062801-0.6.4.sh @@ -14,9 +14,9 @@ PATCH_URL="https://cdn.discordapp.com/attachments/725021759144984646/72685872995 TARGET_FOUNDRY_VERSION="0.6.4" if [ "$FOUNDRY_VERSION" = "$TARGET_FOUNDRY_VERSION" ]; then - echo "Applying \"${PATCH_NAME}\"" - echo "See: ${PATCH_DOC_URL}" + log "Applying \"${PATCH_NAME}\"" + log "See: ${PATCH_DOC_URL}" curl --output "${PATCH_DEST}" "${PATCH_URL}" 2>&1 | tr "\r" "\n" else - echo "Not applying \"${PATCH_NAME}\". This patch is targeted for Foundry Virtual Tabletop ${TARGET_FOUNDRY_VERSION}" + log_warn "Not applying \"${PATCH_NAME}\". This patch is targeted for Foundry Virtual Tabletop ${TARGET_FOUNDRY_VERSION}" fi From a0bb046725ce2348b4fa21285d6f618fdfd359f9 Mon Sep 17 00:00:00 2001 From: Felddy Date: Fri, 9 Oct 2020 14:58:07 -0400 Subject: [PATCH 22/40] Add 0.7.3 hotfix from 2020--10-01 --- patches/hotfix_2020100101-0.7.3.sh | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 patches/hotfix_2020100101-0.7.3.sh diff --git a/patches/hotfix_2020100101-0.7.3.sh b/patches/hotfix_2020100101-0.7.3.sh new file mode 100644 index 000000000..9bbec393b --- /dev/null +++ b/patches/hotfix_2020100101-0.7.3.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Experimental Hotfix +# ===================== +# Beta 0.7.3 Fixes for Testing (#2) +# Hey folks, I've been able to address a number of key issues reported thus-far +# related to the 0.7.3 beta version. The attached and updated client code will +# address these issues and allow you to continue testing 0.7.3 more effectively. +# +# In particular, this fix addresses: +# 1. Framerate improvements with large light sources +# 2. Scene offsets for shift-x and shift-y which caused fog/vision to be +# incorrectly masked +# 3. Chroma animation failures. +# 4. Auto-toggling of global illumination with the threshold value on the +# darkness slider. +# 5. A number of other fixes as listed in the "Closed" column of the 0.7.4 +# milestone: https://gitlab.com/foundrynet/foundryvtt/-/milestones/63 + +PATCH_DEST="$FOUNDRY_HOME/resources/app/public/scripts/foundry.js" +PATCH_DOC_URL="https://discordapp.com/channels/170995199584108546/760675730848743435/761380315720974386" +PATCH_NAME="Experimental Hotfix 2020101001 for 0.7.3" +PATCH_URL="https://cdn.discordapp.com/attachments/760675730848743435/761380315419115570/foundry.js" +TARGET_FOUNDRY_VERSION="0.7.3" + +if [ "$FOUNDRY_VERSION" = "$TARGET_FOUNDRY_VERSION" ]; then + log "Applying \"${PATCH_NAME}\"" + log "See: ${PATCH_DOC_URL}" + curl --output "${PATCH_DEST}" "${PATCH_URL}" 2>&1 | tr "\r" "\n" +else + log_warn "Not applying \"${PATCH_NAME}\". This patch is targeted for Foundry Virtual Tabletop ${TARGET_FOUNDRY_VERSION}" +fi From 222894ea4fa290f92aaf5dfe213cbb538bbbc2e5 Mon Sep 17 00:00:00 2001 From: Felddy Date: Fri, 9 Oct 2020 16:58:28 -0400 Subject: [PATCH 23/40] Relax version pins. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58930785e..fde3b5770 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,7 @@ jobs: version=${{ steps.get_ver.outputs.version }} docker save $IMAGE_NAME:$version | gzip > dist/image.tar.gz - name: Upload artifacts - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v2 with: name: dist-pre-install path: dist @@ -111,7 +111,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.9 - name: Cache pip test requirements uses: actions/cache@v1 with: @@ -126,7 +126,7 @@ jobs: python -m pip install --upgrade pip pip install --upgrade --requirement requirements-test.txt - name: Download docker image artifact - uses: actions/download-artifact@v2.0.5 + uses: actions/download-artifact@v2 with: name: dist-normal path: dist-normal @@ -141,7 +141,7 @@ jobs: run: pytest --runslow - name: Upload data artifacts if: ${{ always() }} - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v2 with: name: data-normal path: data @@ -167,7 +167,7 @@ jobs: python -m pip install --upgrade pip pip install --upgrade --requirement requirements-test.txt - name: Download docker image artifact - uses: actions/download-artifact@v2.0.5 + uses: actions/download-artifact@v2 with: name: dist-pre-install path: dist-pre-install @@ -182,7 +182,7 @@ jobs: run: pytest --runslow - name: Upload data artifacts if: ${{ always() }} - uses: actions/upload-artifact@v2.2.0 + uses: actions/upload-artifact@v2 with: name: data-pre-install path: data From 7d0308fc82d156a5fc57d7f66dbc46aa9bb45ba2 Mon Sep 17 00:00:00 2001 From: Felddy Date: Fri, 9 Oct 2020 16:58:48 -0400 Subject: [PATCH 24/40] Bump Python version to 3.9 --- .github/workflows/prerelease.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 26d8aae93..1b09b2977 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Determine image version id: get_ver run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6738829aa..dc09757da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Determine image version id: get_ver run: | From 208976bd05f25929d9c21663360c0e540bbffb05 Mon Sep 17 00:00:00 2001 From: Felddy Date: Fri, 9 Oct 2020 17:05:40 -0400 Subject: [PATCH 25/40] Bump Python setup. Fixes: Error: Version 3.9 with arch x64 not found --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fde3b5770..e2e4c86ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,7 +109,7 @@ jobs: needs: [build-normal] steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2 with: python-version: 3.9 - name: Cache pip test requirements From fdb8d03b76bcd986172e174379498c852fd84d76 Mon Sep 17 00:00:00 2001 From: Felddy Date: Tue, 13 Oct 2020 21:09:32 -0400 Subject: [PATCH 26/40] Work around for docker/setup-buildx-action#27 Cache errors cause build errors. --- .github/workflows/prerelease.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 1b09b2977..03f3c6319 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -29,6 +29,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v1 with: + driver-opts: image=moby/buildkit:buildx-stable-1 version: latest - name: Log into docker registry run: docker login diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc09757da..7760e4724 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v1 with: + driver-opts: image=moby/buildkit:buildx-stable-1 version: latest - name: Log into docker registry run: docker login From 6871d389dd9772f42e614d2de0af95a826ac67a3 Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 14 Oct 2020 17:16:53 -0400 Subject: [PATCH 27/40] Add hotfix patch for 0.7.4 --- patches/hotfix_2020101401-0.7.4.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 patches/hotfix_2020101401-0.7.4.sh diff --git a/patches/hotfix_2020101401-0.7.4.sh b/patches/hotfix_2020101401-0.7.4.sh new file mode 100644 index 000000000..6ec5b2fd1 --- /dev/null +++ b/patches/hotfix_2020101401-0.7.4.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Experimental Hotfix +# ===================== +# Dealing with packages (worlds/systems/modules) which have invalid language +# declarations. +# There have been more cases than I expected of modules which declare an invalid +# languages in their manifest, which causes unanticipated failures in FVTT's +# initialization process. If you are stuck with that issue, applying the +# following patch will bypass the problem and produce some logging in the +# error.log file highlighting which module(s) are the culprits. + +PATCH_DEST="$FOUNDRY_HOME/resources/app/dist/packages/package.js" +PATCH_DOC_URL="https://discordapp.com/channels/170995199584108546/765691837938663484/765962667721883659" +PATCH_NAME="Experimental Hotfix 2020101401 for 0.7.4" +PATCH_URL="https://cdn.discordapp.com/attachments/765691837938663484/765962667772739614/package.js" +TARGET_FOUNDRY_VERSION="0.7.4" + +if [ "$FOUNDRY_VERSION" = "$TARGET_FOUNDRY_VERSION" ]; then + log "Applying \"${PATCH_NAME}\"" + log "See: ${PATCH_DOC_URL}" + curl --output "${PATCH_DEST}" "${PATCH_URL}" 2>&1 | tr "\r" "\n" +else + log_warn "Not applying \"${PATCH_NAME}\". This patch is targeted for Foundry Virtual Tabletop ${TARGET_FOUNDRY_VERSION}" +fi From 0439ba8b2d59cf9612a1c00ea702e4e51a4b3c62 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 13:47:36 -0400 Subject: [PATCH 28/40] Replace FOUNDRY_NO_UPDATE environment variable with --noupdate argument. This functionality is no longer available in the options.json file. Also, users have been confused when moving their configs to a new machine (no Docker) and cannot update. --- Dockerfile | 3 ++- README.md | 1 - src/launcher.sh | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 961fb6f5e..df3603741 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,7 +87,8 @@ VOLUME ["/data"] EXPOSE 30000/TCP ENTRYPOINT ["./entrypoint.sh"] -CMD ["resources/app/main.js", "--port=30000", "--headless", "--dataPath=/data"] +CMD ["resources/app/main.js", "--port=30000", "--headless", "--noupdate",\ + "--dataPath=/data"] HEALTHCHECK --start-period=3m --interval=30s --timeout=5s \ CMD /usr/bin/curl --cookie-jar healthcheck-cookiejar.txt \ --cookie healthcheck-cookiejar.txt --fail --silent \ diff --git a/README.md b/README.md index c17fdae93..9ae5d0449 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,6 @@ be of the form: `foundryvtt-0.6.6.zip` | FOUNDRY_GID | `gid` the deamon will be run under. | foundry | | FOUNDRY_HOSTNAME | A custom hostname to use in place of the host machine's public IP address when displaying the address of the game session. This allows for reverse proxies or DNS servers to modify the public address. | null | | FOUNDRY_LICENSE_KEY | The license key to install. e.g.; `AAAA-BBBB-CCCC-DDDD-EEEE-FFFF` If left unset, a license key will be fetched when using account authentication. If multiple license keys are associated with an account, one will be chosen at random. Specific licenses can be selected by passing in an integer index. The first license key being `1`. May be set [using secrets](#using-secrets). | | -| FOUNDRY_NO_UPDATE | Prevent the application from being updated from the web interface. The application code is immutable when running in a container. See the [Updating](#updating) section for the steps needed to update this container. | true | | FOUNDRY_PROXY_PORT | Inform the Foundry Server that the software is running behind a reverse proxy on some other port. This allows the invitation links created to the game to include the correct external port. | null | | FOUNDRY_PROXY_SSL | Indicates whether the software is running behind a reverse proxy that uses SSL. This allows invitation links and A/V functionality to work as if the Foundry Server had SSL configured directly. | false | | FOUNDRY_ROUTE_PREFIX | A string path which is appended to the base hostname to serve Foundry VTT content from a specific namespace. For example setting this to `demo` will result in data being served from `http://x.x.x.x:30000/demo/`. | null | diff --git a/src/launcher.sh b/src/launcher.sh index 7fb6b9ca1..e068b5dcc 100755 --- a/src/launcher.sh +++ b/src/launcher.sh @@ -53,7 +53,6 @@ cat < /data/Config/options.json "dataPath": "/data", "fullscreen": false, "hostname": ${FOUNDRY_HOSTNAME:-null}, - "noUpdate": ${FOUNDRY_NO_UPDATE:-true}, "port": 30000, "proxyPort": ${FOUNDRY_PROXY_PORT:-null}, "proxySSL": ${FOUNDRY_PROXY_SSL:-false}, From b27dc821bb38fb081d837e8521008895a3c3da4e Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 14:17:26 -0400 Subject: [PATCH 29/40] Move health check to script and honor routing prefix. --- Dockerfile | 6 ++---- src/check_health.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100755 src/check_health.sh diff --git a/Dockerfile b/Dockerfile index df3603741..71b0eacc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,6 +64,7 @@ WORKDIR ${FOUNDRY_HOME} COPY --from=optional-release-stage /root/dist/ . COPY \ src/authenticate.js \ + src/check_health.sh \ src/entrypoint.sh \ src/get_license.js \ src/get_release_url.js \ @@ -89,7 +90,4 @@ EXPOSE 30000/TCP ENTRYPOINT ["./entrypoint.sh"] CMD ["resources/app/main.js", "--port=30000", "--headless", "--noupdate",\ "--dataPath=/data"] -HEALTHCHECK --start-period=3m --interval=30s --timeout=5s \ - CMD /usr/bin/curl --cookie-jar healthcheck-cookiejar.txt \ - --cookie healthcheck-cookiejar.txt --fail --silent \ - http://localhost:30000/api/status || exit 1 +HEALTHCHECK --start-period=3m --interval=30s --timeout=5s CMD ./check_health.sh diff --git a/src/check_health.sh b/src/check_health.sh new file mode 100755 index 000000000..8ccb3909c --- /dev/null +++ b/src/check_health.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ "${FOUNDRY_ROUTE_PREFIX:-}" ]; then + STATUS_URL="http://localhost:30000/${FOUNDRY_ROUTE_PREFIX}/api/status" +else + STATUS_URL="http://localhost:30000/api/status" +fi + +/usr/bin/curl --cookie-jar healthcheck-cookiejar.txt \ + --cookie healthcheck-cookiejar.txt --fail --silent "${STATUS_URL}" || exit 1 From 6a449147a8900cb75ce25a04d998d20630d71cf1 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 14:28:14 -0400 Subject: [PATCH 30/40] Remove FOUNDRY_NO_UPDATE references. --- docker-compose.yml | 1 - src/entrypoint.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 74c3e82a6..61bbd05da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,7 +22,6 @@ services: # - FOUNDRY_GID=foundry # - FOUNDRY_HOSTNAME= # - FOUNDRY_LICENSE_KEY= - # - FOUNDRY_NO_UPDATE=true # - FOUNDRY_PROXY_PORT= # - FOUNDRY_PROXY_SSL=false # - FOUNDRY_RELEASE_URL= diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 57cf70881..db8c6101d 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -178,7 +178,7 @@ fi # drop privileges and handoff to launcher log "Starting launcher with uid:gid as ${FOUNDRY_UID:-foundry}:${FOUNDRY_GID:-foundry}." -export FOUNDRY_ADMIN_KEY FOUNDRY_AWS_CONFIG FOUNDRY_HOSTNAME FOUNDRY_NO_UPDATE \ +export FOUNDRY_ADMIN_KEY FOUNDRY_AWS_CONFIG FOUNDRY_HOSTNAME \ FOUNDRY_PROXY_PORT FOUNDRY_PROXY_SSL FOUNDRY_ROUTE_PREFIX FOUNDRY_SSL_CERT \ FOUNDRY_SSL_KEY FOUNDRY_UPDATE_CHANNEL FOUNDRY_UPNP FOUNDRY_WORLD su-exec "${FOUNDRY_UID:-foundry}:${FOUNDRY_GID:-foundry}" ./launcher.sh "$@" From 48e04a551879352a62596a5dec1e9bd825feca39 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 16:43:32 -0400 Subject: [PATCH 31/40] Migrate to new unified build workflow. --- .github/workflows/build.yml | 303 ++++++++++++++++++++++++++----- .github/workflows/prerelease.yml | 59 ------ .github/workflows/release.yml | 62 ------- Dockerfile | 12 -- docker-compose-pytest.yml | 4 +- image_tags.sh | 8 + 6 files changed, 272 insertions(+), 176 deletions(-) delete mode 100644 .github/workflows/prerelease.yml delete mode 100644 .github/workflows/release.yml create mode 100644 image_tags.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2e4c86ee..71eb2ac19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,21 +1,40 @@ --- name: build +# https://github.com/docker/build-push-action#complete-workflow on: push: + branches: + - '**' + tags: + - 'v*.*.*' pull_request: + schedule: + - cron: '0 10 * * *' # everyday at 10am repository_dispatch: types: [apb] + workflow_dispatch: + inputs: + remote-shell: + description: "Debug with remote shell" + required: true + default: false + image-tag: + description: "Tag to apply to pushed images" + required: true + default: dispatch env: - FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }} - FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }} + BUILDX_CACHE_DIR: ~/.cache/buildx IMAGE_NAME: felddy/foundryvtt PIP_CACHE_DIR: ~/.cache/pip + PLATFORMS: "linux/amd64,linux/arm/v6,linux/arm/v7,\ + linux/arm64,linux/ppc64le,linux/s390x" PRE_COMMIT_CACHE_DIR: ~/.cache/pre-commit jobs: lint: + name: "Lint sources" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -48,57 +67,188 @@ jobs: run: pre-commit install-hooks - name: Run pre-commit on all files run: pre-commit run --all-files - build-normal: + prepare: + name: "Prepare build variables" runs-on: ubuntu-latest + outputs: + created: ${{ steps.prep.outputs.created }} + repometa: ${{ steps.repo.outputs.result }} + source_version: ${{ steps.prep.outputs.source_version }} + tags: ${{ steps.prep.outputs.tags }} steps: - uses: actions/checkout@v2 - - name: Determine image version - id: get_ver - run: | - echo "##[set-output name=version;]$(./bump_version.sh show)" - - name: Build docker image - run: | - version=${{ steps.get_ver.outputs.version }} - docker build \ - --tag "$IMAGE_NAME:$version" \ - --build-arg GIT_COMMIT=$(git log -1 --format=%H) \ - --build-arg GIT_REMOTE=$(git remote get-url origin) \ - --build-arg VERSION="$version" \ - . - - name: Save docker image artifact + - name: Gather repository metadata + id: repo + uses: actions/github-script@v3 + with: + script: | + const repo = await github.repos.get(context.repo) + return repo.data + - name: Calculate output values + id: prep run: | - mkdir dist - version=${{ steps.get_ver.outputs.version }} - docker save $IMAGE_NAME:$version | gzip > dist/image.tar.gz + VERSION=noop + SEMVER="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$" + if [ "${{ github.event_name }}" = "schedule" ]; then + VERSION=nightly + elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + VERSION=${{ github.event.inputs.image-tag }} + elif [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + elif [[ $GITHUB_REF == refs/heads/* ]]; then + VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') + if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; + then + VERSION=edge + fi + elif [[ $GITHUB_REF == refs/pull/* ]]; then + VERSION=pr-${{ github.event.number }} + fi + if [[ $VERSION =~ $SEMVER ]]; then + VERSION_NO_V=${VERSION#v} + MAJOR="${BASH_REMATCH[1]}" + MINOR="${BASH_REMATCH[2]}" + PATCH="${BASH_REMATCH[3]}" + TAGS="${IMAGE_NAME}:${VERSION_NO_V//+/_},${IMAGE_NAME}:${MAJOR}.${MINOR}.${PATCH},${IMAGE_NAME}:${MAJOR}.${MINOR},${IMAGE_NAME}:${MAJOR}" + source image_tags.sh + else + TAGS="${IMAGE_NAME}:${VERSION}" + fi + if [ "${{ github.event_name }}" = "push" ]; then + TAGS="${TAGS},${IMAGE_NAME}:sha-${GITHUB_SHA::8}" + fi + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + echo ::set-output name=source_version::$(./bump_version.sh show) + echo ::set-output name=tags::${TAGS} + echo tags=${TAGS} + - name: Setup debug session remote shell + uses: mxschmitt/action-tmate@v3 + if: github.event.inputs.remote-shell == 'true' + build-normal: + name: "Build normal test image" + runs-on: ubuntu-latest + needs: [prepare] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: image=moby/buildkit:buildx-stable-1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: ${{ env.BUILDX_CACHE_DIR }} + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Create dist directory + run: mkdir -p dist + - name: Build images + id: docker_build + uses: docker/build-push-action@v2 + with: + build-args: + VERSION: ${{ needs.prepare.outputs.source_version }} + cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} + cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} + context: . + file: ./Dockerfile + outputs: type=docker,dest=dist/image.tar + tags: ${{ env.IMAGE_NAME }}:latest # not to be pushed + labels: "\ + org.opencontainers.image.created=${{ + needs.prepare.outputs.created }} + + org.opencontainers.image.description=${{ + fromJson(needs.prepare.outputs.repometa).description }} + + org.opencontainers.image.licenses=${{ + fromJson(needs.prepare.outputs.repometa).license.spdx_id }} + + org.opencontainers.image.revision=${{ github.sha }} + + org.opencontainers.image.source=${{ + fromJson(needs.prepare.outputs.repometa).clone_url }} + + org.opencontainers.image.title=${{ + fromJson(needs.prepare.outputs.repometa).name }} + + org.opencontainers.image.url=${{ + fromJson(needs.prepare.outputs.repometa).html_url }} + + org.opencontainers.image.version=${{ + needs.prepare.outputs.source_version }}" + - name: Compressing image + run: gzip dist/image.tar - name: Upload artifacts uses: actions/upload-artifact@v2 with: name: dist-normal path: dist build-pre-install: + name: "Build pre-installed test image" runs-on: ubuntu-latest + needs: [prepare] steps: - - uses: actions/checkout@v2 - - name: Determine image version - id: get_ver - run: | - echo "##[set-output name=version;]$(./bump_version.sh show)" - - name: Build docker image - run: | - version=${{ steps.get_ver.outputs.version }} - docker build \ - --tag "$IMAGE_NAME:$version" \ - --build-arg GIT_COMMIT=$(git log -1 --format=%H) \ - --build-arg GIT_REMOTE=$(git remote get-url origin) \ - --build-arg VERSION="$version" \ - --build-arg FOUNDRY_PASSWORD \ - --build-arg FOUNDRY_USERNAME \ - . - - name: Save docker image artifact - run: | - mkdir dist - version=${{ steps.get_ver.outputs.version }} - docker save $IMAGE_NAME:$version | gzip > dist/image.tar.gz + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: image=moby/buildkit:buildx-stable-1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: ${{ env.BUILDX_CACHE_DIR }} + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Create dist directory + run: mkdir -p dist + - name: Build images + id: docker_build + uses: docker/build-push-action@v2 + with: + build-args: + FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }} + FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }} + VERSION: ${{ needs.prepare.outputs.source_version }} + cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} + cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} + context: . + file: ./Dockerfile + outputs: type=docker,dest=dist/image.tar + tags: ${{ env.IMAGE_NAME }}:latest # not to be pushed + labels: "\ + org.opencontainers.image.created=${{ + needs.prepare.outputs.created }} + + org.opencontainers.image.description=${{ + fromJson(needs.prepare.outputs.repometa).description }} + + org.opencontainers.image.licenses=${{ + fromJson(needs.prepare.outputs.repometa).license.spdx_id }} + + org.opencontainers.image.revision=${{ github.sha }} + + org.opencontainers.image.source=${{ + fromJson(needs.prepare.outputs.repometa).clone_url }} + + org.opencontainers.image.title=${{ + fromJson(needs.prepare.outputs.repometa).name }} + + org.opencontainers.image.url=${{ + fromJson(needs.prepare.outputs.repometa).html_url }} + + org.opencontainers.image.version=${{ + needs.prepare.outputs.source_version }}" + - name: Compressing image + run: gzip dist/image.tar - name: Upload artifacts uses: actions/upload-artifact@v2 with: @@ -137,6 +287,8 @@ jobs: chmod a+rwx data - name: Run tests env: + FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }} + FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }} RELEASE_TAG: ${{ github.event.release.tag_name }} run: pytest --runslow - name: Upload data artifacts @@ -186,3 +338,72 @@ jobs: with: name: data-pre-install path: data + build-push-all: + name: "Build and push all platforms" + runs-on: ubuntu-latest + needs: [prepare, test-normal, test-pre-install] + if: github.event_name != 'pull_request' + steps: + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: image=moby/buildkit:buildx-stable-1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: ${{ env.BUILDX_CACHE_DIR }} + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Create cross-platform support Dockerfile-x + run: ./buildx-dockerfile.sh + - name: Build and push platform images to Docker Hub + id: docker_build + uses: docker/build-push-action@v2 + with: + build-args: + VERSION: ${{ needs.prepare.outputs.source_version }} + cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} + cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} + context: . + file: ./Dockerfile-x + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ needs.prepare.outputs.tags }} + labels: "\ + org.opencontainers.image.created=${{ + needs.prepare.outputs.created }} + + org.opencontainers.image.description=${{ + fromJson(needs.prepare.outputs.repometa).description }} + + org.opencontainers.image.licenses=${{ + fromJson(needs.prepare.outputs.repometa).license.spdx_id }} + + org.opencontainers.image.revision=${{ github.sha }} + + org.opencontainers.image.source=${{ + fromJson(needs.prepare.outputs.repometa).clone_url }} + + org.opencontainers.image.title=${{ + fromJson(needs.prepare.outputs.repometa).name }} + + org.opencontainers.image.url=${{ + fromJson(needs.prepare.outputs.repometa).html_url }} + + org.opencontainers.image.version=${{ + needs.prepare.outputs.source_version }}" + - name: Publish README.md to Docker Hub + env: + DOCKER_PW: ${{ secrets.DOCKER_USERNAME }} + DOCKER_USER: ${{ secrets.DOCKER_PASSWORD }} + run: ./push_readme.sh diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index 03f3c6319..000000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -name: prerelease - -on: - release: - types: [prereleased] - -env: - IMAGE_NAME: felddy/foundryvtt - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - PLATFORMS: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,\ - linux/arm64,linux/ppc64le,linux/s390x" - RUN_TMATE: ${{ secrets.RUN_TMATE }} - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Determine image version - id: get_ver - run: | - echo "##[set-output name=version;]$(./bump_version.sh show)" - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: image=moby/buildkit:buildx-stable-1 - version: latest - - name: Log into docker registry - run: docker login - --username "$DOCKER_USERNAME" - --password "$DOCKER_PASSWORD" - - name: Create cross-platform support Dockerfile-x - run: ./buildx-dockerfile.sh - - name: Build Docker images, tag, and publish - run: | - IFS='.' read -r v_major v_minor v_patch \ - <<< "${{ steps.get_ver.outputs.version }}" - docker buildx build \ - --file Dockerfile-x \ - --platform $PLATFORMS \ - --output "type=image,push=true" \ - --tag "${IMAGE_NAME}:${{ github.event.release.target_commitish }}" \ - --tag "${IMAGE_NAME}:${{ steps.get_ver.outputs.version }}" \ - --tag "${IMAGE_NAME}:${v_major}.${v_minor}" \ - --tag "${IMAGE_NAME}:${v_major}" \ - --build-arg CREATED_TIMESTAMP="$(date --rfc-3339=seconds)" \ - --build-arg GIT_COMMIT=$(git log -1 --format=%H) \ - --build-arg GIT_REMOTE=$(git remote get-url origin) \ - --build-arg VERSION=${{ steps.get_ver.outputs.version }} \ - . - - name: Setup tmate debug session - uses: mxschmitt/action-tmate@v3 - if: env.RUN_TMATE diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 7760e4724..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: release - -on: - release: - types: [released] - -env: - IMAGE_NAME: felddy/foundryvtt - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - PLATFORMS: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,\ - linux/arm64,linux/ppc64le,linux/s390x" - RUN_TMATE: ${{ secrets.RUN_TMATE }} - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Determine image version - id: get_ver - run: | - echo "##[set-output name=version;]$(./bump_version.sh show)" - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: image=moby/buildkit:buildx-stable-1 - version: latest - - name: Log into docker registry - run: docker login - --username "$DOCKER_USERNAME" - --password "$DOCKER_PASSWORD" - - name: Create cross-platform support Dockerfile-x - run: ./buildx-dockerfile.sh - - name: Build Docker images, tag, and publish - run: | - IFS='.' read -r v_major v_minor v_patch \ - <<< "${{ steps.get_ver.outputs.version }}" - docker buildx build \ - --file Dockerfile-x \ - --platform $PLATFORMS \ - --output "type=image,push=true" \ - --tag "${IMAGE_NAME}:${{ github.event.release.target_commitish }}" \ - --tag "${IMAGE_NAME}:latest" \ - --tag "${IMAGE_NAME}:${{ steps.get_ver.outputs.version }}" \ - --tag "${IMAGE_NAME}:${v_major}.${v_minor}" \ - --tag "${IMAGE_NAME}:${v_major}" \ - --build-arg CREATED_TIMESTAMP="$(date --rfc-3339=seconds)" \ - --build-arg GIT_COMMIT=$(git log -1 --format=%H) \ - --build-arg GIT_REMOTE=$(git remote get-url origin) \ - --build-arg VERSION=${{ steps.get_ver.outputs.version }} \ - . - - name: Publish README.md to Docker Hub - run: ./push_readme.sh - - name: Setup tmate debug session - uses: mxschmitt/action-tmate@v3 - if: env.RUN_TMATE diff --git a/Dockerfile b/Dockerfile index 71b0eacc8..aed420629 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,7 @@ -ARG CREATED_TIMESTAMP=unspecified ARG FOUNDRY_PASSWORD ARG FOUNDRY_RELEASE_URL ARG FOUNDRY_USERNAME ARG FOUNDRY_VERSION=0.6.6 -ARG GIT_COMMIT=unspecified -ARG GIT_REMOTE=unspecified ARG VERSION FROM node:12-alpine as optional-release-stage @@ -38,23 +35,14 @@ RUN \ FROM node:12-alpine as final-stage -ARG CREATED_TIMESTAMP=unspecified ARG FOUNDRY_UID=421 ARG FOUNDRY_VERSION -ARG GIT_COMMIT -ARG GIT_REMOTE ARG TARGETPLATFORM ARG VERSION LABEL com.foundryvtt.version=${FOUNDRY_VERSION} LABEL org.opencontainers.image.authors="markf+github@geekpad.com" -LABEL org.opencontainers.image.created=${CREATED_TIMESTAMP} -LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.revision=${GIT_COMMIT} -LABEL org.opencontainers.image.source=${GIT_REMOTE} -LABEL org.opencontainers.image.title="Foundry Virtual Tabletop" LABEL org.opencontainers.image.vendor="Geekpad" -LABEL org.opencontainers.image.version=${VERSION} ENV FOUNDRY_HOME="/home/foundry" ENV FOUNDRY_VERSION=${FOUNDRY_VERSION} diff --git a/docker-compose-pytest.yml b/docker-compose-pytest.yml index 2969ff097..c35dac6ee 100644 --- a/docker-compose-pytest.yml +++ b/docker-compose-pytest.yml @@ -5,7 +5,7 @@ version: "3.8" services: foundry: # Run the container normally - image: felddy/foundryvtt:0.6.6 + image: felddy/foundryvtt:latest hostname: felddy_foundryvtt init: true restart: "no" @@ -29,7 +29,7 @@ services: foundry-version: # Run the container to collect version information - image: felddy/foundryvtt:0.6.6 + image: felddy/foundryvtt:latest init: true restart: "no" command: --version diff --git a/image_tags.sh b/image_tags.sh new file mode 100644 index 000000000..59b942729 --- /dev/null +++ b/image_tags.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# This file is sourced by the build workflow when processing a branch or tag +# that is a semantic version. e.g; v1.2.3-pre+5 + +# Its purpose is to add branch-specific tags to an image. + +# TAGS="${TAGS},${IMAGE_NAME}:release,${IMAGE_NAME}:latest" From e351fd594eaeb6a3447ff7d61d60dd3c04440d57 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 16:48:47 -0400 Subject: [PATCH 32/40] Correct build-arg syntax. --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71eb2ac19..04ee70df9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -150,8 +150,8 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - build-args: - VERSION: ${{ needs.prepare.outputs.source_version }} + build-args: | + VERSION=${{ needs.prepare.outputs.source_version }} cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} context: . @@ -214,10 +214,10 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - build-args: - FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }} - FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }} - VERSION: ${{ needs.prepare.outputs.source_version }} + build-args: | + FOUNDRY_PASSWORD=${{ secrets.FOUNDRY_PASSWORD }} + FOUNDRY_USERNAME=${{ secrets.FOUNDRY_USERNAME }} + VERSION=${{ needs.prepare.outputs.source_version }} cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} context: . From 5203dc0fa2995e892005f40d70fdbbdb9a486405 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 16:49:52 -0400 Subject: [PATCH 33/40] Correct build-arg syntax. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04ee70df9..d07fdc383 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -370,8 +370,8 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - build-args: - VERSION: ${{ needs.prepare.outputs.source_version }} + build-args: | + VERSION=${{ needs.prepare.outputs.source_version }} cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }} cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }} context: . From e7d4f666b6b1f2f90c322b5841004e32a6c85085 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:11:55 -0400 Subject: [PATCH 34/40] Allow credential check to fail. Pre-built images do not have cred access. --- tests/container_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/container_test.py b/tests/container_test.py index d7451a103..721983eb9 100644 --- a/tests/container_test.py +++ b/tests/container_test.py @@ -21,9 +21,11 @@ def test_container_count(dockerc): ), "Wrong number of containers were started." +@pytest.mark.xfail def test_environment_credentials(main_container): """Verify enironment is set correctly.""" - # Check for required environment varaibles. + # Check for credential variables. + # These are not required for pre-built images. assert ( "FOUNDRY_USERNAME" in os.environ ), "FOUNDRY_USERNAME was not in the environment" From edb9d83b2f18b6a8d72f0aff03388bfc11e787bc Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:12:37 -0400 Subject: [PATCH 35/40] Rename build step to singular. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d07fdc383..f99757b55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,7 +146,7 @@ jobs: ${{ runner.os }}-buildx- - name: Create dist directory run: mkdir -p dist - - name: Build images + - name: Build image id: docker_build uses: docker/build-push-action@v2 with: @@ -210,7 +210,7 @@ jobs: ${{ runner.os }}-buildx- - name: Create dist directory run: mkdir -p dist - - name: Build images + - name: Build image id: docker_build uses: docker/build-push-action@v2 with: From 58b88dc4010e625b7a2ea1bfd36b3b8b7d2a037d Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:15:35 -0400 Subject: [PATCH 36/40] Normalize action verbs in step names. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f99757b55..07afddc58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,7 +181,7 @@ jobs: org.opencontainers.image.version=${{ needs.prepare.outputs.source_version }}" - - name: Compressing image + - name: Compress image run: gzip dist/image.tar - name: Upload artifacts uses: actions/upload-artifact@v2 @@ -247,7 +247,7 @@ jobs: org.opencontainers.image.version=${{ needs.prepare.outputs.source_version }}" - - name: Compressing image + - name: Compress image run: gzip dist/image.tar - name: Upload artifacts uses: actions/upload-artifact@v2 From 6e368f045379cea5e56355700c2b7094c42e9af2 Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:17:37 -0400 Subject: [PATCH 37/40] Remove 386 from platform shield. See: #84 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ae5d0449..44932f0d6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/felddy/foundryvtt)](https://hub.docker.com/r/felddy/foundryvtt) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/felddy/foundryvtt)](https://hub.docker.com/r/felddy/foundryvtt) -[![Platforms](https://img.shields.io/badge/platforms-386%20%7C%20amd64%20%7C%20arm%2Fv6%20%7C%20arm%2Fv7%20%7C%20arm64%20%7C%20ppc64le%20%7C%20s390x-blue)](https://hub.docker.com/r/felddy/foundryvtt/tags) +[![Platforms](https://img.shields.io/badge/platforms-amd64%20%7C%20arm%2Fv6%20%7C%20arm%2Fv7%20%7C%20arm64%20%7C%20ppc64le%20%7C%20s390x-blue)](https://hub.docker.com/r/felddy/foundryvtt/tags) You can get a [Foundry Virtual Tabletop](https://foundryvtt.com) instance up and running in minutes using this container. This Docker container is designed to From e2ef8e814d1a68aec0c57ef1237408b257943daa Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:19:29 -0400 Subject: [PATCH 38/40] Add names to test jobs. --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07afddc58..74dc64acc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,6 +255,7 @@ jobs: name: dist-pre-install path: dist test-normal: + name: "Test normal image" runs-on: ubuntu-latest needs: [build-normal] steps: @@ -298,6 +299,7 @@ jobs: name: data-normal path: data test-pre-install: + name: "Test pre-installed image" runs-on: ubuntu-latest needs: [build-pre-install] steps: From acf120851535830121ecbb8b17b04923ea8473bb Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 17:21:08 -0400 Subject: [PATCH 39/40] Set correct environment variables for push readme script. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74dc64acc..3ccb5ebcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -406,6 +406,6 @@ jobs: needs.prepare.outputs.source_version }}" - name: Publish README.md to Docker Hub env: - DOCKER_PW: ${{ secrets.DOCKER_USERNAME }} - DOCKER_USER: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} run: ./push_readme.sh From 6d4073553c62d4f2db6407de550d297f91e0c45f Mon Sep 17 00:00:00 2001 From: Felddy Date: Thu, 15 Oct 2020 21:56:52 -0400 Subject: [PATCH 40/40] Add hotfix for routePrefix issue 3817. --- patches/hotfix_issue_3817-0.7.4.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 patches/hotfix_issue_3817-0.7.4.sh diff --git a/patches/hotfix_issue_3817-0.7.4.sh b/patches/hotfix_issue_3817-0.7.4.sh new file mode 100644 index 000000000..e5471c8b5 --- /dev/null +++ b/patches/hotfix_issue_3817-0.7.4.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Issue Hotfix +# ===================== +# Corrects routePrefix problem detailed in issue 3817 +# https://gitlab.com/foundrynet/foundryvtt/-/issues/3817 + +# s/const view = url\.pathname\.replace(`\/\${ROUTE_PREFIX}`, "");\ +# /const view = url.pathname.split("\/").pop();/g + +PATCH_DEST="$FOUNDRY_HOME/resources/app/public/scripts/foundry.js" +PATCH_DOC_URL="https://gitlab.com/foundrynet/foundryvtt/-/issues/3817#note_430588341" +PATCH_NAME="Issue 3817 Hotfix for 0.7.4" +TARGET_FOUNDRY_VERSION="0.7.4" + +if [ "$FOUNDRY_VERSION" = "$TARGET_FOUNDRY_VERSION" ]; then + log "Applying \"${PATCH_NAME}\"" + log "See: ${PATCH_DOC_URL}" + sed --file=- --in-place=.orig "${PATCH_DEST}" << SED_SCRIPT +s/const view = url\.pathname\.replace(\`\/\${ROUTE_PREFIX}\`, "");\ +/const view = url.pathname.split("\/").pop();/g +SED_SCRIPT +else + log_warn "Not applying \"${PATCH_NAME}\". This patch is targeted for Foundry Virtual Tabletop ${TARGET_FOUNDRY_VERSION}" +fi