Skip to content

Commit

Permalink
Run as an unpriviledged user. Add some more test tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Aug 18, 2018
1 parent c015ae8 commit bf0cce2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ ADD . /build-tools-ci

# Collect the components we need for this image
RUN apt-get update
RUN apt-get install -y ruby jq
RUN gem install circle-cli
RUN composer -n global require -n "hirak/prestissimo:^0.3"

# Create an unpriviliged testuser
RUN groupadd -g 999 tester && \
useradd -r -m -u 999 -g tester tester && \
chown -R tester /usr/local && \
chown -R tester /terminus-plugin-test
USER tester

RUN mkdir -p /usr/local/share/terminus
RUN /usr/bin/env COMPOSER_BIN_DIR=/usr/local/bin composer -n --working-dir=/usr/local/share/terminus require pantheon-systems/terminus:"^1.8"
RUN mkdir -p /usr/local/share/drush
RUN /usr/bin/env composer -n --working-dir=/usr/local/share/drush require drush/drush "^8"
RUN ln -fs /usr/local/share/drush/vendor/drush/drush/drush /usr/local/bin/drush
RUN chmod +x /usr/local/bin/drush

# Add a collection of useful Terminus plugins
env TERMINUS_PLUGINS_DIR /usr/local/share/terminus-plugins
RUN mkdir -p /usr/local/share/terminus-plugins
RUN composer -n create-project -d /usr/local/share/terminus-plugins pantheon-systems/terminus-build-tools-plugin:^1
Expand All @@ -27,3 +38,23 @@ RUN composer -n create-project -d /usr/local/share/terminus-plugins pantheon-sys
RUN composer -n create-project -d /usr/local/share/terminus-plugins pantheon-systems/terminus-drupal-console-plugin:^1
RUN composer -n create-project -d /usr/local/share/terminus-plugins pantheon-systems/terminus-mass-update:^1
RUN composer -n create-project -d /usr/local/share/terminus-plugins pantheon-systems/terminus-site-clone-plugin:^1

# Add phpcs for use in checking code style
RUN mkdir ~/phpcs && cd ~/phpcs && COMPOSER_BIN_DIR=/usr/local/bin composer require squizlabs/php_codesniffer:^2.7

# Add phpunit for unit testing
RUN mkdir ~/phpunit && cd ~/phpunit && COMPOSER_BIN_DIR=/usr/local/bin composer require phpunit/phpunit:^6

# Add bats for functional testing
RUN git clone https://github.com/sstephenson/bats.git; bats/install.sh /usr/local

# Add behat for more functional testing
RUN mkdir ~/behat && \
cd ~/behat && \
COMPOSER_BIN_DIR=/usr/local/bin \
composer require \
"behat/behat:^3.1" \
"behat/mink:*" \
"behat/mink-extension:^2.2" \
"behat/mink-goutte-driver:^1.2" \
"drupal/drupal-extension:*"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@ This is the source Dockerfile for the [pantheon-public/build-tools-ci](https://q
- [Terminus Composer Plugin](https://github.com/pantheon-systems/terminus-composer-plugin)
- [Terminus Drupal Console Plugin](https://github.com/pantheon-systems/terminus-drupal-console-plugin)
- [Terminus Mass Update Plugin](https://github.com/pantheon-systems/terminus-mass-update)
- Test tools
- phpunit
- bats
- behat
- php_codesniffer
- Test scripts

## Branches

- 1.x: A collection of Terminus plugins
- 2.x: Add more components. Run as an unpriviledged user.

0 comments on commit bf0cce2

Please sign in to comment.