Skip to content

Commit

Permalink
Merge branch 'main' into create-pull-request/patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiefHolland authored Aug 31, 2023
2 parents 4da0a46 + 42b64bd commit e147097
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
8 changes: 6 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ includes:
PYTHON_VERSION: '{{.PYTHON_VERSION}}'
VERSION: '{{.VERSION}}'

terraform:
taskfile: ./goat/Task/terraform/Taskfile.yml
internal: true
optional: true

vars:
IMAGE_NAME: seiso/easy_infra
PROJECT_SLUG: easy_infra
Expand Down Expand Up @@ -200,12 +205,11 @@ tasks:
desc: Clean up build artifacts, cache files/directories, temp files, etc.
cmds:
- task: py:clean
- task: terraform:clean
- task: easy_infra_cleanup

easy_infra_cleanup:
desc: Cleanup specific to easy_infra
cmds:
- find "{{.ROOT_DIR}}" -type f -name '.terraform.lock.hcl' -delete
- find "{{.ROOT_DIR}}" -type d -name '.terraform' -exec rm -rf {} +
- rm -f '{{.ROOT_DIR}}/build/functions'
- rm -f '{{.ROOT_DIR}}/build/Dockerfile'
4 changes: 4 additions & 0 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ function _log() {


function _feedback() {
if [[ "${SILENT,,}" == "true" ]]; then
return
fi

local timestamp
timestamp="$(date --iso-8601=seconds --utc)"
# Use the provided color code label
Expand Down
12 changes: 10 additions & 2 deletions docs/Logging/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ If you'd like to run ``terraform validate`` on terraform stored in your current
``AWS_ACCESS_KEY_ID``, ``AWS_SECRET_ACCESS_KEY``, and any other AWS environment variables (including ``AWS_SESSION_TOKEN`` if you are assuming a role)
environment variables as defined `here<https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html>_` and run the following::

docker run --env-file <(env | grep -E '^CW_|^AWS_') -v $(pwd)/fluent-bit.cw_example.conf:/usr/local/etc/fluent-bit/fluent-bit.outputs.conf seiso/easy_infra:latest terraform validate
docker run --env-file <(env | grep -E '^CW_|^AWS_') -v $(pwd)/fluent-bit.cw_example.conf:/usr/local/etc/fluent-bit/fluent-bit.outputs.conf seiso/easy_infra:latest-terraform terraform validate

The contents of ``fluent-bit.cw_example.conf`` here are as follows::

Expand All @@ -66,4 +66,12 @@ The contents of ``fluent-bit.cw_example.conf`` here are as follows::
Auto_create_group true

For more details on the fluent-bit Amazon CloudWatch output plugin, including features like cross account role assumption, see `this page
<https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch>`_.
<https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch>`_.

easy_infra output
-----------------

``easy_infra`` sends some contextual information to stdout/stderr. If you want to disable this output, pass in the environment variable ``SILENT`` with a value
of ``true``, for instance:

docker run -e SILENT=true seiso/easy_infra:latest-terraform /bin/bash -c "terraform output | jq -r '.example.value'"
10 changes: 5 additions & 5 deletions docs/Technical Details/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ run ``command terraform`` which runs the ``terraform`` binary from the ``PATH``.
Marking Git Directories Safe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As of git version `2.35.2 <https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9>`_, git safe.directory was added to mitigate
CVE-2022-24765; however, support for configuration of safe directories via environment variables was not added until `2.38.0 <https://github.com/git/git/commit/6061601d9f1f1c95da5f9304c319218f7cc3ec75>`_.
As of git version `2.35.2 <https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9>`_, git safe.directory was added to mitigate
CVE-2022-24765; however, support for configuration of safe directories via environment variables was not added until `2.38.0 <https://github.com/git/git/commit/6061601d9f1f1c95da5f9304c319218f7cc3ec75>`_.
We decided using environment variables was best way to do this, because it is the most dynamic.

Mounted directories must be considered "safe" by git, in order for logging to function properly. When mounting a .git folder into the container,
Mounted directories must be considered "safe" by git, in order for logging to function properly. When mounting a .git folder into the container,
the following variables work together to flag it as a safe directory for git::

export GIT_CONFIG_COUNT=1
Expand All @@ -251,7 +251,7 @@ the following variables work together to flag it as a safe directory for git::

.. note::

We set all of these vars once immediately after setting the hooks and then refresh the GIT_CONFIG_VALUE_0 for each iteration of the dirs loop
We set all of these vars once immediately after setting the hooks and then refresh the GIT_CONFIG_VALUE_0 for each iteration of the dirs loop
to accommodate ``AUTODETECT=True``.

Internal naming
Expand Down Expand Up @@ -342,4 +342,4 @@ Adding a tool

.. note::
If you need any special configuration at build time specific to the combination of a tool and an environment, you can create a
``Dockerfile.{tool}-{environment}`` and ``Dockerfrag.{tool}-{environment}``. These are entirely optional.
``Dockerfile.{tool}-{environment}`` and ``Dockerfrag.{tool}-{environment}``. These are entirely optional.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
author = "Jon Zeolla"

# The full version, including alpha/beta/rc tags
release = "2023.08.18"
release = "2023.08.19"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion easy_infra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__maintainer__ = "Seiso"
__copyright__ = "(c) 2022 Seiso, LLC"
__project_name__ = "easy_infra"
__version__ = "2023.08.18"
__version__ = "2023.08.19"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2023.08.18
current_version = 2023.08.19
parse = (?P<year>2[0-1]\d{2})\.(?P<month>(0\d|1[0-2]))(.(?P<increment>\d{2}))?
serialize = {year}.{month}.{increment}
commit = True
Expand Down

0 comments on commit e147097

Please sign in to comment.