forked from LayerZero-Labs/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.registry.yaml
108 lines (103 loc) · 3.7 KB
/
docker-compose.registry.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Docker compose for exposed test networks
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
version: "3.9"
services:
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# Provides a local NPM registry
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
npm-registry:
image: verdaccio/verdaccio
ports:
- "4873:4873"
healthcheck:
interval: 2s
retries: 10
test:
[
"CMD",
"wget",
"--output-document",
"--tries=1",
"--no-verbose",
"--spider",
"http://0.0.0.0:4873/-/ping",
]
stop_grace_period: 120s
volumes:
- ./verdaccio.yaml:/verdaccio/conf/config.yaml
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# Publishes all packages to the local repository
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
publish:
extends:
file: docker-compose.templates.yaml
service: project
depends_on:
- npm-registry
# Here we build and publish all the packages locally,
# including any pending changesets.
#
# Even though we enabled anonymous publishing in verdaccio,
# we need to specify some sort of an auth token
# since we are trying to publish scoped packages. This can be anything,
# any non-empty string will do
command:
- /bin/bash
- -c
- |
pnpm config set registry http://npm-registry:4873/
pnpm config set //npm-registry:4873/:_authToken MOCK_TOKEN
pnpm build
pnpm release:version
pnpm release:publish
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# Runs user tests
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
tests:
build:
target: user
args:
BASE_IMAGE: ${DEVTOOLS_BASE_IMAGE:-base}
depends_on:
publish:
condition: service_completed_successfully
# create-lz-oapp allows us to specify the repository/ref we pull the examples from
#
# In order to test the version on this branch in github actions,
# we'll set these based on the default variables github gives us
#
# If these are not provided, for example if running on a local machine,
# we'll default them to our repository and and empty ref
environment:
- LAYERZERO_EXAMPLES_REPOSITORY_URL=${LAYERZERO_EXAMPLES_REPOSITORY_URL}
- LAYERZERO_EXAMPLES_REPOSITORY_REF=${LAYERZERO_EXAMPLES_REPOSITORY_REF}
working_dir: /app
command:
- /bin/bash
- -c
- |
pnpm config set registry http://npm-registry:4873/
echo "create-lz-oapp:repository ${LAYERZERO_EXAMPLES_REPOSITORY_URL}"
echo "create-lz-oapp:ref ${LAYERZERO_EXAMPLES_REPOSITORY_REF}"
/app/tests-user/lib/bats-core/bin/bats --verbose-run --recursive ./tests-user/tests
volumes:
# If we want to clone from github.com, we'll need its public keys added to our SSH config
# otherwise git clone would trigger an interactive prompt asking us to add a server fingerprint
#
# See more here https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints
- ./tests-user/ssh/known_hosts:/root/.ssh/known_hosts
# The testing library and test suites
- ./tests-user:/app/tests-user