Skip to content

Commit 6ed01c0

Browse files
committed
Replace Drone pipeline with a script
1 parent 6b18bf6 commit 6ed01c0

6 files changed

Lines changed: 27 additions & 36 deletions

File tree

.drone.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

assets_src/translate-js/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Install dependencies if you haven't done so already
2020
```
2121
npm install --no-save
2222
23-
# Note that installation can also be done with drone in the a-plus root
24-
# directory (.drone.yml):
25-
drone exec
23+
# Note that installation can also be done with a script in the a-plus root
24+
# directory:
25+
./compile_sass.sh
2626
```
2727

2828
Build the bundle, which will be put to A+'s `assets/js` folder, and run
@@ -48,7 +48,7 @@ In the HTML file, include JQuery and `translate.js`
4848
```
4949

5050
Include your translation files in link tags in HTML. The translation files may
51-
be either in [polyglot's](http://airbnb.io/polyglot.js/) native format or in
51+
be either in [polyglot's](http://airbnb.io/polyglot.js/) native format or in
5252
[Django JSONCatalog](https://docs.djangoproject.com/en/2.0/topics/i18n/translation/#the-jsoncatalog-view)
5353
format.
5454

compile_sass.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Step 1: Download assets
2+
docker run --rm -v "$PWD:/workspace" -w /workspace node:12-alpine sh -c '
3+
export npm_config_cache="/workspace/node_cache"
4+
for dir in assets_src/*/; do
5+
dir="${dir%/}"
6+
[ -f "$dir/package.json" ] || { echo ".. skip $dir" ; continue; }
7+
echo ">> Building and installing assets package ${dir##*/}"
8+
( cd "$dir" && npm install --unsafe-perm )
9+
done
10+
'
11+
12+
# Step 2: Compile sass
13+
docker run --rm -v "$PWD:/workspace" -w /workspace apluslms/develop-sass:1 \
14+
sass --style=compressed assets/sass:assets/css

dev_assets_run_npm.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ elif ! [ -d "$dir" ]; then
1313
exit 64
1414
fi
1515

16-
image=$(grep -F 'image: node:' .drone.yml | head -n1 | awk '{print $2}')
17-
[ "$image" ] || exit 2
16+
image="node:12-alpine"
1817

1918
exec docker run --rm -it --init \
2019
-u $(id -u):$(id -g) \

dev_assets_watch_sass.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
22

3-
image=$(grep -F 'image: apluslms/develop-sass' .drone.yml | head -n1 | awk '{print $2}')
4-
[ "$image" ] || exit 2
3+
image="apluslms/develop-sass:1"
54

65
exec docker run --rm -it \
76
-u $(id -u):$(id -g) \

doc/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ A+ uses containers to support local development and to power the CI/CD pipeline.
77
Therefore you need to have the following installed:
88
- [Docker Engine](https://docs.docker.com/engine/install/)
99
- [Docker Compose](https://docs.docker.com/compose/install/)
10-
- [Drone](https://docs.drone.io/cli/install/)
1110

1211
Note that you will need to have admin rights to install these correctly.
1312

14-
Alternatively, you can have comparable software which enable you to use the commands `docker`, `docker-compose` and `drone`.
13+
Alternatively, you can have comparable software which enable you to use the commands `docker` and `docker-compose`.
1514

1615
If you are going to use Django translations, you must install the GNU **gettext** utilities
1716
- [gettext Ubuntu](https://packages.ubuntu.com/search?keywords=gettext).
@@ -80,11 +79,11 @@ Mounting happens by adding the path to your cloned a-plus directory to the `volu
8079
If you wish to use features which require write access, e.g. update translations, change the `/srv/` to `/src/`.
8180
Using `/srv/` will allow the Django process to reload the code without stopping the container, but features which require the write access are not possible.
8281

83-
4. Download and build all required support files by running the Drone pipeline, i.e., execute the following in the a-plus project root:
82+
4. Download and build all required support files by running the following script in the a-plus project root:
8483

8584
```sh
8685
$ cd [A-PLUS PROJECT ROOT]
87-
$ drone exec
86+
$ ./compile_sass.sh
8887
```
8988

9089
5. Run the code within the container:
@@ -106,10 +105,10 @@ Using `/srv/` will allow the Django process to reload the code without stopping
106105

107106
```sh
108107
$ cd [A-PLUS PROJECT ROOT]
109-
$ drone exec
108+
$ ./compile_sass.sh
110109
```
111110

112-
After the `drone exec` command finishes its execution, you can start monitoring the changes of the sass compiler by executing the following command.
111+
After the `compile_sass.sh` script finishes its execution, you can start monitoring the changes of the sass compiler by executing the following command.
113112

114113
```sh
115114
$ cd [A-PLUS PROJECT ROOT]
@@ -122,7 +121,7 @@ Note that if you have mounted the code to `/src/`, you need to restart the serve
122121
3. After completing the changes and before committing them, run:
123122

124123
```sh
125-
$ drone exec
124+
$ ./compile_sass.sh
126125
```
127126

128127
4. Include the built production versions of JavaScript and CSS files (e.g. `css/main.css` and `css/main.css.map`) into the git commit with your changes.
@@ -300,7 +299,7 @@ exceptions to this rule:
300299
(e.g. `Submission.exercise`), uses the related model's **base manager**
301300
(which is usually Django's `Manager` class) instead of its
302301
**default manager** (which is accessed via `objects`).
303-
302+
304303
To work around this limitation, there are two custom relationship field
305304
classes, `DefaultOneToOneField` and `DefaultForeignKey`, which use the
306305
default manager, and thus ensure that the related object is always returned

0 commit comments

Comments
 (0)