Skip to content

Commit

Permalink
Update container name
Browse files Browse the repository at this point in the history
  • Loading branch information
sanG-github committed Jan 26, 2024
1 parent 5fa8a99 commit a878f3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .template/spec/support/serverspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ module ServerSpecHelpers
# Prebuild and run docker image before running the test
# Because the docker api does not support docker compose
def self.test_container
container_id = `docker ps -qf "name=#{ENV.fetch('APP_NAME')}_test"`

logger = Logger.new(STDOUT)
logger.level = Logger::WARN

logger.warn "Container name: #{ENV.fetch('APP_NAME')}_test"
# container_name = "#{ENV.fetch('APP_NAME')}_test"
container_name = 'rails-template-test'
container_id = `docker ps -qf "name=#{container_name}"`

logger.warn "Container name: #{container_name}"
logger.warn "Container ID: #{container_id}"
logger.warn "Container integer ID: #{container_id.strip.to_i}"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ api_spec = spec/variants/api/**/*_spec.rb

test_template:
cd $(APP_NAME) && \
docker-compose -f docker-compose.test.yml up --detach db redis && \
docker compose -f docker-compose.test.yml up --detach db redis && \
docker compose -f docker-compose.test.yml run test bash -c "./bin/inject_port_into_nginx.sh && nginx -c /etc/nginx/conf.d/default.conf -t" && \
docker compose -f docker-compose.test.yml run --detach test bin/start.sh && \
cd ../.template && \
Expand Down

0 comments on commit a878f3b

Please sign in to comment.