Skip to content

Commit

Permalink
Merge pull request #181 from cyberark/docker-compose-v2
Browse files Browse the repository at this point in the history
CNJR-2127: Use Docker Compose v2
  • Loading branch information
szh authored May 9, 2024
2 parents 8f78dfe + bba8b1e commit 85752b6
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ci/start_dev_environment
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build_test_images
start_conjur

# Runs the cflinux4 image in interactive mode with the project files mounted
docker-compose \
docker compose \
-f "$DOCKER_COMPOSE_FILE" \
run --rm \
-e BUILDPACK_BUILD_DIR="/cyberark/cloudfoundry-conjur-buildpack/conjur_buildpack" \
Expand Down
2 changes: 1 addition & 1 deletion ci/test_e2e
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ popd

announce 'Running Cucumber tests...'
# Run tests against latest build of buildpack (including integration tests against remote foundation)
docker-compose \
docker compose \
-f "$DOCKER_COMPOSE_FILE" \
run --rm \
-w "$CONTAINER_FEATURES_DIR" \
Expand Down
2 changes: 1 addition & 1 deletion ci/test_integration
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ start_conjur
[[ -z $JENKINS_HOME ]] && package_and_unpack_buildpack

announce 'Running Cucumber tests...'
docker-compose \
docker compose \
-f "$DOCKER_COMPOSE_FILE" \
run --rm \
-w "$CONTAINER_FEATURES_DIR" \
Expand Down
8 changes: 4 additions & 4 deletions ci/utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function announce {

function finish {
announce 'Removing environment...'
docker-compose -f "$DOCKER_COMPOSE_FILE" down -v
docker compose -f "$DOCKER_COMPOSE_FILE" down -v
}

function package_and_unpack_buildpack {
Expand All @@ -36,14 +36,14 @@ function setup_env {

function build_test_images {
announce 'Building test images...'
docker-compose -f "$DOCKER_COMPOSE_FILE" build
docker compose -f "$DOCKER_COMPOSE_FILE" build
}

function start_conjur {
announce 'Waiting for Conjur to start...'
docker-compose -f "$DOCKER_COMPOSE_FILE" up -d conjur
docker compose -f "$DOCKER_COMPOSE_FILE" up -d conjur

docker-compose -f "$DOCKER_COMPOSE_FILE" exec -T conjur conjurctl wait -r 45 -p 80
docker compose -f "$DOCKER_COMPOSE_FILE" exec -T conjur conjurctl wait -r 45 -p 80
}


Expand Down
4 changes: 2 additions & 2 deletions conjur-env/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ cd "$(dirname "$0")"

rm -rf ../vendor/conjur-env

docker-compose build
docker-compose run --rm conjur-env-builder
docker compose build
docker compose run --rm conjur-env-builder
4 changes: 2 additions & 2 deletions conjur-env/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.1'
services:
conjur-env-builder:
build: ""
build:
context: .
volumes:
- .:/conjur-env
- ../vendor:/pkg
Expand Down
1 change: 0 additions & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
tester:
build: .
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/apps/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ ruby '~> 3.2'

gem 'conjur-api'
gem 'conjur-cli'
gem 'thin'
gem 'puma'
gem 'roda'
11 changes: 4 additions & 7 deletions tests/integration/apps/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ GEM
netrc (~> 0.10)
table_print (~> 1.5)
xdg (= 2.2.3)
daemons (1.4.1)
deep_merge (1.2.2)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
eventmachine (1.2.7)
gli (2.21.0)
highline (2.1.0)
http-accept (1.7.0)
Expand All @@ -40,7 +38,10 @@ GEM
mime-types-data (3.2023.0218.1)
minitest (5.18.0)
netrc (0.11.0)
nio4r (2.7.0)
public_suffix (5.0.1)
puma (6.4.0)
nio4r (~> 2.0)
rack (3.0.1)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
Expand All @@ -50,10 +51,6 @@ GEM
roda (3.68.0)
rack
table_print (1.5.7)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
Expand All @@ -68,8 +65,8 @@ PLATFORMS
DEPENDENCIES
conjur-api
conjur-cli
puma
roda
thin

RUBY VERSION
ruby 3.2.2p53
Expand Down
1 change: 1 addition & 0 deletions tests/integration/apps/ruby/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec puma -b tcp://0.0.0.0:8080
4 changes: 2 additions & 2 deletions tests/integration/features/integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Feature: Integrations Tests for remote TAS foundation
When I push a "java" app with the "offline" buildpack
Then the secrets.yml values are available in the app

# # The online buildpack tests are only valid if the latest commits
# # are push to the Github remote branch.
# The online buildpack tests are only valid if the latest commits
# are push to the Github remote branch.
Scenario: Python online buildpack integration
When I push a "python" app with the "online" buildpack
Then the secrets.yml values are available in the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
else
create_offline_app_manifest
end
ShellSession.execute("cf push #{@app_name} --random-route")
ShellSession.execute("cf push #{@app_name} --random-route; cf logs #{@app_name} --recent")
end
end

Expand Down
2 changes: 1 addition & 1 deletion tests/retrieve-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ environment, then assert upon the output. BATS offers the `$output` variable, w
contains the output from the previous command executed using the `run` prefix.

### `stop`
Removes existing docker-compose containers
Removes existing Docker Compose environment

### Configuration

Expand Down
4 changes: 2 additions & 2 deletions tests/retrieve-secrets/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.1'
services:
mock-conjur-env-builder:
build: ""
build:
context: .
volumes:
- .:/mock-conjur-env
- ../../tmp/vendor:/pkg
Expand Down
8 changes: 4 additions & 4 deletions tests/retrieve-secrets/start
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ mkdir -p temp_clone_dir
git clone https://github.com/ztombol/bats-support temp_clone_dir/bats-support
git clone https://github.com/ztombol/bats-assert temp_clone_dir/bats-assert

docker-compose build
docker-compose run --rm mock-conjur-env-builder
docker compose build
docker compose run --rm mock-conjur-env-builder

echo "Starting tests for 0001_retrieve-secrets.sh..."

# Uncomment when running locally
# docker-compose run --rm tester --formatter tap ./test
# docker compose run --rm tester --formatter tap ./test

# Comment out when running locally
docker-compose run --rm tester --formatter junit ./test
docker compose run --rm tester --formatter junit ./test
2 changes: 1 addition & 1 deletion tests/retrieve-secrets/stop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function finish {
echo 'Removing environment...'

rm -rf temp_clone_dir
docker-compose down -v
docker compose down -v
}

finish

0 comments on commit 85752b6

Please sign in to comment.