Skip to content
Raimond Garcia edited this page Jan 14, 2019 · 24 revisions

Welcome to the Madrid's Consul wiki!

Flaky Tests handling:

https://github.com/AyuntamientoMadrid/consul/wiki/How-to-handle-flaky-specs

Test localhost on mobile/tablet

  1. Check your computer IP (i.e. 192.168.1.1)
  2. Launch rails server rails server -b 192.168.1.1
  3. On your device open http://192.168.1.1:3000 and test

Upload file to shared folder across preproduction or production servers

For a given FILENAME, FOLDERS structure, and ENV (decidepre/decidepro)

  1. SSH into the server and navigate into shared files folder:
ssh ENV
cd participacion/shared/public/system

Maybe create additional FOLDERS inside that directory?

  1. Upload file
scp FILENAME.pdf deploy@ENV:/aytomad/app/participa/participacion/shared/public/system/FOLDERS/FILENAME.pdf
  1. Get the url... something like https://decide.madrid.es/system/FOLDERS/FILENAME.pdf

Deploy

If you get an error while trying to ssh a server or do a capistrano deployment, you may have to ssh the proxy again:

ssh decideproxy ssh-add

To do a deploy to an ENV (preproduction/production):

  1. Cleanup releases
cap ENV deploy:cleanup
  1. Run the deploy script (preproduction will deploy master branch, production will deploy stable)
cap ENV deploy

To deploy an specific branch to an ENV:

cap ENV deploy branch=BRANCH_NAME

Execute Rake tasks on servers

bin/rake csv:export RAILS_ENV=preproduction

Execute Rails Console on server

ssh decidepre
cd participacion/current
bin/rails c preproduction

Consul => Madrid pull

Check current status with: https://github.com/AyuntamientoMadrid/consul/compare/master...consul:master

Ensure you have a consul remote like:

$ git remote -v
consul git@github.com:consul/consul.git (fetch)
consul git@github.com:consul/consul.git (push)
origin git@github.com:AyuntamientoMadrid/consul.git (fetch)
origin git@github.com:AyuntamientoMadrid/consul.git (push)

  1. Create new branch from master and merge consul's master branch:
git checkout master
git pull
git checkout -b upstream
git fetch consul
git merge consul/master
  1. Fix any merge conflicts, and git push
  2. Fill PR description with included Consul's PR links and Consul pull ⬇️ title https://github.com/AyuntamientoMadrid/consul/compare/master...upstream
  3. After merging that PR, open a new one from master to stable with title Deploy to Pro 🚀: https://github.com/AyuntamientoMadrid/consul/compare/stable...master

Refresh sitemap

rake sitemap:refresh:no_ping

Download server logs to your machine

scp deploy@decidepro:~/participacion/current/log/production.log ~/your_local_directory

How to contact IAM (Informática Ayuntamiento de Madrid):

Regarding databases: admindb@madrid.es

Regarding new requests iampeticiones@madrid.es

Regarding adding public ssh keys to servers servidorvirtualiam@madrid.es with carbon copy to tecnoiamwebsolicitud@madrid.es

Regarding malfunctions

Centro de atención de Incidencias de Informática y Comunicaciones del Ayuntamiento de Madrid (SICAM)

SICAM's Phone:

  • 33033 if calling from within a Government building
  • 915133033 if calling from outside a Government building

SICAM's Officing hours: 07:30 - 22.00 Monday to Friday

You will need your AYRE username and our office's phone number: 91 480 21 79 The name of our application is "Participación Ciudadana"