Compare commits

22 Commits

Author SHA1 Message Date
01cf5d641b Merge branch 'master' of https://mygit.wmg.warwick.ac.uk/u5500327/wmgzon 2024-02-16 17:11:00 +00:00
1a673f866f CHORE: Updated readme to container new deployment instructions 2024-02-16 17:10:51 +00:00
u5500327
8d99fc5595 Merge branch 'CICD' into 'master'
Cicd

See merge request u5500327/wmgzon!1
2024-02-16 15:06:22 +00:00
164e4aa213 #11 Changed pipeline to only run on master branch 2024-02-16 15:03:46 +00:00
22833ec7ad #11 Those were actually important XD 2024-02-16 14:27:52 +00:00
5776bcb73f #11 Removed unecessary env vars form pipeline 2024-02-16 14:23:39 +00:00
e5308ecda2 #11 Created a separate runner withappropriate container for running 2024-02-16 14:02:07 +00:00
7551da4aaa #11 Changed container name 2024-02-16 13:32:12 +00:00
e4d8cb2def #11 Changed container name 2024-02-16 13:31:04 +00:00
3c1eaf048c #11 Moved login to before any registry actions 2024-02-16 13:28:30 +00:00
b340beab3c #11 Corrected container name 2024-02-16 13:25:45 +00:00
4024578591 #11 Fixed lint warnings on pipeline 2024-02-16 13:23:14 +00:00
8f7842eb0a #11 Missing - added 2024-02-16 13:20:29 +00:00
1420a3115f #11 corrected indentaiton on ci file 2024-02-16 13:19:23 +00:00
61f2b86746 #11 Added alias to registry to allow for connection. 2024-02-16 13:18:41 +00:00
61e845c5b1 #11 Moved env vars into correct location for pipeline 2024-02-16 13:15:22 +00:00
76f1a5d992 #11 Removed : from pipeline as it caused failure 2024-02-16 13:12:56 +00:00
737e0e7a22 #11 Added variables to allow for connection to registry 2024-02-16 13:07:54 +00:00
31215585da #11 Trying difference permutations to connect to the registry 2024-02-16 13:04:04 +00:00
2ec07edb7e #11 Updated pipeline to pass token via stdin 2024-02-16 12:58:44 +00:00
50ec369dae #11 Updated pipeline to pass password via stdin 2024-02-16 12:55:49 +00:00
cc090daa6d First test of deploying to the container registry 2024-02-16 12:49:13 +00:00
3 changed files with 56 additions and 4 deletions

View File

@@ -2,10 +2,32 @@ variables:
APPSECRET: "test"
ENVIRON: "test"
FILESTORE: "static/assets/img/products/"
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
pytest:
stage: test
tags:
- python
script:
- cd /builds/u5500327/wmgzon
- pip install -r requirements.txt
- pytest
- pytest
deploy:
stage: deploy
tags:
- docker
image: docker:20.10.16
services:
- name: docker:20.10.16-dind
alias: docker
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
only:
- master

View File

@@ -40,4 +40,27 @@ In order to run the web app, simply use the command
docker-compose up -d
```
to run the container in a detatched mode.
to run the container in a detatched mode.
### Container
Alternatively, to deploy the app from the lastest published container:
```yml
version: '3.8'
services:
wmgzon:
container_name: "wmgzon"
image: lukeelse/wmgzon:latest
environment:
- APPSECRET=test
- ENVIRON=prod
- FILESTORE=static/assets/img/products/
tty: true
ports:
- "8080:8080"
volumes:
- ./files:/app/$FILESTORE
restart: unless-stopped
```

View File

@@ -1,8 +1,15 @@
version: '3.8'
services:
gitlab-runner:
gitlab-runner-python:
image: gitlab/gitlab-runner:latest
volumes:
- ./runner-data:/etc/gitlab-runner
- ./runner-data-python:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
gitlab-runner-docker:
image: gitlab/gitlab-runner:latest
volumes:
- ./runner-data-docker:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped