-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
36 lines (33 loc) · 1.45 KB
/
.gitlab-ci.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
image: ruby:2.3
variables:
JEKYLL_ENV: production
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apt-get -qq update && apt-get -qq install -y tor netcat-openbsd openssh-server openssh-client
- /etc/init.d/tor start
- mkdir -p ~/.ssh && touch ~/.ssh/config
- echo "$PRIVATE_KEY" > ~/.ssh/deploy_key
- touch ~/.ssh/known_hosts
- chmod 600 ~/.ssh/known_hosts
- chmod 600 ~/.ssh/deploy_key
- echo "Unset DISPLAY and SSH_ASKPASS variable" && unset DISPLAY && unset SSH_ASKPASS
- echo "StrictHostKeyChecking=no" >> ~/.ssh/config
- echo "Host *.onion" >> ~/.ssh/config
- echo " ProxyCommand /usr/bin/nc -x localhost:9050 %h %p" >> ~/.ssh/config
- eval $(ssh-agent)
- echo "Add deploy key to keychain" && ssh-add ~/.ssh/deploy_key
- echo "Wait 20 seconds to bootstrap" && sleep 20
- git submodule sync --recursive
- git submodule foreach git pull origin master
- echo "Build to _site" && rake deploy
pages:
stage: deploy
script:
- bundle exec jekyll build -d public
- echo "Test tor connection (9050)" && nc -vz localhost 9050
- echo "Making deploy to nlboxqa32a4mja67wgnowska7gsnhyonu6dzry3whd6cba277hkbmcid.onion" && cd _site/ && scp -o "ProxyCommand nc -x localhost:9050 %h %p" -o "StrictHostKeyChecking=no" -o "ConnectTimeout=120" -o "UserKnownHostsFile=/dev/null" -r * deploy@2ma67qeyulhuw4xl.onion:/www-onions
artifacts:
paths:
- public
only:
- master