diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 474bb34..715b28b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,10 +22,7 @@ jobs: - name: Generate ssh key for CI gateway-sshd run: make ci-ssh-key - - name: Launch Gateway - run: cd ci/ && docker-compose up -d - - - name: Create link on gateway + - name: Launch gateway and create link on gateway run: make link-ci GATEWAY=gateway-sshd FQDN=app.example.com EXPOSE=app:3000 #- name: Ensure link works by making request to app.example.com diff --git a/Makefile b/Makefile index 181d080..9e8e4e3 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,5 @@ link: link-macos: docker run -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" --rm -it fractalnetworks/gateway-cli:latest $(GATEWAY) $(FQDN) $(EXPOSE) -ci-ssh-key: - ssh-keygen -t ed25519 -f ./ci/gateway-sim-key -N "" - link-ci: ./ci/create-link-ci.sh $(GATEWAY) $(FQDN) $(EXPOSE) \ No newline at end of file diff --git a/ci/create-link-ci.sh b/ci/create-link-ci.sh index 3d5c035..f913277 100755 --- a/ci/create-link-ci.sh +++ b/ci/create-link-ci.sh @@ -1,5 +1,10 @@ #!/bin/bash +set -e +cd ci/ +ssh-keygen -t ed25519 -f ./gateway-sim-key -N "" +docker compose up -d --build eval $(ssh-agent -s) -ssh-add ./ci/gateway-sim-key -docker run --network gateway -e SSH_AGENT_PID=$SSH_AGENT_PID -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK --rm fractalnetworks/gateway-cli:latest $1 $2 $3 \ No newline at end of file +ssh-add ./gateway-sim-key +docker run --network gateway -e SSH_AGENT_PID=$SSH_AGENT_PID -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK --rm fractalnetworks/gateway-cli:latest $1 $2 $3 +docker compose down \ No newline at end of file