Rename to bin/dev-shell to avoid confusion

This commit is contained in:
Aleksandar Puharic 2024-05-20 21:58:24 +02:00
parent 650bdcb161
commit a24c5bd1a5
Signed by: xZero707
GPG Key ID: 3CC53DCAA9C237BB
4 changed files with 44 additions and 16 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.idea/
wordpress.iml
data/
build/patch-util/wp-src/
build/tests-util/composer.lock
build/tests-util/vendor/

19
Dockerfile.dev Normal file
View File

@ -0,0 +1,19 @@
ARG WP_VERSION=6.5.3
FROM scratch AS rootfs
# Install composer
COPY --from=composer:2.7 ["/usr/bin/composer", "/usr/local/bin/composer"]
ARG WP_VERSION
FROM ghcr.io/n0rthernl1ghts/wordpress:${WP_VERSION}
RUN set -eux \
&& apk add --update --no-cache exa file fish git less nano openssh-client rsync tree unzip wget
COPY --from=rootfs ["/", "/"]
WORKDIR "/workspace"
ENTRYPOINT ["/usr/bin/fish"]

24
bin/dev-shell Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# This is development util
main() {
local wpVersion="${1:-6.5.3}"
set -ex
docker build \
--file=Dockerfile.dev \
--build-arg="WP_VERSION=${wpVersion}" \
-t "localhost/nlss-wp-dev:${wpVersion}" .
docker run \
--init \
--rm \
-it \
-v "${PWD}/src/:/workspace" \
"localhost/nlss-wp-dev:${wpVersion}"
}
main "${@}"

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# This is development util
main() {
local wpVersion="${1:-latest}"
docker run \
--init \
--entrypoint="/bin/bash" \
--workdir="/app" \
--rm \
-it \
-v "${PWD}/src/init-utils:/app" \
"ghcr.io/n0rthernl1ghts/wordpress:${wpVersion}"
}
main "${@}"