Skip to content

Commit 034ef51

Browse files
committed
minor fixes
1 parent 8e96070 commit 034ef51

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

.containerversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
28
1+
29

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,21 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
FROM thyrlian/android-sdk:4.0 as android
14+
FROM thyrlian/android-sdk:4.0 AS android
1515

1616
FROM ubuntu:22.04
1717

18-
ENV DEBIAN_FRONTEND noninteractive
19-
2018
# Android
2119
COPY --from=android /opt/android-sdk /opt/android-sdk
2220

23-
ADD scripts/docker_install.sh /tmp/
24-
RUN /tmp/docker_install.sh
21+
RUN --mount=target=/mnt,source=scripts DEBIAN_FRONTEND=noninteractive /mnt/docker_install.sh
2522

2623
# In this path executables will be installed during docker build
27-
ARG SYS_GOPATH /opt/go
28-
ENV PATH $SYS_GOPATH/bin:/usr/local/go/bin:$PATH
24+
ARG SYS_GOPATH=/opt/go
25+
ENV PATH=${SYS_GOPATH}/bin:/usr/local/go/bin:$PATH
2926

30-
ADD Makefile /tmp/
31-
RUN GOPATH=$SYS_GOPATH make -C /tmp/ envinit
27+
RUN --mount=target=/mnt/Makefile,source=Makefile GOPATH=${SYS_GOPATH} make -C /mnt envinit
3228

33-
ENV PATH /opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH
29+
ENV PATH=/opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH
3430

3531
CMD ["bash"]

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ clean:
8282
cd frontends/qt && $(MAKE) clean
8383
cd frontends/android && $(MAKE) clean
8484
cd backend/mobileserver && $(MAKE) clean
85+
86+
# The container image only supports amd64 bercause of "thyrlian/android-sdk"
87+
# that downloads amd64 specific binaries
8588
dockerinit:
86-
./scripts/container.sh build --pull --force-rm -t shiftcrypto/bitbox-wallet-app .
89+
./scripts/container.sh build --platform linux/amd64 --pull -t shiftcrypto/bitbox-wallet-app:$(shell cat .containerversion) .
8790
dockerdev:
8891
./scripts/dockerdev.sh
8992
locize-push:

scripts/github-ci.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ "$OS_NAME" == "linux" ]; then
1212
# Which docker image to use to run the CI. Defaults to Docker Hub.
1313
# Overwrite with CI_IMAGE=docker/image/path environment variable.
1414
# Keep this in sync with .github/workflows/ci.yml.
15-
: "${CI_IMAGE:=shiftcrypto/bitbox-wallet-app:26}"
15+
: "${CI_IMAGE:=shiftcrypto/bitbox-wallet-app:$(cat .containerversion)}"
1616
# Time image pull to compare in the future.
1717
time docker pull "$CI_IMAGE"
1818

@@ -32,14 +32,12 @@ if [ "$OS_NAME" == "osx" ]; then
3232
# GitHub CI installs Go and Qt directly in the macos action, before executing
3333
# this script.
3434
go version
35-
export GOPATH=~/go
36-
export PATH="$PATH:~/go/bin"
37-
mkdir -p $GOPATH/$(dirname $GO_SRC_DIR)
35+
export PATH="~/go/bin:$PATH"
36+
mkdir -p $(go env GOPATH)/$(dirname $GO_SRC_DIR)
3837
# GitHub checkout action (git clone) seem to require current work dir
3938
# to be the root of the repo during its clean up phase. So, we push it
4039
# here and pop in the end.
41-
pushd ../ && cp -a bitbox-wallet-app $GOPATH/$(dirname $GO_SRC_DIR)
42-
cd $GOPATH/$GO_SRC_DIR
43-
make "$WHAT"
40+
pushd ../ && cp -a bitbox-wallet-app $(go env GOPATH/)$(dirname $GO_SRC_DIR)
41+
make -C $(go env GOPATH)/$GO_SRC_DIR "$WHAT"
4442
popd
4543
fi

0 commit comments

Comments
 (0)