Skip to content

Commit

Permalink
Merge master back into branch to resolve merge conflicts and close br…
Browse files Browse the repository at this point in the history
…anch.
  • Loading branch information
Seonaid committed Jun 24, 2021
2 parents 3291111 + f7b8f1b commit 619650a
Show file tree
Hide file tree
Showing 40 changed files with 1,232 additions and 1,025 deletions.
Empty file added content/_index.md
Empty file.
8 changes: 4 additions & 4 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ title: Drumkit
---
# What is Drumkit

Drumkit is a collection of scripts and templates designed to standardize and integrate some of the most frequent tasks we encounter in the local development of Drupal sites.
Drumkit is a collection of scripts and templates designed to standardize and integrate some of the most frequent tasks we encounter in the local development of [Drupal](https://en.wikipedia.org/wiki/Drupal) sites.

It includes the abilty to:
- Initialize a new Drupal project on [Lando](https://lando.dev/)
- Initialize and publish a collection of Packer images for use in CI deployment
- Initialize and publish a collection of [Packer](https://www.packer.io/) images for use in [CI](https://en.wikipedia.org/wiki/Continuous_integration) deployment
- Initialize and run a documentation site for the project using the [Hugo](http://gohugo.io/) static site generator
- Install gitlab-runner locally for testing of Gitlab CI pipelines before pushing changes
- Integrate with ansible and Aegir for provisioning and deployment to production systems
- Install gitlab-runner locally for testing of [Gitlab CI](https://docs.gitlab.com/ee/ci/) pipelines before pushing changes
- Integrate with [Ansible](https://en.wikipedia.org/wiki/Ansible_(software)) and [Aegir](https://www.aegirproject.org/) for provisioning and deployment to production systems


## Quick Start
Expand Down
24 changes: 21 additions & 3 deletions docs/content/development/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ mkdir myproject
cd myproject
git init
wget -O - https://drumk.it/install-dev | /bin/bash
wget -O - https://drumk.it/installer | /bin/bash
source d
```
**This installation will only work if you are a member of the `drumkit` project and have a public key on GitLab.**
**If you are a member of the `drumkit` project and have a public key on GitLab, you can set up your project to push directly to the remote following the ensuing instructions. Otherwise you will need to fork the project and make pull requests from your fork of the repo.**

Otherwise you will need to fork the project and make pull requests from your fork of the repo.
Because we have a hard requirement for 2FA in this project, you cannot push changes without setting up SSH. *However*, the CI pipeline requires the submodule URL to be specified using https, or it would require an SSH key pair to be available on the image.

*Once you have installed drumkit in your project directory*
```
cd .mk
git config url."[email protected]:".pushInsteadOf https://gitlab.com/
git remote -v
```

At this point, you should see that the origin is using `https` for `fetch`, and `ssh` for `push`. This is now properly configured for developing and pushing changes to `drumkit` itself, not just the surrounding project.

### What happens

Expand All @@ -45,3 +54,12 @@ Drumkit is designed to gather all the necessary binaries for a particular projec
At this point, you will be able to make changes to the files inside drumkit (below the `.mk` folder) and push them to the drumkit repo.

However, most of the impacts of using Drumkit occur at the root directory, so there is an additional layer of abstraction to consider.

#### Common points of failure

When [testing](testing), for example, you need to remain aware of whether you are calling certain things (behat features, for example) from the project directory or from the `.mk` directory. Additionally, you need to keep the submodule and the project in sync.

If you make changes to the `.mk` directory and then commit them in the containing project, you must push the `.mk` branch before pushing changes to the project, or the CI process is likely to fail, being unable to retrieve the correct commit of the Drumkit project.



2 changes: 2 additions & 0 deletions docs/content/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ Some of the projects have a `ci-local` target (or a `<project>-ci-local` target)

However, there is a limitation in `gitlab-runner`: You cannot navigate into the `.mk` directory and run the pipeline at that level, because it cannot parse the relative paths to the subdirectory, which must be used as the repo for the pipeline. [More info on the gitlab ticket - not ours to fix](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2054)


## Testing the output from Drumkit

The ultimate test of Drumkit is that it pushes working code to the (surrounding/containing) project you are working on with it.

Process:
If you are developing Drumkit, per se, you should test and push the project as well as the drumkit code. This ensures that any modifications we make to (for example) `.gitlab-ci.yml` templates produces the correct files in the end.

4 changes: 0 additions & 4 deletions docs/content/install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ $ make composer
Install Composer.
$ make composer COMPOSER_REL=1.0.0-beta1
Install the 1.0.0-beta1 release of Composer.
$ make drush
Install Drush.
$ make drush DRUSH_REL=8.0.5
Install the 8.0.5 release of Drush.
$ make behat
Install Behat.
$ make selenium
Expand Down
2 changes: 1 addition & 1 deletion docs/content/usage/drupal.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ make init-project-drupal

This will prompt you for some information to populate your project:

* Project name (no spaces), which will become the first part of the **`https://[projectname].lndo.site`** URL that Lando assigns to your project.
* Project name (no spaces, *no underscores*! They are an illegal character in Apache, and will cause silent failures). This will become the first part of the **`https://[projectname].lndo.site`** URL that Lando assigns to your project.
* Site name, the human-readable name for the site (used for `make install` command, etc.)
* Database credentials, to feed to Lando to setup and wire into the Drupal install (settings.php)
* Admin username and password for the site once installed.
Expand Down
7 changes: 5 additions & 2 deletions docs/content/usage/hugo-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ This file is used by gitlab-runner to trigger the CI tests.
Edit the submodule information in `.gitmodules` at the root of the containing project. Change the URL of .mk to: https://gitlab.com/consensus.enterprises/drumkit.git



### Deployment

The deployment to Gitlab Pages is managed automatically by the `.gitlab-ci.yml` file.

At the bottom of the file, under `pages`, the `publish` stage will run `hugo` in the docs folder, which generates a set of static HTML files in the `public` folder, which is then made available through Gitlab pages.

The address at Gitlab Pages will be `http://<GITLAB_GROUP>.gitlab.io/<GITLAB_PROJECT_NAME>/`

The address at Gitlab Pages will be `http://<GITLAB_GROUP>.gitlab.io/<GITLAB_PROJECT_NAME>/`

To set up your Gitlab Pages, you need to update the configuration in `docs/config.yaml`, which is set to "http://mygroup.gitlab.io/myproject".

2 changes: 1 addition & 1 deletion docs/themes/harmony
Submodule harmony updated from 698f65 to 51dacb
11 changes: 9 additions & 2 deletions features/bootstrap/Drumkit/DrumkitContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ protected function getOutput() {
return $this->process->getErrorOutput();
}

protected function getStdErr() {
if ($this->process->isSuccessful()) {
return $this->process->getErrorOutput();
}
return $this->process->getErrorOutput();
}

/**
* Run a command in a sub-process, and set its output.
*/
Expand Down Expand Up @@ -145,7 +152,7 @@ public function iRun($command)
{
if ($this->ignoreFailures) {
return $this->exec($command);
}
}
$this->succeed($command);
}

Expand Down Expand Up @@ -200,7 +207,7 @@ public function theDebPackageShouldNotBeInstalledOn($pkg, $host) {
*/
public function iShouldGet(PyStringNode $expectedOutput)
{
$output = $this->getOutput();
$output = $this->getOutput() . $this->getStdErr();
foreach ($expectedOutput->getStrings() as $string) {
$string = trim($string);
if (!empty($string) && strpos($output, $string) === FALSE) {
Expand Down
118 changes: 0 additions & 118 deletions features/drupal.feature

This file was deleted.

2 changes: 0 additions & 2 deletions features/projects/drupal-project.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ Feature: Initialize Drupal projects with Lando.
When I run "make -n init-project-drupal-deps"
Then I should get:
"""
Ensuring PHP dependencies are installed.
Installing Behat.
Ensuring Docker is installed.
in docker group.
Ensuring Lando is installed.
"""
When I run "make -n init-project-drupal"
Expand Down
Loading

0 comments on commit 619650a

Please sign in to comment.