Skip to content

Commit

Permalink
Make test release docker target the specific branch when the label …
Browse files Browse the repository at this point in the history
…is run manually (#252)

* Fix

* Better approach

* Fix
  • Loading branch information
ad-daniel authored Apr 27, 2022
1 parent 5d235af commit e7c851c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Build Docker Image
run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --file Dockerfile .
run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand All @@ -59,8 +62,11 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Build Docker Image
run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --file Dockerfile-cuda .
run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile-cuda .
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,12 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Build image
run: |
docker build --tag opendr/opendr-toolkit:cpu_test --file Dockerfile .
docker build --tag opendr/opendr-toolkit:cpu_test --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
docker save opendr/opendr-toolkit:cpu_test > cpu_test.zip
- name: Upload image artifact
uses: actions/upload-artifact@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests_suite_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ jobs:
with:
submodules: true
ref: develop
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
- name: Build image
run: |
docker build --tag opendr/opendr-toolkit:cpu_test --file Dockerfile .
docker build --tag opendr/opendr-toolkit:cpu_test --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
docker save opendr/opendr-toolkit:cpu_test > cpu_test.zip
- name: Upload image artifact
uses: actions/upload-artifact@v2
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:20.04

ARG branch

# Install dependencies
RUN apt-get update && \
apt-get --yes install git sudo
Expand All @@ -12,7 +14,7 @@ RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

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

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile-cuda
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM nvidia/cuda:11.0-base

ARG branch

# Install dependencies
RUN apt-get update && \
apt-get --yes install git sudo apt-utils
Expand Down Expand Up @@ -43,7 +45,7 @@ RUN sudo apt-get --yes install build-essential && \

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

Expand Down

0 comments on commit e7c851c

Please sign in to comment.