Skip to content

Commit d2b1502

Browse files
authored
Merge pull request #869 from cambridge-cares/fix-dtvf-action
fix-dtvf-action
2 parents c875ec6 + a6229fa commit d2b1502

File tree

12 files changed

+69
-67
lines changed

12 files changed

+69
-67
lines changed

.github/workflows/dtvf_release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# Checkout the repository
3333
- name: Checkout repository
3434
uses: actions/checkout@v3
35-
35+
3636
# Get the version of the DTVF
3737
- name: Get DTVF version
3838
id: versioner
@@ -44,7 +44,7 @@ jobs:
4444
id: compiler
4545
working-directory: ./web/digital-twin-vis-framework/library
4646
run: |
47-
docker-compose -f docker/docker-compose.yml up compile
47+
docker-compose -f docker-compose.dev.yml up compile
4848
zip -r $HOME/dtvf.zip output/
4949
echo zip=$HOME/dtvf.zip >> $GITHUB_ENV
5050
@@ -61,11 +61,11 @@ jobs:
6161
uses: docker/build-push-action@v3
6262
with:
6363
push: true
64-
context: ./web/digital-twin-vis-framework/library/docker
64+
context: ./web/digital-twin-vis-framework/library
6565
tags: |
66-
"ghcr.io/cambridge-cares/dtvf-base-image:${{ env.version }}"
67-
"ghcr.io/cambridge-cares/dtvf-base-image:latest"
68-
66+
ghcr.io/cambridge-cares/dtvf-base-image:${{ env.version }}
67+
ghcr.io/cambridge-cares/dtvf-base-image:latest
68+
6969
# Generate the release body text
7070
- name: Generate release text
7171
id: generate-text

web/digital-twin-vis-framework/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[//]: # (Note that version headers need to start with "# " characters to be picked up by some automated scripts)
22

3+
# 3.8.3
4+
### Features
5+
* _No features present._
6+
### Bug Fixes:
7+
* Separated and moved docker config files to better support GitHub actions.
8+
39
# 3.8.2
410
### Features
511
* _No features present._

web/digital-twin-vis-framework/library/docker/Dockerfile renamed to web/digital-twin-vis-framework/library/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ RUN apk update && apk add procps nano wget bash busybox-initscripts dos2unix apa
2828
RUN mkdir -p /var/www/dtvf
2929
COPY --from=build /app/output/ /var/www/dtvf/
3030

31+
# Custom in the HTTPD configuration
32+
COPY ./resources/httpd.conf /etc/apache2/httpd.conf
33+
3134
# Copy in the start-up script
32-
COPY ./docker/start-up.sh /usr/local/start-up.sh
35+
COPY ./resources/start-up.sh /usr/local/start-up.sh
3336
RUN chmod 777 /usr/local/start-up.sh
3437
RUN chmod +x /usr/local/start-up.sh
3538
RUN dos2unix /usr/local/start-up.sh
3639

37-
# Custom in the HTTPD configuration
38-
COPY ./docker/httpd.conf /etc/apache2/httpd.conf
39-
4040
# Permissions
4141
RUN mkdir -p /var/www/html
4242
RUN chmod -R 775 /var/www/
@@ -45,4 +45,4 @@ RUN chmod -R 775 /var/www/
4545
EXPOSE 80
4646

4747
# Run cron daemon and boot script at start
48-
CMD [ "/bin/bash", "-c", "/usr/local/start-up.sh" ]
48+
CMD [ "/bin/bash", "-c", "/usr/local/start-up.sh" ]

web/digital-twin-vis-framework/library/docker/build.Dockerfile renamed to web/digital-twin-vis-framework/library/Dockerfile.dev

File renamed without changes.

web/digital-twin-vis-framework/library/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ When launched from a correctly integrated HTML file, the DTVF follows a set patt
6565

6666
## Deployment of Base Image
6767

68-
The intended workflow of creating DTVF visualisations is to use a standard base image that contains the compiled DTVF library and an Apache web server to host content. The base image can be built from this directory by running the `build.sh` script. Note that it will be tagged with the version currently listed within the `VERSION` file.
68+
The intended workflow of creating DTVF visualisations is to use a standard base image that contains the compiled DTVF library and an Apache web server to host content.
69+
70+
The base image can be built from this directory by running the `build.sh` script. Note that this will result in an image tagged with `:latest`, when pushing to the GitHub image registry this tag **and** a copy of the same image tagged with the version number (i.e. `:1.2.3`) should be pushed. To that end, we recommend leaving the pushing of new images to the automated GitHub actions, as they'll handle this.
6971

7072
<br/>
7173

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.2
1+
3.8.3
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
#!/bin/bash
22

33
#
4-
# Use this script to build the latest copy of the DTVF image for deployment.
4+
# Use this script to build the latest copy of the DTVF base image for local use.
55
#
66

7-
# Read the version
8-
VERSION=`cat -s "./VERSION" 2>/dev/null`
9-
echo "Determined DTVF version as: $VERSION"
10-
11-
# Write the '.env' file
12-
echo "TAG=$VERSION" > ./docker/.env
13-
echo "Written .env file"
14-
15-
# Run docker compose build command
16-
echo "Building dtvf-base-image..."
17-
docker compose -f ./docker/docker-compose.yml build
18-
19-
# Clean up
20-
rm ./docker/.env
7+
docker compose -f docker-compose.yml build --no-cache
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Compose file for the DTVF (development).
3+
#
4+
version: "3.8"
5+
6+
# All Services
7+
services:
8+
9+
# Compilation container.
10+
# This container will compile the source code, package it for deployment, write it to the ./output folder, then shutdown.
11+
compile:
12+
build:
13+
context: "./"
14+
dockerfile: "Dockerfile.dev"
15+
image: ghcr.io/cambridge-cares/dtvf-build-environment:latest
16+
container_name: "dtvf-build-compile"
17+
restart: "no"
18+
working_dir: "/app"
19+
entrypoint: "/bin/bash -c 'npm install && tsc && grunt package'"
20+
volumes:
21+
- type: bind
22+
source: ./
23+
target: /app
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Compose file for the DTVF.
3+
#
4+
version: "3.8"
5+
6+
# All Services
7+
services:
8+
9+
# Empty DTVF visualisation image for deployment. Builds a base image that, when combined
10+
# with a volume of files, can be used as a visualisation. It is not intended that this
11+
# config is used to run the dtvf-base-image.
12+
visualise:
13+
image: ghcr.io/cambridge-cares/dtvf-base-image:latest
14+
container_name: "empty-dtvf-container"
15+
restart: "no"
16+
build:
17+
context: "./"
18+
dockerfile: "Dockerfile"
19+
labels:
20+
authors: "support@cmcl.io"
21+
description: "Empty visualisation image, ready to house web files."
22+
ports:
23+
- "80:80"

web/digital-twin-vis-framework/library/docker/docker-compose.yml

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

0 commit comments

Comments
 (0)