forked from aws/sagemaker-code-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_code_editor_tarball.sh
More file actions
executable file
·38 lines (33 loc) · 1.03 KB
/
create_code_editor_tarball.sh
File metadata and controls
executable file
·38 lines (33 loc) · 1.03 KB
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
#!/bin/bash
while getopts "v:" opt; do
case $opt in
v) version="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac
case $OPTARG in
-*) echo "Option $opt needs a valid argument"
exit 1
;;
esac
done
if [[ -z $version ]]; then
echo "Please provide version using '-v'";
exit 1
fi
VERSION=$version
# Set current project root
PROJ_ROOT=$(pwd)
mkdir -p ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}
rm -rf ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src
mkdir -p ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src
cp -a ${PROJ_ROOT}/vscode/. ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}/src/
rm -rf ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}.tar.gz
cd ${PROJ_ROOT}/sagemaker-code-editor
tar -czf code-editor${VERSION}.tar.gz code-editor${VERSION}
cd ${PROJ_ROOT}
cp ${PROJ_ROOT}/sagemaker-code-editor/code-editor${VERSION}.tar.gz ${PROJ_ROOT}/
rm -rf ${PROJ_ROOT}/sagemaker-code-editor
sha256sum ${PROJ_ROOT}/code-editor${VERSION}.tar.gz