-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
60 lines (45 loc) · 1.53 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
set dotenv-load := true
#enable modern docker build features
export DOCKER_BUILDKIT := "1"
export COMPOSE_DOCKER_CLI_BUILD := "1"
# build the R image locally
build:
#!/usr/bin/env bash
set -euo pipefail
# set build args for prod builds
export BUILD_DATE=$(date -u +'%y-%m-%dT%H:%M:%SZ')
export GITREF=$(git rev-parse --short HEAD)
# build the thing
docker-compose build --pull r
# build and add a package and its dependencies to the image
add-package package repos="NULL":
bash ./add-package.sh {{ package }} {{ repos }}
# r image containing rstudio-server
build-rstudio:
#!/usr/bin/env bash
set -euo pipefail
# Set RStudio Server .deb filename
export RSTUDIO_BASE_URL=https://download2.rstudio.org/server/focal/amd64/
export RSTUDIO_DEB=rstudio-server-2024.09.0-375-amd64.deb
docker-compose build --pull rstudio
# test the locally built image
test image="r": build
bash ./test.sh "{{ image }}"
# test rstudio-server launches
test-rstudio: _env
bash ./test-rstudio.sh
_env:
#!/bin/bash
test -f .env && exit
echo "HOSTUID=$(id -u)" > .env
echo "HOSTPLATFORM=$(docker info -f '{{{{ lower .ClientInfo.Os }}')" >> .env
# lint source code
lint:
docker pull hadolint/hadolint
docker run --rm -i hadolint/hadolint < Dockerfile
publish:
docker tag r ghcr.io/opensafely-core/r:latest
docker push ghcr.io/opensafely-core/r:latest
publish-rstudio:
docker tag rstudio ghcr.io/opensafely-core/rstudio:latest
docker push ghcr.io/opensafely-core/rstudio:latest