Skip to content

Commit e7c851c

Browse files
authored
Make test release docker target the specific branch when the label is run manually (#252)
* Fix * Better approach * Fix
1 parent 5d235af commit e7c851c

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

Diff for: .github/workflows/publisher.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ jobs:
4242
- uses: actions/checkout@v2
4343
with:
4444
submodules: true
45+
- name: Get branch name
46+
id: branch-name
47+
uses: tj-actions/[email protected]
4548
- name: Build Docker Image
46-
run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --file Dockerfile .
49+
run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
4750
- name: Login to Docker Hub
4851
uses: docker/login-action@v1
4952
with:
@@ -59,8 +62,11 @@ jobs:
5962
- uses: actions/checkout@v2
6063
with:
6164
submodules: true
65+
- name: Get branch name
66+
id: branch-name
67+
uses: tj-actions/[email protected]
6268
- name: Build Docker Image
63-
run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --file Dockerfile-cuda .
69+
run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile-cuda .
6470
- name: Login to Docker Hub
6571
uses: docker/login-action@v1
6672
with:

Diff for: .github/workflows/tests_suite.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ jobs:
139139
- uses: actions/checkout@v2
140140
with:
141141
submodules: true
142+
- name: Get branch name
143+
id: branch-name
144+
uses: tj-actions/[email protected]
142145
- name: Build image
143146
run: |
144-
docker build --tag opendr/opendr-toolkit:cpu_test --file Dockerfile .
147+
docker build --tag opendr/opendr-toolkit:cpu_test --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
145148
docker save opendr/opendr-toolkit:cpu_test > cpu_test.zip
146149
- name: Upload image artifact
147150
uses: actions/upload-artifact@v2

Diff for: .github/workflows/tests_suite_develop.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ jobs:
143143
with:
144144
submodules: true
145145
ref: develop
146+
- name: Get branch name
147+
id: branch-name
148+
uses: tj-actions/[email protected]
146149
- name: Build image
147150
run: |
148-
docker build --tag opendr/opendr-toolkit:cpu_test --file Dockerfile .
151+
docker build --tag opendr/opendr-toolkit:cpu_test --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
149152
docker save opendr/opendr-toolkit:cpu_test > cpu_test.zip
150153
- name: Upload image artifact
151154
uses: actions/upload-artifact@v2

Diff for: Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ubuntu:20.04
22

3+
ARG branch
4+
35
# Install dependencies
46
RUN apt-get update && \
57
apt-get --yes install git sudo
@@ -12,7 +14,7 @@ RUN chmod +x /tini
1214
ENTRYPOINT ["/tini", "--"]
1315

1416
# Clone the repo and install the toolkit
15-
RUN git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr
17+
RUN git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr -b $branch
1618
WORKDIR "/opendr"
1719
RUN ./bin/install.sh
1820

Diff for: Dockerfile-cuda

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM nvidia/cuda:11.0-base
22

3+
ARG branch
4+
35
# Install dependencies
46
RUN apt-get update && \
57
apt-get --yes install git sudo apt-utils
@@ -43,7 +45,7 @@ RUN sudo apt-get --yes install build-essential && \
4345

4446
# Clone the repo and install the toolkit
4547
ENV OPENDR_DEVICE gpu
46-
RUN git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr
48+
RUN git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr -b $branch
4749
WORKDIR "/opendr"
4850
RUN ./bin/install.sh
4951

0 commit comments

Comments
 (0)