Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Commit

Permalink
Upgrade: Service refactor with assets install
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroamador committed Jan 24, 2020
1 parent 717a303 commit 36dad6b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/data
docker-compose.yml
/docker-compose.yml
33 changes: 6 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,21 @@ The service is formed by one container:

## Operation

1. Configure the `/etc/security/limits.conf` on the docker host as it figures on the [Nexus 3](https://help.sonatype.com/repomanager3/system-requirements) System Requirements page:
1. Use the `docker-compose.yml.sample` file as your docker-compose configuration file.

```console
$ tail /etc/security/limits.conf
[...]
2. Install assets with `devcontrol assets-install`.

nexus - nofile 65536
```
3. Start with `docker-compose up -d`.

2. Use the `docker-compose.yml.sample` file as your docker-compose configuration file.
4. Open the url <http://localhost:8081> in a browser to access to the Nexus gui.

3. Create a docker network called "platform_services" before start the services with `docker network create platform_services`.

4. Install assets

```console
$ devcontrol assets-install
Generic Platform - Nexus Service (c) Teecke 2019-2020

- Creating 'data' directory...[OK]
- Setting 'data' permissions...[OK]
- Creating 'data/nexus-data' directory...[OK]
- Setting 'data/nexus-data' permissions...[OK]
```

5. Start with `docker-compose up -d`.

6. Open the url <http://localhost:8081> in a browser to access to the Nexus gui.

7. Manage backups of your files:
5. Manage backups of your files:

1. Make a backup executing `docker-compose exec nexus backup`.
2. Find the current backup within the `/var/backups/gp/nexus/` of the container.
3. Extract the current backup executing `docker cp $(docker-compose ps -q nexus):/var/backups/gp gp`.

8. Stop the platform with `docker-compose stop`.
6. Stop the platform with `docker-compose stop`.

You can use this docker piece with the [Docker Generic Platform](https://github.com/teecke/docker-generic-platform) project.

Expand Down
14 changes: 13 additions & 1 deletion devcontrol/actions/assets-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ function run-bash-linter() {

briefMessage="Install assets"
helpMessage=$(cat <<EOF
Install Nexus 3 ssets. It will create the "data/nexus-data" directory with all permissions (777)
Install Nexus 3 service aassets:
* Create the "data/nexus_data" directory with all permissions (777)
* Create the network "platform_services"
EOF
)

Expand All @@ -32,6 +35,15 @@ EOF
showHelpMessage "${FUNCNAME[0]}" "$helpMessage"
;;
exec)
# Create network
if [ "$(docker network ls -f name='platform_services' -q)" == "" ]; then
echo -n "- Creating docker network 'platform_services' ..."
docker network create platform_services
echo "[OK]"
else
echo "The 'platform_services' docker network already exists, skipping"
fi
# Create directories
for directory in data data/nexus-data; do
if [ ! -d ${directory} ]; then
echo -n "- Creating '${directory}' directory..."
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
nexus:
image: teecke/nexus:0.2.0
image: teecke/gp-nexus:0.3.0
build: nexus
ports:
- 8081:8081
Expand Down
4 changes: 2 additions & 2 deletions nexus/backup
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
mkdir -p /var/backups/gp/nexus/data
rsync -a --delete /data/ /var/backups/gp/nexus/data/
mkdir -p /var/backups/gp/nexus
rsync -a --relative --delete /nexus-data/ /var/backups/gp/nexus/

0 comments on commit 36dad6b

Please sign in to comment.