Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit 76aa683

Browse files
committed
Docker
1 parent e9b226a commit 76aa683

File tree

10 files changed

+58
-15
lines changed

10 files changed

+58
-15
lines changed

.travis.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,15 @@ sudo: false
22
language: java
33
jdk:
44
- oraclejdk8
5+
56
before_install:
6-
- wget https://marketplace.atlassian.com/download/plugins/atlassian-plugin-sdk-tgz
7-
- mkdir opt
8-
- tar -xvzf *plugin-sdk* -C opt
9-
- mv opt/*plugin-sdk* opt/atlassian-plugin-sdk
10-
- chmod a+x opt/atlassian-plugin-sdk/bin/*
11-
- chmod a+x opt/atlassian-plugin-sdk/apache-maven-*/bin/*
7+
- ./setup-atlassian-sdk.sh
128
- export PATH=opt/atlassian-plugin-sdk/bin:opt/atlassian-plugin-sdk/apache-maven-*/bin:$PATH
13-
- atlas-version
149
install:
15-
#Install Atlassian libs in local Maven repo
1610
- atlas-mvn -q install -Dstash.version=4.0.0
1711
- atlas-mvn -q install
1812
script:
1913
- atlas-package -q -Dstash.version=4.0.0
2014
- atlas-package -q
21-
# - ./integration-test.sh
2215
notifications:
2316
email: false

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
Changelog of Pull Request Notifier for Bitbucket.
44

55
## Unreleased
6-
### GitHub [#117](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/117) PULL_REQUEST_TO_HASH
6+
### No issue
7+
Docker
8+
9+
[85abd1f93c4bae7](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/85abd1f93c4bae7) Tomas Bjerre *2016-05-15 07:01:56*
10+
11+
## 2.21
12+
### GitHub [#117](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/117) PULL_REQUEST_TO_HASH resolved to old commit
713
Adding missing consumes annotation on REST resources
814

915
* Adding integration test for REST API.
1016

11-
[e8f7cc71c9a97d3](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/e8f7cc71c9a97d3) Tomas Bjerre *2016-05-14 22:04:19*
17+
[843a1d6cb7cc3d6](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/843a1d6cb7cc3d6) Tomas Bjerre *2016-05-14 22:04:48*
1218

1319
### No issue
1420
Avoiding looking for legacy settings if no such keys

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM java:8-jdk
2+
3+
EXPOSE 7990
4+
5+
RUN mkdir -p /usr/src/app
6+
WORKDIR /usr/src/app
7+
8+
ADD src /usr/src/app/src
9+
ADD README.md /usr/src/app
10+
ADD pom.xml /usr/src/app
11+
ADD setup-atlassian-sdk.sh /usr/src/app
12+
13+
RUN ./setup-atlassian-sdk.sh
14+
ENV PATH opt/atlassian-plugin-sdk/bin:opt/atlassian-plugin-sdk/apache-maven-*/bin:$PATH
15+
RUN atlas-version
16+
17+
ENTRYPOINT exec atlas-run

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ If you are using a CSRF protection in Jenkins, you can use the **Injection URL**
153153
* In the headers section, set header **.crumb** with value **${INJECTION_URL_VALUE}**.
154154

155155
## Developer instructions
156+
There are some scripts to help working with the plugin.
157+
158+
* `./setup-atlassian-sdk.sh` Setup Atlassian SDK.
159+
* `./docker-build.sh` Build Docker container.
160+
* `./docker-run.sh` Run the Docker container.
161+
* `./integration-test-local.sh` Run integration tests against localhost.
162+
* `./integration-test.sh` Start Docker container and then runs integration tests against it.
163+
156164
The .travis.yml is setting up Atlas SDK and building the plugin. It may help you setup your environment.
157165

158166
Prerequisites:
@@ -173,7 +181,7 @@ atlas-package
173181
Run Bitbucket, with the plugin, on localhost:
174182
```
175183
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
176-
mvn bitbucket:run
184+
atlas-run
177185
```
178186

179187
You can also remote debug on port 5005 with:

docker-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker build -t prnfb .

docker-clean.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# Delete all containers
3+
docker rm $(docker ps -a -q)
4+
# Delete all images
5+
docker rmi $(docker images -q)

docker-run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker run --name prnfb -d prnfb

integration-test-local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#
33
# Assuming you have the plugin running locally. You can start it with atlas-run.
44
#
5-
atlas-mvn test -P integration-test
5+
atlas-mvn -q test -P integration-test

integration-test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function build_clean {
99
echo "Bitbucket Server is running at $KILLPID, killing it"
1010
kill $KILLPID || echo;
1111
done
12-
atlas-mvn clean
12+
atlas-mvn -q clean
1313
}
1414

1515
function on_exit {
@@ -21,7 +21,8 @@ build_clean
2121
#
2222
# Start Bitbucket Server
2323
#
24-
atlas-run -q || exit 1 &
24+
./docker-build.sh
25+
./docker-run.sh || exit 1 &
2526

2627
BITBUCKET_URL=http://localhost:7990/bitbucket
2728
until $(curl --output /dev/null --silent --head --fail $BITBUCKET_URL); do

setup-atlassian-sdk.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
wget https://marketplace.atlassian.com/download/plugins/atlassian-plugin-sdk-tgz
3+
mkdir opt
4+
tar -xvzf *plugin-sdk* -C opt
5+
mv opt/*plugin-sdk* opt/atlassian-plugin-sdk
6+
chmod a+x opt/atlassian-plugin-sdk/bin/*
7+
chmod a+x opt/atlassian-plugin-sdk/apache-maven-*/bin/*
8+
echo "export PATH=opt/atlassian-plugin-sdk/bin:opt/atlassian-plugin-sdk/apache-maven-*/bin:$PATH" >> ~/.bashrc
9+
source ~/.bashrc

0 commit comments

Comments
 (0)