-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.58 KB
/
deploy-configset-production.yml
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
name: Production deploy Solr configset
on:
workflow_dispatch:
inputs:
tag:
description: tag
required: true
configset_name:
description: name of the configset. Usually biblio_yyyymmdd
required: true
jobs:
deploy-configset:
name: Zip and send configset
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check that the tag exists in repo
id: tag_check
run: |
if git rev-parse 'refs/tags/${{ inputs.tag }}' &> /dev/null; then
echo 'tag=${{ inputs.tag }}' >> $GITHUB_OUTPUT
else
echo "Couldn't figure out tag from input: ${{ inputs.tag }}"
echo "Aborting deployment."
false
fi
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ steps.tag_check.outputs.tag }}
- name: zip configset
env:
TAG: ${{ steps.tag_check.outputs.tag }}
run: |
cd biblio/conf
echo -n $TAG > version.txt
zip -r ../biblio.zip .
- name: send configset to production
env:
USER: ${{ vars.SOLR_USER }}
PASSWORD: ${{ secrets.SOLR_PASSWORD }}
HOST: ${{ vars.SOLR_HOST }}
BIBLIO: ${{ github.event.inputs.configset_name }}
run: |
cd biblio
echo "Sending configset"
# -f causes non 0 return if not response 200
curl -f -u $USER:$PASSWORD -X PUT --header "Content-Type: applicatgion/octet-stream" --data-binary @biblio.zip "$HOST/api/cluster/configs/$BIBLIO" || exit