Skip to content

Commit 89ceadd

Browse files
carlosrodlopaheritier
authored andcommitted
New notes about the progress (#266)
* new notes about the progress made * adding main components of the setup
1 parent 774f8ef commit 89ceadd

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

migration2Codeship.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,44 @@
1-
h3. Migration to Codeship
1+
## Migration to Codeship
22

3-
It is a temporal file to track the migration steps od moving this project from Jenkins D@C to Codeship Basic project
3+
It is a temporal file to track the migration steps of moving this project from Jenkins D@C to Codeship Basic project
44

5-
h4. Carlos (16/08/2018)
5+
**Notes**:
66

7+
* Codeship currently does’t trigger builds for PRs from forked repositories. We have created a RFE for that [PROD-1600](https://cloudbees.atlassian.net/browse/PROD-1600)
78
* Sonar configuration needs to be move from the `Manage Jenkins > Configure system` to `Codeship Basic > Enviroment Section`
89
* Maven options has been moved to Setup Commands `export MAVEN_OPTS="-Xmx512m -Djava.awt.headless=true"`
910
* Sonar configuration is passed by parameters: https://docs.sonarqube.org/display/SONAR/Analysis+Parameters
1011
* Replacing Jenkins `env.BRANCH_NAME` for Codeship `CI_BRANCH`
11-
* Pushing a first commit to your repository to trigger your first build in Codeship
12+
* Pushing a first commit to your repository to trigger your first build in Codeship
13+
* All groovy needs to be converted into shell format
14+
* Shell format multiline is not supported
15+
* To check line 13 `_ bash: [: too many arguments`
16+
* BUILD SUCCESS but with mvn `verify` goal default
17+
18+
### Setup Commands
19+
20+
```
21+
# We currently support OpenJDK 7, as well as Oracle JDK 7 & 8.
22+
jdk_switcher use oraclejdk8
23+
# Maven
24+
export MAVEN_OPTS="-Xmx512m -Djava.awt.headless=true"
25+
```
26+
27+
### Pipeline
28+
29+
```
30+
export pom_version=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml)
31+
export isSnapshot=false
32+
export deployOrVerity='verify'
33+
if [ "$pom_version" =~ "-SNAPSHOT" ]; then isSnapshot=true; fi
34+
if [ [ "$CI_BRANCH" = "master" ] && [ isSnapshot ] ]; then deployOrVerity='deploy -DdeployAtEnd=true'; fi
35+
## DEBUG
36+
echo "Running: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent ${deployOrVerity} sonar:sonar -Dsonar.organization=cloudbees -Dsonar.branch.name=${CI_BRANCH} -Dsonar.host.url=${SONAR_URL} -Dsonar.login=${SONAR_TOKEN} -Dmaven.test.failure.ignore=true"
37+
## END DEBUG
38+
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent ${deployOrVerity} sonar:sonar -Dsonar.organization=cloudbees -Dsonar.branch.name=${CI_BRANCH} -Dsonar.host.url=${SONAR_URL} -Dsonar.login=${SONAR_TOKEN} -Dmaven.test.failure.ignore=true
39+
```
40+
41+
### Enviroment Variables:
42+
43+
* `SONAR_URL`
44+
* `SONAR_TOKEN`

0 commit comments

Comments
 (0)