Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/171 Posix compliant sourcing #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/docker/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ _docker: # Docker command wrapper - mandatory: cmd=[command to execute]; optiona
# 'DOCKER_IMAGE' and 'DOCKER_TITLE' are passed to the functions as environment variables
DOCKER_IMAGE=$(or ${DOCKER_IMAGE}, $(or ${docker_image}, $(or ${IMAGE}, $(or ${image}, ghcr.io/org/repo))))
DOCKER_TITLE=$(or "${DOCKER_TITLE}", $(or "${docker_title}", $(or "${TITLE}", $(or "${title}", "Service Docker image"))))
source scripts/docker/docker.lib.sh
. "scripts/docker/docker.lib.sh"
dir=$(realpath ${dir})
docker-${cmd} # 'dir' is accessible by the function as environment variable

Expand All @@ -41,7 +41,7 @@ docker-test-suite-run: # Run Docker test suite @ExamplesAndTests
scripts/docker/tests/docker.test.sh

docker-example-build: # Build Docker example @ExamplesAndTests
source scripts/docker/docker.lib.sh
. "scripts/docker/docker.lib.sh"
cd scripts/docker/examples/python
DOCKER_IMAGE=repository-template/docker-example-python
DOCKER_TITLE="Repository Template Docker Python Example"
Expand All @@ -53,7 +53,7 @@ docker-example-lint: # Lint Docker example @ExamplesAndTests
file=$${dockerfile} scripts/docker/dockerfile-linter.sh

docker-example-run: # Run Docker example @ExamplesAndTests
source scripts/docker/docker.lib.sh
. "scripts/docker/docker.lib.sh"
cd scripts/docker/examples/python
DOCKER_IMAGE=repository-template/docker-example-python
args=" \
Expand All @@ -63,7 +63,7 @@ docker-example-run: # Run Docker example @ExamplesAndTests
docker-run

docker-example-clean: # Remove Docker example resources @ExamplesAndTests
source scripts/docker/docker.lib.sh
. "scripts/docker/docker.lib.sh"
cd scripts/docker/examples/python
DOCKER_IMAGE=repository-template/docker-example-python
docker-clean
Expand Down
4 changes: 2 additions & 2 deletions scripts/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include scripts/tests/test.mk
# ==============================================================================

runner-act: # Run GitHub Actions locally - mandatory: workflow=[workflow file name], job=[job name] @Development
source ./scripts/docker/docker.lib.sh
. "./scripts/docker/docker.lib.sh"
act $(shell [[ "${VERBOSE}" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]] && echo --verbose) \
--container-architecture linux/amd64 \
--platform ubuntu-latest=$$(name="ghcr.io/nhs-england-tools/github-runner-image" docker-get-image-version-and-pull) \
Expand All @@ -21,7 +21,7 @@ runner-act: # Run GitHub Actions locally - mandatory: workflow=[workflow file na
--job ${job}

version-create-effective-file: # Create effective version file - optional: dir=[path to the VERSION file to use, default is '.'], BUILD_DATETIME=[build date and time in the '%Y-%m-%dT%H:%M:%S%z' format generated by the CI/CD pipeline, default is current date and time] @Development
source scripts/docker/docker.lib.sh
. "scripts/docker/docker.lib.sh"
version-create-effective-file

shellscript-lint-all: # Lint all shell scripts in this project, do not fail on error, just print the error messages @Quality
Expand Down
2 changes: 1 addition & 1 deletion scripts/terraform/terraform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ clean:: # Remove Terraform files (terraform) - optional: terraform_dir|dir=[path

_terraform: # Terraform command wrapper - mandatory: cmd=[command to execute]; optional: dir=[path to a directory where the command will be executed, relative to the project's top-level directory, default is one of the module variables or the example directory, if not set], opts=[options to pass to the Terraform command, default is none/empty]
dir=$(or ${dir}, ${TERRAFORM_STACK})
source scripts/terraform/terraform.lib.sh
. "scripts/terraform/terraform.lib.sh"
terraform-${cmd} # 'dir' and 'opts' are accessible by the function as environment variables, if set

# ==============================================================================
Expand Down
Loading