Skip to content

Commit

Permalink
try secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Mar 16, 2024
1 parent 3694c9e commit 63e26db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Encrypt and inject passwords
shell: bash
with:
context: ./odysseus
env:
- ODY_AP_ROOT_PASSWORD: ${{ secrets.ODY_AP_ROOT_PASSWORD }}
- ODY_TPU_ROOT_PASSWORD: ${{ secrets.ODY_TPU_ROOT_PASSWORD }}
- ODY_IROH_ROOT_PASSWORD: ${{ secrets.ODY_IROH_ROOT_PASSWORD }}
- MASTER_PASSWORD: ${{ secrets.ODY_MASTER_PASSWORD }}
run: for i in ODY_AP_ROOT_PASSWORD ODY_TPU_ROOT_PASSWORD ODY_IROH_ROOT_PASSWORD; do echo "$i=${!i}" >> PASSWORDS.env; done && gpg --symmetric --passphrase "$MASTER_PASSWORD" --cipher-algo AES256 PASSWORDS.env
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
Expand Down
2 changes: 2 additions & 0 deletions odysseus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ WORKDIR /home/odysseus/outputs/
COPY ./docker_scripts /home/odysseus/scripts
RUN echo "source /home/odysseus/scripts/setup_env.sh" >> ~/.bashrc

COPY ./PASSWORDS.env.gpg /home/odysseus/

ENTRYPOINT "/bin/bash"
3 changes: 2 additions & 1 deletion odysseus/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ version: "3.8"
services:
odysseus:
build: .
image: ghcr.io/northeastern-electric-racing/odysseus:52-root-secrets
command: /bin/bash
privileged: true
tty: true
stdin_open: true
# for fakeroot failure
ulimits:
nofile:
Expand All @@ -23,4 +25,3 @@ volumes:
labels:
com.northeastern_electric_racing.description: "Shared output between buildroot runs"


0 comments on commit 63e26db

Please sign in to comment.