Skip to content

Commit

Permalink
Merge pull request #37 from rande/add_support_drupal_packagist
Browse files Browse the repository at this point in the history
feat(drupal): increase support for drupal
  • Loading branch information
rande authored Oct 4, 2018
2 parents 1cf9d30 + 6e319bb commit eba258e
Show file tree
Hide file tree
Showing 16 changed files with 353 additions and 134 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
fixtures/project/vendor
fixtures/project/composer.lock
fixtures/project/node_modules
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test-backend: ## Run backend tests
test-frontend: ## Run frontend tests
exit 0

test: test-backend test-front
test: test-backend

run: bin-dev ## Run server
go run -race cli/main.go run -file ./pkgmirror.toml -log-level=info
Expand All @@ -69,10 +69,10 @@ update: ## Update dependencies
glide update

bin-dev: ## Generate bin dev assets file
go-bindata -dev -o $(GO_BINDATA_OUTPUT) -prefix $(GO_BINDATA_PREFIX) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)
`go env GOPATH`/bin/go-bindata -dev -o $(GO_BINDATA_OUTPUT) -prefix $(GO_BINDATA_PREFIX) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)

bin: assets ## Generate bin assets file
go-bindata -o $(GO_BINDATA_OUTPUT) -prefix $(GO_BINDATA_PREFIX) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)
`go env GOPATH`/bin/go-bindata -o $(GO_BINDATA_OUTPUT) -prefix $(GO_BINDATA_PREFIX) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)

assets: ## build assets
rm -rf gui/build/*
Expand Down
9 changes: 6 additions & 3 deletions assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ Mirroring workflow
Storage
-------

The storage layer uses [boltdb](https://github.com/boltdb/bolt). A packagist.org mirror is about 250MB on disk,
The storage layer uses [boltdb](https://github.com/boltdb/bolt). A packagist.org mirror is about 512MB on disk,
the file is located in the ``PATH/composer/packagist.db``.
16 changes: 15 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,35 @@ To add a new repository, for instance, the official one:
Enabled = true
Icon = "https://getcomposer.org/img/logo-composer-transparent.png"

[Composer.drupal8]
Server = "https://packages.drupal.org/8"
Enabled = true
Icon = "https://www.drupal.org/files/druplicon-small.png"

[Composer.drupal7]
Server = "https://packages.drupal.org/7"
Enabled = true
Icon = "https://www.drupal.org/files/druplicon-small.png"


Next, you need to declare the mirror in your ``composer.json`` file:

{
"repositories":[
{ "packagist": false },
{ "type": "composer", "url": "https://localhost/composer/packagist"}
{ "type": "composer", "url": "https://localhost/composer/drupal8"}
],

"require": {
"sonata-project/exporter": "*"
}
}

The ``packagist`` key is used here as an example.


> You also need to setup `git` and `static` configuration to be able to download assets or clone repository.
Npm
---

Expand Down
2 changes: 1 addition & 1 deletion fixtures/mock/composer/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [],
"notify": "\/downloads\/%package%",
"notify-batch": "\/downloads\/",
"providers-url": "\/p\/%package%$%hash%.json",
"providers-url": "\/composer\/p\/%package%$%hash%.json",
"search": "\/search.json?q=%query%",
"provider-includes": {
"p\/provider-mock$%hash%.json": {
Expand Down
Loading

0 comments on commit eba258e

Please sign in to comment.