summaryrefslogblamecommitdiff
path: root/.gitlab-ci.yml
blob: d8e2c2ee02d50222b630abd6b477ba93826ec5c2 (plain) (tree)
1
2
3
4


        
                   











                                     

            

                      
                                                                           



                                    


                                     
                                                                                                                                                                                                                            


                                    




                                                                                                





            
          
stages:
- deploy

image: ubuntu:18.04
before_script:
  - uname -a

pages:
  stage: deploy
  variables:
    GIT_STRATEGY: clone
    GIT_SUBMODULE_STRATEGY: recursive
    GIT_DEPTH: "1"
    UPDATE_DIR: "../../../public"
    UPDATE_HTTP: "none"
    CC: "clang"
  tags:
    - glados
  script:
  - apt-get -qq update
  - apt-get install -qq -y make clang zip zlib1g-dev zlibc python ssh rsync
  - mkdir public
  - make updates
  - make news
  - cp -v world/map/news.txt public/
  - cp -v world/map/news.html public/
  - cp -v world/map/news.rss public/
  - cp -v world/map/news.json public/
  - echo '<title>static update server</title><a href="TMW.zip">TMW.zip</a><br><a href="TMW-music.zip">TMW-music.zip</a><br><a href="news.txt">news.txt</a><br><a href="resources.xml">resources.xml</a>' > public/index.html
  # path for legacy compatibility
  - mkdir -p public/updates
  - cp -v public/*.* public/updates/
  - echo "Now deploying..."
  - mkdir -p ~/.ssh
  - echo "${SSH_PRIVATE_KEY}" | base64 -d | tr -d '\r' > ~/.ssh/id_rsa
  - chmod -R 700 ~/.ssh
  - rsync -e 'ssh -p 22 -o StrictHostKeyChecking=no' -aHv --delete $MYHOST:$FILE_LOCATION public
  artifacts:
    paths:
    - public
  only:
  - web
  - pushes
  - stable