-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Generate link with Github action on commit --------- Co-authored-by: Justin <jrussel1055@gmail.com>
- Loading branch information
1 parent
9c89963
commit 181f853
Showing
7 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' # This will run the workflow on every push to any branch | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build images | ||
run: make docker | ||
|
||
- 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 | ||
# run: curl --resolve app.example.com:443:127.0.0.1 http://app.example.com:443 | ||
|
||
|
||
- name: Cleanup | ||
run: docker compose -f ./ci/docker-compose.yaml down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gateway-sim-key* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM alpine:latest | ||
RUN apk add openssh-server bash docker-cli curl | ||
RUN ssh-keygen -A | ||
|
||
COPY gateway-sim-key.pub /root/.ssh/authorized_keys | ||
|
||
ENTRYPOINT [ "/usr/sbin/sshd", "-D", "-e" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd ci/ | ||
ssh-keygen -t ed25519 -f ./gateway-sim-key -N "" | ||
# create docker network if not exists | ||
docker network create gateway || true | ||
docker compose up -d --build | ||
eval $(ssh-agent -s) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3.9' | ||
services: | ||
gateway-sshd: | ||
build: . | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
networks: | ||
- gateway | ||
gateway: | ||
image: fractalnetworks/selfhosted-gateway:latest | ||
environment: | ||
NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx | ||
networks: | ||
- gateway | ||
|
||
|
||
networks: | ||
gateway: | ||
external: true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters