G-Node / gin-proc

BSD 3-Clause "New" or "Revised" License
0 stars 7 forks source link

Default clone step: GIN-specific docker container with script #11

Open achilleas-k opened 5 years ago

achilleas-k commented 5 years ago

Since we need to override the default clone step to clone via SSH and download annexed data, the clone step should be handled by a container that performs all the necessary steps. We could host this on dockerhub and make it GIN specific. Ideally, the clone step in the drone.yml configuration for all repositories should be as follows:

- name: clone
  image: docker:gnode/gin-proc-clone
  environment:
    SSH_KEY:
      from_secret: DRONE_PRIVATE_SSH_KEY

The container will be built with git and git-annex and the entrypoint should be a script that uses the default drone environment to clone the repository (e.g., git clone $DRONE_REMOTE_URL for the initial clone step).

The gin-proc web service could also add extra fields for specifying which annexed file content to download (if not everything). The clone plugin would then use a predefined env variable (that the gin-proc web service always sets) to determine which annexed files to download.