Skip to content

Commit

Permalink
Renamed seed script to seed.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Dec 2, 2024
1 parent 81b6c88 commit ad9a105
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- run:
name: Lint scripts
command: |
shfmt -i 2 -ci -s -d seed-db.sh tests/bats/*.bash tests/bats/*.bats
shellcheck seed-db.sh tests/bats/*.bash tests/bats/*.bats
shfmt -i 2 -ci -s -d seed.sh tests/bats/*.bash tests/bats/*.bats
shellcheck seed.sh tests/bats/*.bash tests/bats/*.bats
- setup_remote_docker

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ imports.

## Seeding image with your database

`./seed-db.sh` allows to easily create your own image with a "seeded" database.
`./seed.sh` allows to easily create your own image with a "seeded" database.

```shell
./seed-db.sh path/to/db.sql myorg/myimage:latest # Build and push an image to the registry
./seed.sh path/to/db.sql myorg/myimage:latest # Build and push an image to the registry
```

In some cases, shell may report platform incorrectly. Run with forced platform:

```shell
DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed-db.sh path/to/db.sql myorg/myimage:latest
DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed.sh path/to/db.sql myorg/myimage:latest
```

Note that you should already be logged in to the registry as `seed-db.sh` will be pushing an image.
Note that you should already be logged in to the registry as `seed.sh` will be pushing an image.

## Maintenance

Expand Down
6 changes: 3 additions & 3 deletions seed-db.sh → seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
# 3. Start a container from the new image and verify that the database was imported.
#
# Usage:
# ./seed-db.sh path/to/db.sql myorg/myimage:latest
# ./seed.sh path/to/db.sql myorg/myimage:latest
#
# DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed-db.sh path/to/db.sql myorg/myimage:latest
# DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed.sh path/to/db.sql myorg/myimage:latest
#
# shellcheck disable=SC2002,SC2015

Expand All @@ -30,7 +30,7 @@ BASE_IMAGE="${BASE_IMAGE:-drevops/mariadb-drupal-data:latest}"

# Docker target platform architecture.
# Note that some shells report platform incorrectly. In such cases, run
# as `DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed-db.sh path/to/db.sql myorg/myimage:latest`
# as `DOCKER_DEFAULT_PLATFORM=linux/amd64 ./seed.sh path/to/db.sql myorg/myimage:latest`
DOCKER_DEFAULT_PLATFORM="${DOCKER_DEFAULT_PLATFORM:-}"

# Destination platforms to build for.
Expand Down
2 changes: 1 addition & 1 deletion tests/bats/seed.bats
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ load _helper
# from the seeding process.
export DESTINATION_PLATFORMS="${BUILDX_PLATFORMS}"
substep "Run DB seeding script for ${dst_image} from the base image ${BASE_IMAGE} for destination platform(s) ${DESTINATION_PLATFORMS}."
./seed-db.sh "${file}" "${dst_image}" >&3
./seed.sh "${file}" "${dst_image}" >&3

substep "Start container from the seeded image ${dst_image}."
# Start container with a non-root user to imitate limited host permissions.
Expand Down

0 comments on commit ad9a105

Please sign in to comment.