Skip to content

Commit d3a096f

Browse files
committed
ci: Use separate script to pull container from docker hub
1 parent a4eca62 commit d3a096f

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.ci/pull-container

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CONTAINER_REPO=shiftcrypto/firmware_v2
6+
CONTAINER_VERSION=$(cat .containerversion)
7+
8+
docker pull $CONTAINER_REPO:$CONTAINER_VERSION

.ci/run-container-ci

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
# The script runs all CI builds and checks in a Docker container.
1818
# It accepts two positional arguments:
19-
# 1. A workspace dir, the root of the git repo clone, or "pull" literal.
20-
# In the latter case, CI container image is pulled from a registry.
19+
# 1. A workspace dir, the root of the git repo clone, to be mounted in the container.
2120
# 2. A git revision (see man gitrevisions) to compare against HEAD to filter out modified and new
2221
# files. Some scripts only run on that subset.
2322

@@ -28,11 +27,6 @@ CONTAINER_REPO=shiftcrypto/firmware_v2
2827
CONTAINER_VERSION=$(cat .containerversion)
2928
CONTAINER=$CONTAINER_REPO:${CONTAINER_VERSION}
3029

31-
if [ "$1" == "pull" ] ; then
32-
docker pull "$CONTAINER"
33-
exit 0
34-
fi
35-
3630
WORKSPACE_DIR="$1"
3731
if [ -z "${WORKSPACE_DIR}" ]; then
3832
echo "Workspace dir path is empty."

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
fetch-tags: true
1919
submodules: recursive
2020
- name: Pull CI container image
21-
run: ./.ci/run-container-ci pull
21+
run: ./.ci/pull-container
2222
- name: Run CI in container
2323
run: ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.before }}

.github/workflows/pr-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fetch-depth: 0
1616

1717
- name: Pull container image
18-
run: ./.ci/run-container-ci pull
18+
run: ./.ci/pull-container
1919

2020
- name: Run CI in container
2121
run: ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.pull_request.base.sha }}
@@ -67,7 +67,7 @@ jobs:
6767
git checkout -f ${{ github.event.pull_request.merge_commit_sha }} -- .ci .github
6868
6969
- name: Pull container image
70-
run: ./.ci/run-container-ci pull
70+
run: ./.ci/pull-container
7171

7272
- name: Run CI in container
7373
run: ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.pull_request.base.sha }}

0 commit comments

Comments
 (0)