-
Notifications
You must be signed in to change notification settings - Fork 19
/
post-service-descriptors.sh
executable file
·55 lines (50 loc) · 1.66 KB
/
post-service-descriptors.sh
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
55
#!/usr/bin/env bash
# run locally with something like this:
# ./post-service-descriptors.sh http://localhost:8091/coreservices/rest/v1/services
# or
# docker run -it --rm -v $PWD:$PWD:Z -w $PWD --network deploy_squonk_back centos:7 ./post-service-descriptors.sh
set -e
POST=${1:-http://coreservices:8080/coreservices/rest/v1/services}
BASE_D=docker://github.com/InformaticsMatters/pipelines
BASE_N=nextflow://github.com/InformaticsMatters/pipelines
IMAGE_TAG=${IMAGE_TAG:-}
CT_DJ="application/x-squonk-service-descriptor-docker+json"
CT_DY="application/x-squonk-service-descriptor-docker+yaml"
CT_MM="multipart/mixed"
echo BASE_D="${BASE_D}"
echo BASE_N="${BASE_N}"
echo IMAGE_TAG="${IMAGE_TAG}"
for d in 'src/python/pipelines/dmpk' \
'src/python/pipelines/docking' \
'src/python/pipelines/rdkit' \
'src/python/pipelines/dimorphite'
do
for file in $d/*.dsd.yml
do
echo $file
curl -X POST \
-T $file\
-H "Content-Type: $CT_DY"\
-H "Base-URL: $BASE_D"\
-H "Image-Tag: $IMAGE_TAG"\
$POST
echo ""
done
done
for d in 'src/nextflow/docking' \
'src/nextflow/rdkit'
do
for file in $d/*.nsd.yml
do
basename=${file::-4}
echo $basename
curl -X POST \
-F "nextflow.nsd.yml=@${basename}.yml;type=application/x-squonk-service-descriptor-nextflow+yaml;filename=nextflow.nsd.yml"\
-F "nextflow.nf=@${basename}.nf;type=text/plain;filename=nextflow.nf"\
-F "nextflow.config=@${basename}.config;type=text/plain;filename=nextflow.config"\
-H "Content-Type: $CT_MM"\
-H "Base-URL: $BASE_N"\
$POST
echo ""
done
done