Skip to content

Commit

Permalink
Merge pull request #217 from silinternational/feature/docker-compose
Browse files Browse the repository at this point in the history
update docker compose
  • Loading branch information
briskt authored Jun 14, 2024
2 parents 7feb725 + 19f8cfb commit 82f5fb8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: test
run: docker-compose -f actions-services.yml run --rm test ./run-tests.sh
run: docker compose -f actions-services.yml run test ./run-tests.sh
- name: check hub metadata for tests
run: docker-compose -f actions-services.yml run --rm ssp-hub.local ./run-metadata-tests.sh
run: docker compose -f actions-services.yml run ssp-hub.local ./run-metadata-tests.sh
- name: check idp metadata for tests
run: docker-compose -f actions-services.yml run --rm ssp-idp1.local ./run-metadata-tests.sh
run: docker compose -f actions-services.yml run ssp-idp1.local ./run-metadata-tests.sh
- name: check sp metadata for tests
run: docker-compose -f actions-services.yml run --rm ssp-sp1.local ./run-metadata-tests.sh
run: docker compose -f actions-services.yml run ssp-sp1.local ./run-metadata-tests.sh

build-and-publish:
name: Build and Publish
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
hub: clean
docker-compose up -d ssp-hub.local
docker compose up -d ssp-hub.local

clean:
docker-compose kill
docker-compose rm -f
docker compose kill
docker compose rm -f

composer:
docker-compose run --rm composer bash -c "./update-composer-deps.sh"
docker compose run --rm composer bash -c "./update-composer-deps.sh"

test:
docker-compose run --rm ssp-hub.local ./run-metadata-tests.sh
docker-compose run --rm ssp-idp1.local ./run-metadata-tests.sh
docker-compose run --rm ssp-sp1.local ./run-metadata-tests.sh
docker-compose run --rm test
docker compose run --rm ssp-hub.local ./run-metadata-tests.sh
docker compose run --rm ssp-idp1.local ./run-metadata-tests.sh
docker compose run --rm ssp-sp1.local ./run-metadata-tests.sh
docker compose run --rm test

test-integration:
docker-compose run --rm test ./run-integration-tests.sh
docker compose run --rm test ./run-integration-tests.sh

copyJsLib:
cp ./node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js ./modules/mfa/www/simplewebauthn/browser.js
cp ./node_modules/@simplewebauthn/browser/LICENSE.md ./modules/mfa/www/simplewebauthn/LICENSE.md

deps:
docker-compose run --rm node npm install --ignore-scripts
docker compose run --rm node npm install --ignore-scripts
make copyJsLib

depsupdate:
docker-compose run --rm node npm update --ignore-scripts
docker compose run --rm node npm update --ignore-scripts
make copyJsLib
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Base image for simpleSAMLphp
Docker image: [silintl/ssp-base](https://hub.docker.com/r/silintl/ssp-base/)

## Prerequisite software
[Docker](https://www.docker.com/products/overview) and [docker-compose](https://docs.docker.com/compose/install)
[Docker](https://www.docker.com/products/overview) and [docker compose](https://docs.docker.com/compose/install)
must be installed.

[Make](https://www.gnu.org/software/make) is optional but simplifies the build process.
Expand Down Expand Up @@ -37,7 +37,7 @@ will overwrite variables set in the execution environment.
2. `cp local.broker.env.dist local.broker.env` within project root and make adjustments as needed.
3. Add your github token to the `COMPOSER_AUTH` variable in the `local.env` file.
4. Create `localhost` aliases for `ssp-hub.local`, `ssp-idp1.local`, `ssp-idp2.local`, `ssp-idp3.local`, `ssp-sp1.local`, `ssp-sp2.local`, and `ssp-sp3.local`. This is typically done in `/etc/hosts`. _Example line: `127.0.0.1 ssp-hub.local ssp-idp1.local ssp-idp2.local ssp-idp3.local ssp-sp1.local ssp-sp2.local ssp-sp3.local`_
4. `make` or `docker-compose up -d` within the project root.
4. `make` or `docker compose up -d` within the project root.
5. Visit http://ssp-hub.local to see SimpleSAMLphp

### Configure a container for debugging with Xdebug
Expand Down Expand Up @@ -68,7 +68,7 @@ docker composer up -d ssp-hub.local
- Name it `Docker`
- API URL should be `tcp://localhost:2375`
- Certificates folder should be empty
- Docker Compose executable should be full path to docker-compose script
- Docker Compose executable should be full path to docker compose script

3. Hit `Apply`
4. Next in `Preferences` -> `Languages & Frameworks` -> `PHP` click on the `...`
Expand Down
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ Vagrant.configure(2) do |config|
sudo groupadd docker
sudo usermod -aG docker vagrant
# Install Docker Compose
curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.17.0/docker compose-`uname -s`-`uname -m` > /usr/local/bin/docker compose
chmod +x /usr/local/bin/docker compose
SHELL

# This provisioner runs on every `vagrant reload' (as well as the first
# `vagrant up`), reinstalling from local directories
config.vm.provision "recompose", type: "shell",
run: "always", inline: <<-SHELL
# Run docker-compose (which will update preloaded images, and
# Run docker compose (which will update preloaded images, and
# pulls any images not preloaded)
cd /vagrant
Expand Down
1 change: 0 additions & 1 deletion actions-services.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:

# the db container is used by the silauth module
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Four SPs, a hub (a combined IdP and SP) and three IdPs get spun up by docker-compose. In order for this to work, you will need to edit your hosts file to include entries for the following domains ...
Four SPs, a hub (a combined IdP and SP) and three IdPs get spun up by docker compose. In order for this to work, you will need to edit your hosts file to include entries for the following domains ...
* ssp-sp1.local # to be used with port 8081
* ssp-sp2.local # to be used with port 8082
* ssp-sp3.local # to be used with port 8083
Expand Down
4 changes: 2 additions & 2 deletions docs/functional_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This is done through behat acceptance tests

Once your containers are up, in your VM run ...

`> docker-compose run --rm test /data/run-integration-tests.sh`
`> docker compose run --rm test /data/run-integration-tests.sh`

Or, if you need to run just one of the tests, run ...

`> docker-compose run --rm test bash`
`> docker compose run --rm test bash`

then

Expand Down

0 comments on commit 82f5fb8

Please sign in to comment.