Ticket #744 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Add CSS Injector module to the D6 mix

Reported by: annesley Owned by: annesley
Priority: minor Milestone: Maintenance
Component: Unassigned Keywords: CSS, client, project
Cc: ed, paul Estimated Number of Hours: 1.0
Add Hours to Ticket: 0 Billable?: yes
Total Hours: 1.75

Description

CSS Injector module allows admin dynamic adding of CSS in to a live production server without code updates. this is to respond quickly to client needs whilst implementing the requests in the correct place in the themes on the next promotion from dev.

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by annesley

@Paul: so, i am getting up to speed on the topology of TNv2 D6 project.
custom areas of code are in separate github repositories, not the whole codebase.
so changes to our transition theme would be a git pull / diff / add / push job involving local work, staging server, testing and live server. git then is the rollback provider if needed.

however, my installation of this third party CSS injector module would not involve github.
the module would get installed in a development copy of the system ready for next general promotion?
or do we promote parts as and when we want to?
where is your stage platform?
where is the live */modules/* directory on puffin?
what sort of backups should be run before this process?

thanks, A

comment:2 in reply to: ↑ 1 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.5
  • Total Hours changed from 0.0 to 0.5

Replying to annesley:

@Paul: so, i am getting up to speed on the topology of TNv2 D6 project.
custom areas of code are in separate github repositories, not the whole codebase.
so changes to our transition theme would be a git pull / diff / add / push job involving local work, staging server, testing and live server. git then is the rollback provider if needed.

That sounds right.

A development site is always built from a makefile, that pulls in static content from Drupal / Github. So if you want to want to make changes to the theme, then you need to delete the static version of the theme and clone a copy of the theme from Github so that you can push your changes back. Maybe we could take a diff of any changes, and then apply that directly to the production site, knowing that these changes will automatically be pulled into the next platform build?

however, my installation of this third party CSS injector module would not involve github.
the module would get installed in a development copy of the system ready for next general promotion?
or do we promote parts as and when we want to?

I think the way it's worked in the past is to do something along the lines of what I suggested above.

where is your stage platform?

/data/disk/tn/static/transition-network-d6-s012 (platform)

where is the live */modules/* directory on puffin?

/data/disk/tn/static/transition-network-d6-s012/sites/all/modules (platform modules)

/data/disk/tn/static/transition-network-d6-s012/sites/booker-stage-20140501.transitionnetwork.org/modules (site specific modules)

what sort of backups should be run before this process?

I think, if we're making a "quick" change on the production server (i.e not building a new platform with Aegir) we just need to ensure that we can rewind if things go wrong. So with the theme changes, we just need to know that we can kill the static version of the theme on our server and clone it again form github and nothing changes; if something then goes wrong - perhaps after applying a diff to the theme on the production site - then we can delete the theme, and clone the theme again from github

thanks, A

comment:3 follow-up: ↓ 4 Changed 2 years ago by annesley

so: i want to place the css_injector project in to the live D6 transitionnetwork.org website.
1) for the stage website on puffin:/data/disk/tn/static/transition-network-d6-s012/sites/all/modules
drush dl css_injector
drush en css_injector

2) update the d6 makefile on github.com:
git clone https://github.com/transitionnetwork/transitionnetwork.org-d6.profile
this looks like a manually created drush makefile (not with drush make-generate)
so i would add these lines in to transitionnetwork.org-d6.make:

projects[css_injector][subdir] = "contrib"

git add transitionnetwork.org-d6.make
git commit
git status
git push

3) test stage site with:
booker-stage-20140501.transitionnetwork.org

4) add the module to live:
where are the live directories?

thanks :)

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 0.5 to 0.75

Replying to annesley:

so: i want to place the css_injector project in to the live D6 transitionnetwork.org website.
1) for the stage website on puffin:/data/disk/tn/static/transition-network-d6-s012/sites/all/modules
drush dl css_injector
drush en css_injector

2) update the d6 makefile on github.com:
git clone https://github.com/transitionnetwork/transitionnetwork.org-d6.profile
this looks like a manually created drush makefile (not with drush make-generate)
so i would add these lines in to transitionnetwork.org-d6.make:

Maybe, we could both fork the site from the main github site and send push requests to our own individual forks, and then finally send a pull request to be picked up at the main gitub account. I have a push request to make.

projects[css_injector][subdir] = "contrib"

git add transitionnetwork.org-d6.make
git commit
git status
git push

3) test stage site with:
booker-stage-20140501.transitionnetwork.org

If the module work find on the stage site (copy of production) I think were then good to update the makefile and add the module to the production site using drush. No need to rebuild the platform with the new makefile.

4) add the module to live:
where are the live directories?

Currently ..

/data/disk/tn/static/transition-network-d6-p010-booker/sites/all/modules/contrib/

thanks :)

comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 2 years ago by paul

Replying to paul:

Replying to annesley:

so: i want to place the css_injector project in to the live D6 transitionnetwork.org website.
1) for the stage website on puffin:/data/disk/tn/static/transition-network-d6-s012/sites/all/modules
drush dl css_injector
drush en css_injector

2) update the d6 makefile on github.com:
git clone https://github.com/transitionnetwork/transitionnetwork.org-d6.profile
this looks like a manually created drush makefile (not with drush make-generate)
so i would add these lines in to transitionnetwork.org-d6.make:

Maybe, we could both fork the site from the main github site and send push requests to our own individual forks, and then finally send a pull request to be picked up at the main github account. I have a push request to make.

projects[css_injector][subdir] = "contrib"

git add transitionnetwork.org-d6.make
git commit
git status
git push

3) test stage site with:
booker-stage-20140501.transitionnetwork.org

If the module works find on the stage site (copy of production) I think were then good to update the makefile and add the module to the production site using drush. No need to rebuild the platform with the new makefile.

4) add the module to live:
where are the live directories?

Currently ..

/data/disk/tn/static/transition-network-d6-p010-booker/sites/all/modules/contrib/

thanks :)

Last edited 2 years ago by paul (previous) (diff)

comment:6 in reply to: ↑ 5 Changed 2 years ago by annesley

hi paul. may i suggest that we keep it as simple as possible. so we keep a non-forked copy on our personal dev machines (e.g. my laptop). no major multiple programmer development work will be happening on the D6 site so i suggest that we do not need to use GIT fully.

i will attempt to drush the cs_injector module on to puffin stage now at...
/data/disk/tn/static/transition-network-d6-s012/sites/all/modules/contrib/

Replying to paul:

Replying to paul:

Replying to annesley:

so: i want to place the css_injector project in to the live D6 transitionnetwork.org website.
1) for the stage website on puffin:/data/disk/tn/static/transition-network-d6-s012/sites/all/modules
drush dl css_injector
drush en css_injector

2) update the d6 makefile on github.com:
git clone https://github.com/transitionnetwork/transitionnetwork.org-d6.profile
this looks like a manually created drush makefile (not with drush make-generate)
so i would add these lines in to transitionnetwork.org-d6.make:

Maybe, we could both fork the site from the main github site and send push requests to our own individual forks, and then finally send a pull request to be picked up at the main github account. I have a push request to make.

projects[css_injector][subdir] = "contrib"

git add transitionnetwork.org-d6.make
git commit
git status
git push

3) test stage site with:
booker-stage-20140501.transitionnetwork.org

If the module works find on the stage site (copy of production) I think were then good to update the makefile and add the module to the production site using drush. No need to rebuild the platform with the new makefile.

4) add the module to live:
where are the live directories?

Currently ..

/data/disk/tn/static/transition-network-d6-p010-booker/sites/all/modules/contrib/

thanks :)

comment:7 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.125
  • Total Hours changed from 0.75 to 0.875

Since the recent update the the module will need to be downloaded to ..

/data/disk/tn/static/transition-network-d6-32-s002-booker/sites/all/modules/contrib

http://booker-stage-20140717.transitionnetwork.org

Last edited 2 years ago by paul (previous) (diff)

comment:8 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.125
  • Total Hours changed from 0.875 to 1.0

For production ..

/data/disk/tn/static/transition-network-d6-32-p001-booker/sites/all/modules/contrib/

I'll push to the main repository in future. Thanks.

comment:9 Changed 2 years ago by annesley

FYI: i added myself to the developer role on staging

tn.ftp:[booker-stage-20140717.transitionnetwork.org]$ drush user-add-role --uid=613 "developer"

comment:10 Changed 2 years ago by annesley

and:
drush role-add-perm developer "administer css injection"

comment:11 Changed 2 years ago by annesley

https://booker-stage-20140717.transitionnetwork.org/admin/settings/css_injector
now has an extra rule in to put a dotted line around the css_injector settings body

there are 2 errors on the staging site after a cache clear:
these may have already been there and they do not repeat after the initial cache clear.

1) "Missing Feeds plugin FeedsUserNotificationProcessor?. See rob_s_blog_user_import_with_notification. Check whether all required libraries and modules are installed properly."
2) "Image resize threshold of 10 remote images has been reached. Please use fewer remote images."

are these known about already?

comment:12 follow-up: ↓ 23 Changed 2 years ago by annesley

i added a new Mulling transition initiative in Afghanistan and it did not appearing on the map... i flushed caches and then it started appearing on the main initiatives map. is this intended? is it a known?

comment:13 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 1.0 to 1.25

I have seen both of these, many times. They appear to be benign and transient.

I couldn't find anything documented on the ticketing system / wiki; only the following ticket which shows the error in passing:
https://tech.transitionnetwork.org/trac/ticket/727

Nice drush commands :) I haven't used those before. Thanks for sharing.

comment:14 Changed 2 years ago by annesley

:D drush rocks. ok, cool, i think that is all the testing i want to do. css_injector is super simple anyway. so: i will drush it on to live as well now, run the drush commands and test.

comment:15 Changed 2 years ago by annesley

can't run drush on production... my account is too locked down it seems for drush to analyse it's environment. and one should not run drush as root, or so it says.

shall i use the web interface to finish the job? i would very much prefer using drush command line...
is there a unix user / group i could be added to that would allow drush use? am i doing something stupid?

comment:16 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 1.25 to 1.5

Maybe try a git pull from drupal.org.

I just created a push request / merge; the profile / makefile is now up to date. Would you add the css_injector module to the profile.

Thanks.

https://github.com/transitionnetwork/transitionnetwork.org-d6.profile

comment:17 follow-up: ↓ 18 Changed 2 years ago by annesley

the files are copied already using SFTP.

i want to add the permissions to the role also and will generally need to run lots of drush commands in the future... it's invaluable. i can use the web interface to do this however. it's just that it is clunky and slow.

comment:18 in reply to: ↑ 17 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.125
  • Total Hours changed from 1.5 to 1.625

Replying to annesley:

the files are copied already using SFTP.

In the future we will need to build a new production site from the makefile - so, we will we probably want to have that module included in the makefile.

i want to add the permissions to the role also and will generally need to run lots of drush commands in the future... it's invaluable. i can use the web interface to do this however. it's just that it is clunky and slow.

Sorry, I was thinking of using git only as temporary solution. Chris will advise on the availability of drush on the production server.

comment:19 follow-up: ↓ 21 Changed 2 years ago by annesley

ok, i have pulled your changes down to my clone transitionnetwork.org-d6.profile and i can see the pressflow core update and the location module update.

i have pushed my css_injector changes up.

i assume you are watching the repository and got email confirmation?

comment:20 Changed 2 years ago by annesley

ok, i enabled the css_injector module through the web interface, added the "administer css injection" permission to "developer" and cleared caches.

everything seems to be fine :D

comment:21 in reply to: ↑ 19 Changed 2 years ago by paul

  • Add Hours to Ticket changed from 0.0 to 0.125
  • Total Hours changed from 1.625 to 1.75

Replying to annesley:

ok, i have pulled your changes down to my clone transitionnetwork.org-d6.profile and i can see the pressflow core update and the location module update.

i have pushed my css_injector changes up.

Cool

i assume you are watching the repository and got email confirmation?

Well, I am watching (notified of all conversations) but not received an email so far. Nothing in my spam folder. I'll look into this later - on my own time - if there's a problem there.

comment:22 Changed 2 years ago by annesley

  • Status changed from new to closed
  • Resolution set to fixed

comment:23 in reply to: ↑ 12 Changed 2 years ago by ed

Replying to annesley:

i added a new Mulling transition initiative in Afghanistan and it did not appearing on the map... i flushed caches and then it started appearing on the main initiatives map. is this intended? is it a known?

has this question been answered? it sounds quite important to me...

comment:24 Changed 2 years ago by annesley

i made a separate ticket...

comment:25 Changed 2 years ago by ed

so is this to be closed? what separate ticket?

comment:26 Changed 2 years ago by annesley

here is the separate ticket for the imediate TI aperance after adding: https://tech.transitionnetwork.org/trac/ticket/772

Note: See TracTickets for help on using tickets.