Skip to content

Instantly share code, notes, and snippets.

@angry-dan
Last active August 29, 2015 14:27
Show Gist options
  • Save angry-dan/81563186845bc8d84f26 to your computer and use it in GitHub Desktop.
Save angry-dan/81563186845bc8d84f26 to your computer and use it in GitHub Desktop.
Configuring Jenkins/CI for Drupal
  1. Create a project using the VDD site machine name

  2. Tick "discard old builds"

  3. Set strategy to "Log rotation" and keep 10 builds.

  4. Set source management to git and enter the repository URL.

  5. Checkout develop or master (develop for dev, master for stage).

  6. Set the build to be a shell command and use the following commands:

     ln -s docroot public_html
     echo "This project is managed by Jenkins" > README-jenkins
     rsync -va --delete --exclude=sites/default/files --exclude=.git . /var/www/vhosts/[site]
     make ci ENVIRONMENT=titan-stage
    
  7. Post build set up notifications to appropriate devs.

.PHONY: frontend
ENVIRONMENT=vdd
DRUSH_ARGS= -y --nocolor
update: update-drupal
# Runs whenever Jenkins does a pull.
ci: update
update-drupal:
cd docroot && \
drush $(DRUSH_ARGS) use @$(ENVIRONMENT) && \
drush $(DRUSH_ARGS) cc drush && \
drush $(DRUSH_ARGS) rr --no-cache-clear && \
drush $(DRUSH_ARGS) cc drush && \
drush $(DRUSH_ARGS) master-ensure-modules --scope=test && \
drush $(DRUSH_ARGS) updb && \
drush $(DRUSH_ARGS) fra
frontend:
cd frontend && \
grunt dist
install:
# drush make
# composer install
# cd docroot && drush @vdd en master -y
# cd frontend && npm install
# verify npm, grunt installed
test:
# bin/behat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment