forked from puppetlabs/pupperware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(CPR-645) Setup Windows compose tests
- Add Azure Pipelines invocation to prep for specs, to run `bundle exec rspec spec` for basic smoke tests, to collect the Junit output using an Azure Pipelines task, and to issue cleanup commands to purge dangling containers / images regardless of the success / failure of prior steps. This prevents aborted jobs from cluttering. - Add a default docker-compose.override.yml which includes Linux specific configuration for 2 things: * the image of puppet/puppetdb-postgres * the container path for the local ./volumes/puppetdb-postgres/data With `docker-compose up` called, these settings are consumed by default. - Windows specific changes to the default config reside in docker-compose.windows.yml and as part of the Azure pipeline job, are copied *over* docker-compose.override.yml to take effect. Note that there are no builds of the puppetdb-postgres container for Windows as the VOLUME support required for the base postgres container does not currently work on Windows. Instead, use a Windows based postgres container that mimics the official container / supports all of the configuration ENV vars. - The minor changes for postgres support in docker-compose.windows.yml also includes mounting a local directory containting SQL scripts to run when postgres starts (using \docker-entrypoint-initdb.d). Further, it sets POSTGRES_DB=puppetdb to create the default database. The extensions.sql script contains the SQL necessary to add 2 extensions to the puppetdb database that are currently handled in the puppetdb-postgres container. This sets the stage for moving from that container to the official postgres container. - Lastly, the Windows specific docker-compose.windows.yml sets up a custom alias in the "default" network so that an extra DNS name for puppetserver can be set based on the FQDN that Facter determines. Without this additional DNS reservation, the `puppetserver ca` command will be unable to connect to the REST endpoint. A better long-term solution is making sure puppetserver is setup to point to `puppet` as the host instead of an FQDN. - Fix health check in specs on Windows based on how docker inspect works for Windows - Fix spec that requests a --tty since that doesn't work on Windows. - Update README accordingly
- Loading branch information
Showing
7 changed files
with
93 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
image: puppet/puppetdb-postgres | ||
volumes: | ||
- ./volumes/puppetdb-postgres/data:/var/lib/postgresql/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
version: '2' | ||
version: '3' | ||
|
||
services: | ||
puppet: | ||
networks: | ||
default: | ||
aliases: | ||
- puppet.${AZURE_DOMAIN} | ||
|
||
postgres: | ||
image: stellirin/postgres-windows:9.6 | ||
environment: | ||
- PGDATA=c:\data | ||
volumes: | ||
- puppetdb-postgres-volume:/var/lib/postgresql/data/ | ||
|
||
# An external volume is needed for postgres as when under Docker For Windows the files have a different | ||
# owner that the starting process. | ||
# ref: https://forums.docker.com/t/trying-to-get-postgres-to-work-on-persistent-windows-mount-two-issues/12456/4 | ||
# | ||
# To create the volume use; docker volume create --name puppetdb-postgres-volume -d local | ||
# To delete the volume use; docker volume rm puppetdb-postgres-volume | ||
volumes: | ||
puppetdb-postgres-volume: | ||
external: true | ||
- ./volumes/puppetdb-postgres/data:c:\data | ||
- ./postgres-custom:c:\docker-entrypoint-initdb.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
CREATE EXTENSION IF NOT EXISTS pgcrypto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters