Skip to content

Commit

Permalink
Add a way to run the personnel-sync locally, for dev and testing
Browse files Browse the repository at this point in the history
To do so...

1. Run `docker compose run --rm externalgroupssync bash`
2. In that, run `~/.aws-lambda-rie/aws-lambda-rie ./personnel-sync`
3. In other terminal (on your host), run another
   `docker compose exec externalgroupssync bash`
4. In that, run `curl -XPOST "http://localhost:8080/2015-03-31/functions/function/invocations" -d '{}'`
   each time you want to invoke the personnel-sync.
  • Loading branch information
forevermatt committed Aug 26, 2024
1 parent e6557b7 commit 2a02afe
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ serverless-mfa-api/override/*.go
serverless-mfa-api/override/server/*.go
u2f-simulator/override/*.go
u2f-simulator/override/u2fserver/*.go

# Other files to exclude:
*/config.json
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ services:
# docker compose run --rm test vendor/bin/behat --stop-on-failure features/user.feature
# docker compose run --rm test vendor/bin/behat --stop-on-failure features/user.feature:306

externalgroupssync:
build: ./ext-groups-sync
volumes:
- ./ext-groups-sync/config.json:/app/config.json
- ./ext-groups-sync/.env:/app/.env

phpmyadmin:
image: phpmyadmin:5
ports:
Expand Down
18 changes: 18 additions & 0 deletions ext-groups-sync/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN mkdir -p ~/.aws-lambda-rie
RUN curl -Lo ~/.aws-lambda-rie/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie
RUN chmod +x ~/.aws-lambda-rie/aws-lambda-rie

RUN curl --location -o personnel-sync.tar.gz https://github.com/silinternational/personnel-sync/releases/download/v6.8.3/personnel-sync_6.8.3_linux_amd64.tar.gz
RUN tar -xzf personnel-sync.tar.gz
RUN chmod +x personnel-sync

CMD ["~/.aws-lambda-rie/aws-lambda-rie", "./personnel-sync"]

0 comments on commit 2a02afe

Please sign in to comment.