Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ def notifyBranch = [recipients: [brokenTestsSuspects(), requestor()]]
pipeline {
agent {
node {
label 'alpine:mkdocs'
customWorkspace workspace().getUniqueWorkspacePath()
label 'alpine-mkdocs'
}
}
environment {
Expand All @@ -21,14 +20,18 @@ pipeline {
stage('Node')
{
steps {
nodeInfo("python pip mkdocs")
container("mkdocs") {
nodeInfo("python pip mkdocs")
}
}
}
stage('Building')
{
steps {
withCredentials([string(credentialsId: '3ea1e18a-b1d1-44e0-a1ff-7b62870913f8', variable: 'GOOGLE_ANALYTICS_KEY')]) {
sh "mkdocs build"
container("mkdocs") {
withCredentials([string(credentialsId: '3ea1e18a-b1d1-44e0-a1ff-7b62870913f8', variable: 'GOOGLE_ANALYTICS_KEY')]) {
sh "mkdocs build"
}
}
}
}
Expand All @@ -37,21 +40,16 @@ pipeline {
expression { BRANCH_NAME == 'master' && (currentBuild.result == null || currentBuild.result == 'SUCCESS') }
}
steps {
configFileProvider([configFile(fileId: 'e0235d92-c2fc-4f81-ae4b-28943ed7350d', targetLocation: '/tmp/gh-pages.sh')]) {
withCredentials([sshUserPrivateKey(credentialsId: '011f2a7d-2c94-48f5-92b9-c07fd817b4be', keyFileVariable: 'SSH_KEY', usernameVariable: 'SSH_USER')]) {
withEnv(["GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o User=${SSH_USER} -i ${SSH_KEY}"]) {
sh "/bin/bash /tmp/gh-pages.sh"
container("mkdocs") {
configFileProvider([configFile(fileId: 'e0235d92-c2fc-4f81-ae4b-28943ed7350d', targetLocation: '/tmp/gh-pages.sh')]) {
withCredentials([sshUserPrivateKey(credentialsId: '011f2a7d-2c94-48f5-92b9-c07fd817b4be', keyFileVariable: 'SSH_KEY', usernameVariable: 'SSH_USER')]) {
withEnv(["GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o User=${SSH_USER} -i ${SSH_KEY}"]) {
sh "/bin/bash /tmp/gh-pages.sh"
}
}
}
}
}
}
}
post {
cleanup {
script {
workspace().clean()
}
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mkdocs:
image: strongboxci/alpine:mkdocs-4.0
image: strongboxci/alpine:mkdocs-4.4
volumes:
- ./:/docs
ports:
Expand Down
54 changes: 54 additions & 0 deletions docs/assets/resources/maven/settings-local.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>

<localRepository>.m2/repository-strongbox-local</localRepository>

<mirrors>
<mirror>
<id>strongbox</id>
<name>strongbox</name>
<url>http://localhost:48080/storages/public/maven-group/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>

<profiles>
<profile>
<id>carlspring-repositories</id>

<activation>
<activeByDefault>true</activeByDefault>
</activation>

<repositories>
<repository>
<id>strongbox</id>
<name>strongbox</name>
<url>http://localhost:48080/storages/public/maven-group/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>strongbox</id>
<name>strongbox</name>
<url>http://localhost:48080/storages/public/maven-group/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>password</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>password</password>
</server>
</servers>
</settings>
170 changes: 0 additions & 170 deletions docs/developer-guide/building-strongbox-against-strongbox.md

This file was deleted.

101 changes: 101 additions & 0 deletions docs/developer-guide/building-strongbox-using-strongbox-instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{% set localSettingsXml = "~/.m2/settings-local.xml" %}

# Building Strongbox using a Strongbox Instance

We like our dog food and we try it all the time! :smiley:

Working on Strongbox features is fun, but has a hidden issue - you can unintentionally break things.
The best way to know if your changes are not affecting Strongbox is by testing it in a real-world environment.
Building @strongbox/strongbox using a Strongbox instance is as "real world" environment as it can get and this
article goes into details how to do the testing.

## Starting a Strongbox Instance

Before you start testing, you will need to have a running Strongbox instance.

You can start Strongbox in two ways - via `spring-boot` and from `strongbox-distribution`. In most cases, during the
development phase you will mainly start an instance via `spring-boot`. However once you are done with your task you
should always ensure the `strongbox-distribution` package works as expected.

``` linenums="1" tab="Strongbox via spring-boot"
git clone {{repo_url}}
mvn clean install -DskipTests
cd strongbox-web-core
mvn spring-boot:run
```

``` linenums="1" tab="Strongbox from strongbox-distribution"
git clone {{repo_url}}
mvn clean install -DskipTests
cd strongbox-distribution/target
tar -zxf *gz
cd strongbox-distribution-*/strongbox-*/
./bin/strongbox console
```

## Building and Deploying using Strongbox

Following the steps below should result in successful result:

1. [Did you pay attention?][Strongbox Instance]
2. Configure your `settings.xml` to point to the local [Strongbox Instance]:

``` tab="Download"
# Linux / MacOS
curl -o {{localSettingsXml}} \
{{resources}}/maven/settings-local.xml

# Windows
curl -o %HOMEPATH%\.m2\settings-local.xml ^
{{resources}}/maven/settings-local.xml
```

``` tab="Raw/Copy"
--8<-- "{{resourcesPath}}/maven/settings-local.xml"
```

3. Make a clean clone of @strongbox/strongbox into a separate path (i.e. `strongbox-tmp`)
4. Build Strongbox using a Strongbox instance:
```
$ cd strongbox-tmp
$ mvn clean install -DskipTests -s {{localSettingsXml}}
... (should start downloading artifacts from localhost:48080
[INFO] Scanning for projects...
Downloading from strongbox: http://localhost:48080/storages/public/maven-group/org/carlspring/strongbox/strongbox-parent/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from strongbox: http://localhost:48080/storages/public/maven-group/org/carlspring/strongbox/strongbox-parent/1.0-SNAPSHOT/maven-metadata.xml (617 B at 1.7 kB/s)
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
```

5. Deploy into Strongbox
```
$ mvn clean deploy \
-s {{localSettingsXml}}
-DaltDeploymentRepository=snapshots::default::http://localhost:48080/storages/storage0/snapshots/ \
-DskipTests \
-fn

...
[INFO] --- maven-install-plugin:2.4:install (default-install) @ strongbox-masterbuild ---
[INFO] Installing /java/strongbox-tmp/pom.xml to /java/strongbox-tmp/.m2/repository-strongbox-local/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/strongbox-masterbuild-1.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ strongbox-masterbuild ---
[INFO] Using alternate deployment repository snapshots::default::http://localhost:48080/storages/storage0/snapshots/
Downloading: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/maven-metadata.xml
Uploading: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/strongbox-masterbuild-1.0-20180128.060409-1.pom
Uploaded: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/strongbox-masterbuild-1.0-20180128.060409-1.pom (4 KB at 5.6 KB/sec)
Downloading: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/maven-metadata.xml
Uploading: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/maven-metadata.xml
Uploaded: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/1.0-SNAPSHOT/maven-metadata.xml (618 B at 1.2 KB/sec)
Uploading: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/maven-metadata.xml
Uploaded: http://localhost:48080/storages/storage0/snapshots/org/carlspring/strongbox/strongbox-masterbuild/maven-metadata.xml (303 B at 0.6 KB/sec)
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
```

<!-- links -->
[Strongbox Instance]: #starting-a-strongbox-instance
Loading