Skip to content

Commit

Permalink
Merge pull request #547 from opendevshop/develop
Browse files Browse the repository at this point in the history
Bring develop branch work back to 1.x
  • Loading branch information
jonpugh authored Mar 20, 2020
2 parents 8a0e304 + 0e42a26 commit 8f88110
Show file tree
Hide file tree
Showing 52 changed files with 7,420 additions and 758 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/component-yaml-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Components"

on: [push]

jobs:
yaml-tasks:

runs-on: ubuntu-latest

# Set working directory for entire file. https://github.community/t5/GitHub-Actions/use-working-directory-for-entire-job/td-p/36759
env:
working-directory: ./src/DevShop/Component/YamlTasks

steps:
- uses: actions/checkout@v1
- name: Get Composer Cache Directory
working-directory: ${{env.working-directory}}
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
working-directory: ${{env.working-directory}}
run: composer validate

- name: Install dependencies
working-directory: ${{env.working-directory}}
run: composer install --prefer-dist --no-progress --no-suggest

- name: Create a branch for the yaml-tests to read.
working-directory: ${{env.working-directory}}
run: git checkout -b $( echo ${GITHUB_REF} | sed 's/refs\/heads\///')

- name: Run Yaml Tests
working-directory: ${{env.working-directory}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# @TODO: Get environment variable setting to work.
# YAML_TASKS_STATUS_URL: https://github.com/${GITHUB_REPOSITORY}/runs/${GITHUB_RUN_ID}?check_suite_focus=true
PROVISION_PROCESS_OUTPUT: direct
run: |
chmod +x yaml-tasks
./yaml-tasks --ansi -v --hostname=github.com --status-url=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true
./yaml-tasks --tasks-file tests.yml --ansi -v --hostname=github.com --status-url=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true
38 changes: 34 additions & 4 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Git Management
on: [push]
env:
GITHUB_USERNAME: devshopbot
GITSPLIT_GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
DEVSHOP_REPO: opendevshop/devshop
DEVSHOP_PACKAGES_REPO: devshop-packages/git-split

jobs:
monorepo-split:
name: Split Git Repositories
Expand All @@ -8,11 +14,19 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Confirm write access to $DEVSHOP_REPO
run: |
curl -u $GITHUB_USERNAME:$GITSPLIT_GITHUB_TOKEN https://api.github.com/repos/$DEVSHOP_REPO/collaborators/$GITHUB_USERNAME/permission | grep "permission" | grep "admin
write"
- name: Confirm write access to $DEVSHOP_PACKAGES_REPO.
run: |
curl -u $GITHUB_USERNAME:$GITSPLIT_GITHUB_TOKEN https://api.github.com/repos/$DEVSHOP_PACKAGES_REPO/collaborators/$GITHUB_USERNAME/permission | grep "permission" | grep "admin
write"
- uses: fregante/setup-git-token@v1
with:
token: ${{ secrets.INPUT_GITHUB_TOKEN }}
name: devshopbot
email: [email protected]

- name: Cache git split database file.
uses: actions/cache@v1
Expand All @@ -29,6 +43,22 @@ jobs:
- run: mkdir $HOME/.ssh
- name: Authorize GitHub.com as a known_host
run: ssh-keyscan github.com > $HOME/.ssh/known_hosts


- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest

# @TODO: Our plugin could be coded to output the commands needed to run splitsh-lite.sh directly. This would shorten CI runs because we wouldn't need composer install for the Git Split job.
- name: Split monorepo
run: composer split
run: composer git:split
15 changes: 12 additions & 3 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ public function prepareContainers($user_uid = NULL, $hostname = 'devshop.local.c
$process->disableOutput();
$process->setTimeout(null);
$process->setTty(!empty($_SERVER['XDG_SESSION_TYPE']) && $_SERVER['XDG_SESSION_TYPE'] == 'tty');
$process->mustRun();

// @TODO: Figure out why PowerProcess::mustRun() fails so miserably: https://github.com/opendevshop/devshop/pull/541/checks?check_run_id=518074346#step:7:45
$process->run();

}

Expand Down Expand Up @@ -622,7 +624,10 @@ public function up($docker_command = 'devshop-ansible-playbook', $opts = [
$process->setTty($isTty);
$process->setTimeout(NULL);
$process->disableOutput();
$process->mustRun();

// @TODO: Figure out why PowerProcess::mustRun() fails so miserably: https://github.com/opendevshop/devshop/pull/541/checks?check_run_id=518074346#step:7:45
// $process->mustRun();
$process->run();
}
return;
}
Expand Down Expand Up @@ -941,7 +946,11 @@ public function test($user = 'aegir', $opts = array(
]);
$process->setTimeout(NULL);
$process->disableOutput();
$process->mustRun();


// @TODO: Figure out why PowerProcess::mustRun() fails so miserably: https://github.com/opendevshop/devshop/pull/541/checks?check_run_id=518074346#step:7:45
// $process->mustRun();
$process->run();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ roles_path = /usr/share/devshop/roles

# "auto_legacy" worked for centOS7: https://github.com/opendevshop/devshop/pull/518/checks?check_run_id=517463037
# but failed for ubuntu18: https://github.com/opendevshop/devshop/pull/518/checks?check_run_id=517463029#step:7:523
interpreter_python = auto
interpreter_python = auto
123 changes: 123 additions & 0 deletions assets/logo-light-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-new-light-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 34 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,35 @@
}
],
"require": {
"php": "^7.1",
"knplabs/github-api": "^1.4",
"cpliakas/git-wrapper": "2.*",
"asm/php-ansible": "^2.0",
"mouf/nodejs-installer": "^1.0",
"php": "^7.1",
"provision-ops/power-process": "^1.3"
"devshop/yaml-tasks": "*",
"devshop/git-split": "*",
"cpliakas/git-wrapper": "^1.0",
"drush/drush": "^8"
},
"require-dev": {
"composer/composer": "^1.9"
},
"authors": [
"autoload": {
"psr-0": { "DevShop": "src/" },
"autoload": {
"psr-4": {
"DevShop\\Component\\": "src/DevShop/Component/"
}
}
},
"repositories": [
{
"name": "Jon Pugh",
"email": "[email protected]"
"type": "path",
"url": "src/DevShop/Component/GitSplit"
},
{
"type": "path",
"url": "src/DevShop/Component/YamlTasks"
}
],
"autoload": {
"psr-0": { "DevShop": "src/" }
},
"bin": [
"scripts/devshop",
"scripts/branch-or-tag"
Expand All @@ -46,18 +57,23 @@
},
"sort-packages:": "true"
},
"extra": {
"git-split": {
"repos": {
"tests/test-repo": "https://github.com/devshop-packages/test-repo.git",
"devmaster": "https://github.com/opendevshop/devmaster.git",
"roles/opendevshop.apache": "https://github.com/opendevshop/ansible-role-apache.git",
"roles/opendevshop.devmaster": "https://github.com/opendevshop/ansible-role-devmaster.git",
"roles/opendevshop.users": "https://github.com/opendevshop/ansible-role-user.git",
"src/DevShop/Component/GitSplit": "https://github.com/devshop-packages/git-split.git",
"src/DevShop/Component/YamlTasks": "https://github.com/devshop-packages/yaml-tasks.git"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"bin-install": [
"DevShop\\Composer::installBins"
],
"split": [
"DevShop\\Composer::installBins",
"DevShop\\Composer::splitRepos"
],
"post-install-cmd": [
"DevShop\\Composer::installBins"
],
"pre-update-cmd": [
],
Expand Down
Loading

0 comments on commit 8f88110

Please sign in to comment.