Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit aa128b5

Browse files
committed
feat(docker): install build dependencies when run
1 parent 9e194c4 commit aa128b5

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 2.8)
22

3-
set (CMAKE_CXX_STANDARD 11)
3+
set(CMAKE_CXX_STANDARD 11)
4+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5+
set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,readability-*)
46

57
project(NgTest)
68

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ngqt/qode
2+
WORKDIR /ng-test
3+
4+
# Install required tools
5+
# hadolint ignore=DL3008,DL3007
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
cmake \
8+
clang \
9+
clang-tidy \
10+
clang-format
11+
12+
ENTRYPOINT yarn install && /bin/bash

README.md

100644100755
+2-9
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ A test library for NodeGUI widgets
44
### Development
55
The recommended way of getting started with contributing is using [Docker](https://docker.com)
66

7-
> If you already have Qt5 and Node.js installed on your system, and don't want to use [Docker](https://docker.com), go over to the [Docker image for Qode](https://github.com/ng-qt/qode-docker-image#environment) and set the same environment variables.
7+
> If you already have QMake, Qt5, Node.js and CLang & friends installed on your system, and don't want to use [Docker](https://docker.com), go over to the [Docker image for Qode](https://github.com/ng-qt/qode-docker-image#environment) and set the same environment variables.
88
9-
Run the following bash script to start the **ng-test** development environment for [Docker](https://docker.com)
9+
Run the following command to start the **ng-test** development environment for [Docker](https://docker.com) and install the required build dependencies
1010
> The project context will be shared with Docker, which means any changes made on your system, or in the container will be reflected to one another.
1111
```
1212
$ ./docker-dev.sh
1313
```
1414

15-
Afterwards install the Node dependencies using Yarn
16-
```
17-
$ yarn install
18-
```
19-
20-
21-
2215
#### Requirements
2316
* [Docker](https://docker.com)
2417
* [Qt5](https://doc.qt.io/qt-5/qt5-intro.html)

docker-dev.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# For local development
22
NAME=ng_test
33
WORKDIR=/ng-test
4-
IMAGE=ngqt/qode
4+
FILE=Dockerfile
55
CONTEXT=$(pwd)
66

77
# If container already exists, exec into it, otherwise run it
88
if docker start $NAME &> /dev/null
99
then
1010
docker exec -w $WORKDIR -it $NAME bash
1111
else
12-
docker run --name $NAME -v "$CONTEXT":$WORKDIR -w $WORKDIR -ti $IMAGE bash
12+
docker build -f $FILE -t $NAME .
13+
docker run --name $NAME -v "$CONTEXT":$WORKDIR -w $WORKDIR -it $NAME bash
1314
fi

index.js

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./build/Release/ngtest.node');
1+
module.exports = require('./build/Release/NgTest.node');

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ clone-response@^1.0.2:
866866
dependencies:
867867
mimic-response "^1.0.0"
868868

869-
cmake-js@^5.3.2:
869+
870870
version "5.3.2"
871871
resolved "https://registry.yarnpkg.com/cmake-js/-/cmake-js-5.3.2.tgz#822e43151ae39aaf591c327912a786bcc63abcd2"
872872
integrity sha512-OsRQ3ZgoV3nJ+3bZr9MEvSuhGS7xc3LgmPZ2gCXlLqF5Wxi6mUQNK70dm/2UUf4/QNBssdYWB5Y7BSRX9FFUrg==

0 commit comments

Comments
 (0)