Skip to content

Commit a52102f

Browse files
authored
[CI] Reuse setup-docker steps (#1671)
Also rename build-docker-image workflow to docker as not just docker build.
1 parent 831354d commit a52102f

1 file changed

Lines changed: 15 additions & 21 deletions

File tree

.circleci/config.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ commands:
4040
command: |
4141
source emsdk_env.sh
4242
test/test.py
43+
setup-docker:
44+
steps:
45+
- run:
46+
name: install docker
47+
command: |
48+
apt-get update -q
49+
apt-get install -q -y ca-certificates curl gnupg lsb-release
50+
mkdir -p /etc/apt/keyrings
51+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
52+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
53+
apt-get update -q
54+
apt-get install -q -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
4355
test-bazel-linux:
4456
steps:
4557
- checkout
@@ -214,16 +226,7 @@ jobs:
214226
executor: ubuntu
215227
steps:
216228
- checkout
217-
- run:
218-
name: install docker
219-
command: |
220-
apt-get update -q
221-
apt-get install -q -y ca-certificates curl gnupg lsb-release
222-
mkdir -p /etc/apt/keyrings
223-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
224-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
225-
apt-get update -q
226-
apt-get install -q -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
229+
- setup-docker
227230
- setup_remote_docker
228231
# Build the `latest` version of EMSDK as docker image
229232
- run:
@@ -237,16 +240,7 @@ jobs:
237240
executor: ubuntu
238241
steps:
239242
- checkout
240-
- run:
241-
name: install docker
242-
command: |
243-
apt-get update -q
244-
apt-get install -q -y ca-certificates curl gnupg lsb-release
245-
mkdir -p /etc/apt/keyrings
246-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
247-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
248-
apt-get update -q
249-
apt-get install -q -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
243+
- setup-docker
250244
- setup_remote_docker
251245
- run:
252246
name: build
@@ -340,7 +334,7 @@ workflows:
340334
test-windows:
341335
jobs:
342336
- test-windows
343-
build-docker-image:
337+
docker:
344338
jobs:
345339
- build-docker-image-x64
346340
- publish-docker-image-x64:

0 commit comments

Comments
 (0)