forked from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmemsource-upload.sh
executable file
·38 lines (27 loc) · 990 Bytes
/
memsource-upload.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
#!/usr/bin/env bash
set -exuo pipefail
source ./i18n-scripts/languages.sh
while getopts v:s: flag
do
case "${flag}" in
v) VERSION=${OPTARG};;
s) SPRINT=${OPTARG};;
*) echo "usage: $0 [-v] [-s]" >&2
exit 1;;
esac
done
BRANCH=$(git branch --show-current)
echo "Creating project with title \"[OCP $VERSION] UI Localization networking-console-plugin - Sprint $SPRINT/Branch $BRANCH\""
PROJECT_INFO=$(memsource project create --name "[OCP $VERSION] UI Localization networking-console-plugin - Sprint $SPRINT/Branch $BRANCH" --template-id zBOwr4BxYwEq7xlJ37c1F3 -f json)
PROJECT_ID=$(echo "$PROJECT_INFO" | jq -r '.uid')
echo "Exporting PO files"
yarn export-pos
echo "Exported all PO files"
echo "Creating jobs for exported PO files"
for i in "${LANGUAGES[@]}"
do
memsource job create --filenames po-files/"$i"/*.po --target-langs "$i" --project-id "${PROJECT_ID}"
done
echo "Uploaded PO files to Memsource"
# Clean up PO file directory
rm -rf po-files