Skip to content

Commit 072e88a

Browse files
committed
Making Docker deploys possible - with readme updates
1 parent 676701a commit 072e88a

File tree

4 files changed

+85
-29
lines changed

4 files changed

+85
-29
lines changed

Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ MAINTAINER Tom Fennelly <[email protected]>
77
# clone the smooks repo
88
RUN git clone https://github.com/smooks/smooks.git /home/smooks
99

10-
ADD settings_codehaus.xml /home/smooks/settings.xml
11-
1210
WORKDIR /home/smooks

RELEASE.md

+48-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Smooks Release process
2-
This section describes the process to create a release for Smooks. To do this you will to have a codehaus account.
2+
This section describes the process to create a release for Smooks. To do this you will need a codehaus account.
33

44
### Generate a keypair for signing artifacts
55
To deploy to Nexus it is required that the artifacts are signed. This section describes how to generate the keys for signing:
@@ -10,7 +10,7 @@ Install [pgp](http://www.openpgp.org/resources/downloads.shtml). For example, us
1010

1111
Now, generate the keypair:
1212

13-
gpg gen-key
13+
gpg --gen-key
1414

1515
List the key to get the public key identifier:
1616

@@ -27,24 +27,6 @@ For others to be able to verify the signature, in our case Nexus must be able to
2727

2828
In the example above we are using the _pub_ identifer.
2929

30-
### Update settings.xml
31-
Update your settings.xml with the correct credentials:
32-
33-
<settings>
34-
<servers>
35-
<server>
36-
<id>codehaus-nexus-snapshots</id>
37-
<username>username</username>
38-
<password>xxxx</password>
39-
</server>
40-
<server>
41-
<id>codehaus-nexus-staging</id>
42-
<username>username</username>
43-
<password>xxxx</password>
44-
</server>
45-
</servers>
46-
</settings>
47-
4830
### Update the project version number
4931
We need to update the project version number. This need to be done once for in the root project and once for the
5032
smooks-examples module. The reason for this is that the smooks-examples module does has a different parent.
@@ -63,12 +45,55 @@ And if you are not happy you can revert using:
6345

6446
When you are done you should commit and tag.
6547

66-
### Run the deploy goal/target
48+
### Deploy artifacts to Codehaus Nexus repository
49+
50+
There are 2 ways of doing this, depending on the OS you are running on. In either case, this should build and upload all artifacts to the [Codehaus Nexus maven Repository](https://nexus.codehaus.org) ([see HAUSEMATE docs for more details](http://docs.codehaus.org/display/HAUSMATES/Codehaus+Maven+Repository+Usage+Guide)), from which we can test and hopefully release the artifacts.
51+
52+
53+
#### Deploy artifacts from a Linux type OS (including Mac OSX)
54+
Simple run:
55+
56+
```
57+
./deploy.sh -u <codehaus-username> -p <codehaus-password> -g <passphrase-of-gpg-key>
58+
```
59+
60+
#### Deploy artifacts from a Docker container
61+
We use Docker to build and deploy artifacts, guaranteeing a consistent build environment.
62+
63+
Assuming you have Docker installed on the local host system, we install the `smooks` image:
64+
65+
```
66+
docker build -t smooks github.com/smooks/smooks
67+
```
68+
69+
One catch of running the build in a Docker container is that we need to make the GPG key available to the build running in the Docker container. So, we need to mount the host system's `~/.gnupg` directory into the docker container as the root account's `~/.gnupg` directory by adding `-v $HOME/.gnupg:/.gnupg` to the docker commands.
70+
71+
#### Deploy artifacts from a non-Linux type OS (Windows etc)
72+
73+
Update your `~/.m2/settings.xml` with the correct Codehaus credentials (same as your Xircles login details):
74+
75+
```
76+
<settings>
77+
<servers>
78+
<server>
79+
<id>codehaus-nexus-snapshots</id>
80+
<username>username</username>
81+
<password>xxxx</password>
82+
</server>
83+
<server>
84+
<id>codehaus-nexus-staging</id>
85+
<username>username</username>
86+
<password>xxxx</password>
87+
</server>
88+
</servers>
89+
</settings>
90+
```
91+
6792
Now you are ready to run the maven deploy goal:
6893

69-
mvn clean deploy -Pdeploy -Dgpg.passphrase=key-password
94+
mvn clean deploy -Pdeploy -Dgpg.passphrase=<passphrase-of-gpg-key> -Dmaven.test.skip=true
7095

71-
This should build and upload and complete successfully. Things will be uploaded to the [Codehaus Nexus maven Repository](https://nexus.codehaus.org) ([see HAUSEMATE docs for more details](http://docs.codehaus.org/display/HAUSMATES/Codehaus+Maven+Repository+Usage+Guide)).
96+
### Releasing artifacts from Codehaus Nexus repository
7297

7398
You log into the Codehaus Nexus repo using your [Xircles](http://xircles.codehaus.org/) userid and password. From there, take a look at the “Staging Repository”. The staging repository is where you can inspect what was uploaded and make sure that everything looks peachy.
7499
If it doesn't, you can drop the repository and fix the issue and deploy again. Once you think everything is in order you need to “Close” the repository. Closing will run a number of verification
@@ -88,6 +113,3 @@ Optionally verify the tag:
88113
Push the tag:
89114

90115
git push upstream vx.x.x
91-
92-
93-

deploy.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
#
4+
# Run:
5+
# ./deploy.sh -u <codehaus-username> -p <codehaus-password> -g <passphrase-of-gpg-key>
6+
#
7+
8+
while getopts u:p:g: option
9+
do
10+
case "${option}"
11+
in
12+
u) USERNM=${OPTARG};;
13+
p) PASSWD=${OPTARG};;
14+
g) GPGPPH=${OPTARG};;
15+
esac
16+
done
17+
18+
export CH_UN=$USERNM
19+
export CH_PW=$PASSWD
20+
21+
mvn clean deploy -Pdeploy -Dgpg.passphrase=$GPGPPH -Dmaven.test.skip=true --settings settings_codehaus.xml

settings_codehaus.xml

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
<test></test>
1+
<settings>
2+
<servers>
3+
<server>
4+
<id>codehaus-nexus-snapshots</id>
5+
<!-- This is your codehaus login i.e. same as for JIRA etc -->
6+
<username>${env.CH_UN}</username>
7+
<password>${env.CH_PW}</password>
8+
</server>
9+
<server>
10+
<id>codehaus-nexus-staging</id>
11+
<!-- This is your codehaus login i.e. same as for JIRA etc -->
12+
<username>${env.CH_UN}</username>
13+
<password>${env.CH_PW}</password>
14+
</server>
15+
</servers>
16+
</settings>

0 commit comments

Comments
 (0)