File tree 4 files changed +29
-7
lines changed
4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ RUN echo "Installing python modules in system python versions" \
30
30
# && ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/
31
31
32
32
# Setup ssh for git
33
- RUN test -d ~/ .ssh || mkdir ~ /.ssh \
34
- && touch ~/ .ssh/known_hosts \
35
- && chown -R theia ~ /.ssh \
36
- && chmod -R 600 ~/ .ssh
37
-
38
- RUN grep github.com ~/.ssh/known_hosts > /dev/null || echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~ /.ssh/known_hosts
33
+ RUN test -d /home/theia/ .ssh || mkdir /home/theia /.ssh \
34
+ && chmod 700 /home/theia/ .ssh \
35
+ && touch /home/ theia/.ssh/known_hosts \
36
+ && chmod 644 /home/theia/ .ssh/known_hosts \
37
+ && chown -R theia /home/theia/.ssh \
38
+ && echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" > /home/theia /.ssh/known_hosts
39
39
40
40
USER theia
41
41
WORKDIR /home/theia
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo $GIT_PASS
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ if [[ "$(docker images -q $IMG 2> /dev/null)" == "" ]]; then
6
6
./build_ide.sh
7
7
fi
8
8
9
+ echo
10
+
9
11
git_vars=1
10
12
if [[ -z $GIT_USER ]]; then
11
13
echo " GIT_USER variable not found"
@@ -38,6 +40,7 @@ if [[ -z $GIT_COMMITTER_EMAIL ]]; then
38
40
fi
39
41
40
42
if [[ $git_vars == 0 ]]; then
43
+ echo
41
44
echo " One or more git variables were not set."
42
45
echo " You will not be able to commit inside theia."
43
46
echo
@@ -51,4 +54,4 @@ if [[ $git_vars == 0 ]]; then
51
54
done
52
55
fi
53
56
54
- docker run -it --init -p 3000:3000 -v " $( pwd) :/home/project:cached" -e GIT_USER=" $GIT_USER " -e GIT_PASS=" $GIT_PASS " -e GIT_AUTHOR_NAME=" $GIT_AUTHOR_NAME " -e GIT_COMMITTER_NAME=" $GIT_COMMITTER_NAME " -e GIT_AUTHOR_EMAIL=" $GIT_AUTHOR_EMAIL " -e GIT_COMMITTER_EMAIL=" $GIT_COMMITTER_EMAIL " -e GIT_ASKPASS=/home/project/git_env_password.sh $IMG
57
+ docker run --rm - it --init -p 3000:3000 -v " $( pwd) :/home/project:cached" -e GIT_USER=" $GIT_USER " -e GIT_PASS=" $GIT_PASS " -e GIT_AUTHOR_NAME=" $GIT_AUTHOR_NAME " -e GIT_COMMITTER_NAME=" $GIT_COMMITTER_NAME " -e GIT_AUTHOR_EMAIL=" $GIT_AUTHOR_EMAIL " -e GIT_COMMITTER_EMAIL=" $GIT_COMMITTER_EMAIL " -e GIT_ASKPASS=/home/project/git_env_password.sh $IMG
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ git config credential.https://github.com.username $GIT_USER
4
+
5
+ git_url=$( git config --get remote.origin.url)
6
+
7
+ USER=$( echo $git_url | sed ' s/.*://' | sed ' s/\/.*//' )
8
+ REPO=$( echo $git_url | sed ' s/.*://' | sed ' s/.*\///' )
9
+
10
+ if [[ git_url != " https://" ** ]];
11
+ then
12
+ echo " You must use the 'https://github.com/...' git url and not '[email protected] :..'"
13
+ echo " you can set this with:"
14
+
15
+ echo " git remote set-url origin https://github.com/$USER /$REPO "
16
+ exit 1
17
+ fi
You can’t perform that action at this time.
0 commit comments