<commit_before>Clojars web interface
=====================

This is the source code for the [Clojars](http://clojars.org/) jar
repository webapp.

If you're looking for user documentation, try
the [wiki](http://github.com/ato/clojars-web/wiki/_pages). There is a
also a [FAQ](https://github.com/ato/clojars-web/wiki/About).

See [release announcements on the mailing list](https://groups.google.com/forum/?fromgroups#!topicsearchin/clojars-maintainers/group:clojars-maintainers$20AND$20subject:ann) for recent user-facing changes.

Contributing
------------

Please report bugs or problems with the repository on the
[bug tracker](https://github.com/ato/clojars-web/issues).

Design discussions occur on the
[clojars-maintainers list](http://groups.google.com/group/clojars-maintainers)
and the #leiningen channel on irc.freenode.org.

If you'd like contribute a change please send a GitHub pull request
for a topic branch.  Feel free to open a pull request early with a
"not ready for merging" note or ask on the mailing list or IRC to get
feedback from other contributors. If you are looking for a task to
work on, take a look at issues labeled
[ready](https://github.com/ato/clojars-web/labels/ready).

We try to make releases fairly soon after merging contributions,
but post to the mailing list if it's been a week or two and you'd like
something pushed to the production website.

Development
-----------

**Note: Java 8+ is required**

### Development system

To begin developing, start with a REPL.

```sh
lein repl
```

Run `migrate` to initialize the database to the latest migration.

```clojure
user=> (migrate)
...
```
Run `go` to initiate and start the system.

```clojure
user=> (go)
:started
```

By default this creates a running development system at <http://localhost:8080>.

When you make changes to your source files, use `reset` to reload any
modified files and reset the server.

```clojure
user=> (reset)
:reloading (...)
:resumed
```

If you'd like to hack on the UI or search it might be useful to have
production-like metadata. To create that, use
`clojars.tools.setup-dev/-main` to create test users, import an existing
maven repository (your local `~/.m2/repository/` works well), and
setup a search index:

```sh
cp -r ~/.m2/repository data/dev_repo
lein run -m clojars.tools.setup-dev
```
If you want to use the actual repo from clojars.org, you can grab it
via [rsync](http://github.com/ato/clojars-web/wiki/Data).

Note that this setup task isn't perfect - SNAPSHOTS won't have
version-specific metadata (which won't matter for the operation of
clojars, but may matter if you try to use the resulting repo as a real
repo), and versions will be listed out of order on the project pages,
but it should be good enough to test with.

### Testing

Testing is designed to work in a REPL to allow flow.

```clojure
user=> (test)
...
```

```clojure
user=> (test #'clojars.test.unit.db/added-users-can-be-found)
...
```

Tests can also be run through Leiningen for CI.

```sh
lein test
```

### Production system with development config

Occasionally it can be useful to start a production system based on the development
configuration. This can be done by `lein run`.

Deployment
----------

Also see [Configuration](#configuration).

1. Compile with: `lein uberjar`
2. Deploy `target/uberjar/clojars-web-*-standalone.jar` to the server
3. Run the migrations `java -cp clojars-web-*-standalone.jar clojure.main -m clojars.tools.migrate-db`
4. Run the production system: `java -jar clojars-web-*-standalone.jar`

Configuration
-------------

Some options can be set using environment variables.  See `lein run -h` for the
full list.
<commit_msg>Updated the README with production deploy step<commit_after>Clojars web interface
=====================

This is the source code for the [Clojars](http://clojars.org/) jar
repository webapp.

If you're looking for user documentation, try
the [wiki](http://github.com/ato/clojars-web/wiki/_pages). There is a
also a [FAQ](https://github.com/ato/clojars-web/wiki/About).

See [release announcements on the mailing list](https://groups.google.com/forum/?fromgroups#!topicsearchin/clojars-maintainers/group:clojars-maintainers$20AND$20subject:ann) for recent user-facing changes.

Contributing
------------

Please report bugs or problems with the repository on the
[bug tracker](https://github.com/ato/clojars-web/issues).

Design discussions occur on the
[clojars-maintainers list](http://groups.google.com/group/clojars-maintainers)
and the #leiningen channel on irc.freenode.org.

If you'd like contribute a change please send a GitHub pull request
for a topic branch.  Feel free to open a pull request early with a
"not ready for merging" note or ask on the mailing list or IRC to get
feedback from other contributors. If you are looking for a task to
work on, take a look at issues labeled
[ready](https://github.com/ato/clojars-web/labels/ready).

We try to make releases fairly soon after merging contributions,
but post to the mailing list if it's been a week or two and you'd like
something pushed to the production website.

Development
-----------

**Note: Java 8+ is required**

### Development system

To begin developing, start with a REPL.

```sh
lein repl
```

Run `migrate` to initialize the database to the latest migration.

```clojure
user=> (migrate)
...
```
Run `go` to initiate and start the system.

```clojure
user=> (go)
:started
```

By default this creates a running development system at <http://localhost:8080>.

When you make changes to your source files, use `reset` to reload any
modified files and reset the server.

```clojure
user=> (reset)
:reloading (...)
:resumed
```

If you'd like to hack on the UI or search it might be useful to have
production-like metadata. To create that, use
`clojars.tools.setup-dev/-main` to create test users, import an existing
maven repository (your local `~/.m2/repository/` works well), and
setup a search index:

```sh
cp -r ~/.m2/repository data/dev_repo
lein run -m clojars.tools.setup-dev
```
If you want to use the actual repo from clojars.org, you can grab it
via [rsync](http://github.com/ato/clojars-web/wiki/Data).

Note that this setup task isn't perfect - SNAPSHOTS won't have
version-specific metadata (which won't matter for the operation of
clojars, but may matter if you try to use the resulting repo as a real
repo), and versions will be listed out of order on the project pages,
but it should be good enough to test with.

### Testing

Testing is designed to work in a REPL to allow flow.

```clojure
user=> (test)
...
```

```clojure
user=> (test #'clojars.test.unit.db/added-users-can-be-found)
...
```

Tests can also be run through Leiningen for CI.

```sh
lein test
```

### Production system with development config

Occasionally it can be useful to start a production system based on the development
configuration. This can be done by `lein run`.

Deployment
----------

Also see [Configuration](#configuration).

1. Compile with: `lein uberjar`
1. Deploy `target/uberjar/clojars-web-*-standalone.jar` to the server
1. Run the migrations `java -cp clojars-web-*-standalone.jar clojure.main -m clojars.tools.migrate-db`
1. Set Yeller token `export YELLER_TOKEN="<PASSWORD>"`
1. Run the production system: `java -jar clojars-web-*-standalone.jar`

Configuration
-------------

Some options can be set using environment variables.  See `lein run -h` for the
full list.

{'fraction_non_alphanumeric': 0.11739364566505116, 'fraction_numerical': 0.004173397953688745, 'mean_word_length': 4.0331978319783195, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 16, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1385079', 'n_tokens_mistral': 2330, 'n_tokens_neox': 2202, 'n_words': 948}