-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
65 lines (57 loc) · 1.87 KB
/
Makefile.toml
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
61
62
63
64
65
[config]
skip_core_tasks = true
min_version = "0.36.13"
[env]
PROJECT_VERSION = "${CARGO_MAKE_CRATE_VERSION}"
PROJECT_NAME = "${CARGO_MAKE_CRATE_NAME}"
REGISTRY = "registry.gitlab.com/osslocal/solana-e"
[tasks.pack]
script = '''
docker build \
-f ./Containerfile \
--build-arg RUSTC_VERSION="${CARGO_MAKE_RUST_VERSION}" \
--build-arg service_version="${PROJECT_VERSION}" \
--build-arg service_name="${PROJECT_NAME}" \
--build-arg service_description="${CARGO_MAKE_CRATE_DESCRIPTION}" \
--build-arg service_documentation="${CARGO_MAKE_CRATE_DOCUMENTATION}" \
--build-arg service_homepage="${CARGO_MAKE_CRATE_HOMEPAGE}" \
--build-arg service_repository="${CARGO_MAKE_CRATE_REPOSITORY}" \
--build-arg service_license="${CARGO_MAKE_CRATE_LICENSE}" \
--build-arg service_build_date="$(date --iso-8601=seconds -u)" \
--build-arg service_vcs_ref="$(git rev-parse --short HEAD)" \
-t ${REGISTRY}/${PROJECT_NAME}:${PROJECT_VERSION} \
-t ${REGISTRY}/${PROJECT_NAME}:latest .
'''
[tasks.push]
script = '''
docker push --all ${REGISTRY}/${PROJECT_NAME}:${PROJECT_VERSION} ${REGISTRY}/${PROJECT_NAME}:latest
'''
[tasks.clean]
script = '''
docker system prune --volumes -f
docker image prune -a --filter="until=1h" --filter "label=org.opencontainers.image.title=${PROJECT_NAME}" -f
'''
[tasks.load]
script = '''
ssh -T sandbox << EOF
docker pull ${REGISTRY}/${PROJECT_NAME}:${PROJECT_VERSION}
docker images
EOF
'''
[tasks.run]
script = '''
docker run --rm -it --name ${PROJECT_NAME}_server \
-p 8081:8081/tcp \
${REGISTRY}/${PROJECT_NAME}:${PROJECT_VERSION}
'''
[tasks.run-remote]
script = '''
ssh -T sandbox << EOF
docker stop ${PROJECT_NAME}_server && docker rm ${PROJECT_NAME}_server
docker run -d --name ${PROJECT_NAME}_server \
-p 8081:8081/tcp \
${REGISTRY}/${PROJECT_NAME}:${PROJECT_VERSION}
EOF
'''
[tasks.pp]
dependencies = [ "pack", "push" ]