-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (53 loc) · 2.82 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: test and deploy
on:
workflow_dispatch:
inputs:
deploy:
type: boolean
description: Deploy if not a release
default: false
push: ~
release:
types: [published]
env:
RANCHER_PROJECT: Dissemination services
RANCHER_NAMESPACE: arche-exif
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: install exiftool
run: |
sudo apt-get update && sudo apt-get install exiftool
- uses: acdh-oeaw/arche_cicd_start_action@main
with:
phpExtensions: json,yaml,pdo,pdo_sqlite
prepareRepoConfig: true
- name: build docker image
run: |
mkdir build/docroot && cp -R `ls -1 | grep -v ^build` build/docroot/ && cp build/config/arche.yaml build/docroot/config.yaml
docker build --rm -t "acdhch/$RANCHER_NAMESPACE:latest" --build-arg VARIANT=production --label "buildUrl=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" build
- name: test image
run: |
composer require -n zozlak/yaml-merge
vendor/bin/yaml-edit.php --src build/config/arche.yaml --src '{"dissCacheService": {"repoDb": []}, "exif": {"localAccess": null, "maxSizeMb": 50}}' config.yaml
docker run -d --name "$RANCHER_NAMESPACE" -v `pwd`/config.yaml:/var/www/html/config.yaml -p 8080:80 "acdhch/$RANCHER_NAMESPACE:latest"
sleep 1
curl -f 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000C-3476-5'
curl -f 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000C-3476-5'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000C-29F3-4' | grep '400 Bad Request'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000C-29F3-4' | grep '400 Bad Request'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000D-D715-9' | grep '413 Request Entity Too Large'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-000D-D715-9' | grep '413 Request Entity Too Large'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-0011-0DB9-F' | grep '401 Unauthorized'
curl -f -i 'http://127.0.0.1:8080/?id=https://hdl.handle.net/21.11115/0000-0011-0DB9-F' | grep '401 Unauthorized'
- uses: acdh-oeaw/arche_cicd_finish_action@main
with:
pushAndRedeploy: ${{ github.event_name == 'release' && github.event.action == 'published' || inputs.deploy }}
dockerhubLogin: ${{ secrets.DOCKER_USERNAME }}
dockehubPassword: ${{ secrets.DOCKER_PASSWORD }}
imageName: $RANCHER_NAMESPACE
rancherProject: $RANCHER_PROJECT
rancherNamespace: $RANCHER_NAMESPACE
rancherToken: ${{ secrets.RANCHERTOKEN }}
coverallsToken: ${{ secrets.coverallsToken }}