Skip to content

Commit

Permalink
feat(reusable-workflows): ✨ codebook profile image template
Browse files Browse the repository at this point in the history
  • Loading branch information
yambottle committed Mar 7, 2024
1 parent ca991a6 commit b87d633
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/docker-template/codebook-profile/codebook.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## docker build --build-arg JHUB_VER=4.0.2 --build-arg PY_VER=3.10 --build-arg DEPLOY_KEY=wt-ephys-no-curation-deploy.pem --build-arg REPO_OWNER=dj-sciops --build-arg REPO_NAME=wt-ephys-no-curation -f codebook.Dockerfile -t registry.vathes.com/sciops/codebook-wt-ephys-no-curation:v0.0.0 .

## Single Stage
ARG JHUB_VER
ARG PY_VER
ARG DIST
FROM datajoint/djlabhub:singleuser-${JHUB_VER}-py${PY_VER}

ARG DEPLOY_KEY
COPY --chown=jovyan $DEPLOY_KEY $HOME/.ssh/id_ed25519
RUN chmod 400 $HOME/.ssh/id_ed25519

ARG REPO_OWNER
ARG REPO_NAME
WORKDIR /tmp
RUN ssh-keyscan -t ed25519 github.com >> $HOME/.ssh/known_hosts && \
git clone [email protected]:${REPO_OWNER}/${REPO_NAME}.git && \
pip install ./${REPO_NAME} && \
mv ./${REPO_NAME}/* /home/jovyan/ && \
rm -rf /tmp/${REPO_NAME} && \
rm -rf $HOME/.ssh/

WORKDIR /home/jovyan
15 changes: 15 additions & 0 deletions .github/docker-template/codebook-profile/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# cd ./docker-template/codebook_env && set -a && source .env && docker-compose -f dist/debian/docker-compose-codebook_env.yaml build
version: '2.4'
services:
codebook_env:
build:
# only necessary if rebuilding image
context: .
dockerfile: codebook.Dockerfile
args:
- JHUB_VER
- PY_VER
- DEPLOY_KEY
- REPO_OWNER
- REPO_NAME
image: registry.vathes.com/sciops/codebook_${REPO_NAME}:singleuser-${JHUB_VER}-py${PY_VER}-${WORKFLOW_VERSION}
6 changes: 6 additions & 0 deletions .github/docker-template/codebook-profile/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
JHUB_VER=4.0.2
PY_VER=3.10
DEPLOY_KEY=<path>
REPO_OWNER=<github org>
REPO_NAME=<github repo>
WORKFLOW_VERSION=<workflow version.py>
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.DS_Store
.DS_Store

*.pem
*.env
!example.env

0 comments on commit b87d633

Please sign in to comment.