Git is an awesome robot in a clown suit.
— Brian Panulla (@bpanulla) May 16, 2018
Create branch
git checkout -b card-element
# same as
git branch card-element
git checkout card-element
Work on feature/issue
git commit -a -m "added new card-element"
Merge in branch
git branch
git checkout master
# check with remote
git pull origin master
git merge card-element
# optionally delete branch when done
git branch -d card-element
Send to GitLab
# optionally tag 2018-# or tag in GitLab
git push origin master
FROM wordpress:4.9.8-apache
LABEL maintainer="Mike Henderson mhenderson@adams.edu"
RUN apt-get update && apt-get install -y \
curl zip unzip git libldap2-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install ldap \
&& apt-get purge -y --auto-remove libldap2-dev \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
RUN mkdir -p /root/.ssh
COPY id_rsa /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa
RUN echo "Host ourGitLab.adams.edu\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
## Pull in Parent Theme
RUN git clone -b 2.2.5 --depth 1 \
git@ourGitLab.adams.edu:web-dev/jumpstart.git \
/usr/src/wordpress/wp-content/themes/jumpstart
## Pull in Adams Child Theme
RUN git clone -b 1.26 --depth 1 \
git@ourGitLab.adams.edu:web-dev/adamsstate.git \
/usr/src/wordpress/wp-content/themes/adamsstate
## Pull in wp-all-import
RUN git clone -b 4.5.1 --depth 1 \
git@ourGitLab.adams.edu:web-dev/wp-all-import-pro.git \
/usr/src/wordpress/wp-content/plugins/wp-all-import-pro
## Pull in composer file and run
COPY composer.json .
RUN composer install
--verbose --profile --prefer-dist --no-autoloader
# Make NFS mount point, set ownership, symlink into wordpress
RUN mkdir /uploads
RUN chown www-data:www-data /uploads
RUN ln -s /uploads /usr/src/wordpress/wp-content/uploads
networks:
wwwt
…
services:
wwwt-mariadb:
image: mariadb:10.2.14
…
wwwt-wordpress:
image: registry.adams.edu/web-dev/www-docker:2018-39
volumes:
- type: volume
source: wwwt-uploads
target: /uploads
delpoy:
mode: replicated
replicas: 2
before_script:
- docker info
deploy-wwwt:
stage: deploy
tags:
- swarm
script:
- docker stack deploy --with-registry-auth
--compose-file=docker-compose-wwwt.yml wwwt
when: manual