* fix(docker): fix base image for multi-platform build (#2099)
* Correct indentation of run commands
* Split installation of packages into the ones needed at run time and build time
This allows us to now repeat the packages which need to be uninstalled again by
making use of a virtual package, which - when removed - removes the packages
installed as a dependency of it.
* Remove unnecessary `rm -rf /var/cache/apk/*` command
It's no needed when `apt add` is run with the `--no-cache` option.
* Add vertical spacing so it's clearer what is happening when
* Test the downloaded binaries to make sure they work on the platform
This can help find issues where binaries are downloaded for the wrong platform
compared to the architecture the Docker image is built for.
* Install dumb-init via apk
It's available as a package for Alpine Linux in version 1.2.5 as well, which
makes it easier to handle for the different architectures.
* Get git-lfs binaries in the right architecture for the Docker image
This makes use of the `TARGETPLATFORM` argument which automatically is
populated by Docker BuildKit with a string such as "linux/amd64" when the image
is being build for an x86_64 architecture.
* Install gosu for the right architecture
The `case` statement was taken from
https://github.com/BretFisher/multi-platform-docker-build as a way of
translating the platform name into what we needed for downloading gosu.
* fix(docker): fix installation of git-lfs in armv7 image (#2100)
This uses a similar pattern than what is used for `GOSU_ARCH` to map the
`TARGETPLATFORM` argument into the name of the architecture git-lfs use for
their release binaries, as "linux/arm/v7" otherwise would be mapped into "v7"
which is wrong.
* fix(docker): download Terraform and conftest versions maching image architecture (#2101)
* Remove Terraform versions from Docker image which don't have all archs
Terraform versions earlier than 0.11.15 does not have binaries available for
both amd64, arm64 and armv7, so are being dropped as we can't install the older
versions in all the architectures the Docker image is built for.
* Download Terraform version depending on the architecture Docker image is for
This avoids us having arm64 binaries for the ARM Docker images, which won't
work.
* Download arm64 conftest binaries for arm64 Docker image
This doesn't fix the armv7 Docker image because conftest doesn't have a binary
available for that, so it for now still downloads the x86_64 binary, which is
likely to not work - but it's the same as it did before.
* Correct path to dumb-init in docker-entrypoint.sh
The path changed after dumb-init was switched to be installed via `apk` rather
than downloaded directly as a binary.
* Remove Terraform versions from Docker image which don't have all archs
Terraform versions earlier than 0.11.15 does not have binaries available for
both amd64, arm64 and armv7, so are being dropped as we can't install the older
versions in all the architectures the Docker image is built for.
* Download Terraform version depending on the architecture Docker image is for
This avoids us having arm64 binaries for the ARM Docker images, which won't
work.
* Download arm64 conftest binaries for arm64 Docker image
This doesn't fix the armv7 Docker image because conftest doesn't have a binary
available for that, so it for now still downloads the x86_64 binary, which is
likely to not work - but it's the same as it did before.
* chore: bump terraform version to latest 0.15.0
* chore: add v0.14.10 to available versions list
* chore: fix trailing zero typo
* chore: bump to 0.15.1 now that its released
* chore: bump 0.14.x version which updates Hashicorp public key
* chore: bump 0.13.x version which updates Hashicorp public key
* chore: bump 0.12.x version which updates Hashicorp public key
* Upgraded conftest to 0.23.0 and removed --all-namespaces flag (#62)
* Upgraded conftest to 0.23.0 and removed --all-namespaces flag
* fix tests
* fix conftest version name
* make tests pass
* Update e2e tests to use 0.23 conftest
* Fix log function
* Make test client fetch version synchronously.
* Update fixtures.
* Pinning test image
Co-authored-by: Nish Krishnan <nishk@lyft.com>
* Adding policy_check support into yaml config
* Added policy check model and runtime structs
* Adding BuildPolicyCheckCommand to ProjectCommandBuilder
* Return incorrectly deleted code
* Remove BuildAutoPolicyPlanCommand from ProjectCommandBuilder
* Split runAutoCommand into two functions
runAutoPlanCommand - does what originally RunAutoplancommand was doing
except now it returns CommandResult and []models.ProjectCommandContext
runAutoPolicyCheckCommand - accepts CommandContext, CommandResult, and
[]models.ProjectCommandContext as arguments and runs PolicyCheckStep runner
* Refactor RunCommentCommand
* Remove BuildPolicyCheckCommand and rename StepCmdExec back to TerraformExec
* Add policy step runner logic and conftest interfaces.
* Add show step runner to policy check stage.
* Adding models.PolicyCheckCommand to buildCtx
This also means buildPlanAllCommands call buildCtx twice once with
models.PlanCommand and once with models.PolicyCheckCommand
* Adding new project_command_builder that supports policy_check
* Refactoring PolicyCheck specific logic into a PolicyCheckProjectCommandBuilder
* Moving events.CommandContext to models.CommandContext this will allow me
to remove buildCtx method and move ProjectCommandContext creation into
models package
* Policy Owners might be different types, for that reason we are
refactoring Owners into its own struct with specific keys defining
different owner types
Co-authored-by: Nish Krishnan <nishk@lyft.com>
Co-authored-by: Nish Krishnan <nishkrishnan@users.noreply.github.com>