Skip to content

Commit

Permalink
add circleci config (sonatype-nexus-community#46)
Browse files Browse the repository at this point in the history
* add circleci config
* remove travis config. update doc references to CI.
  • Loading branch information
bhamail authored Sep 27, 2019
1 parent 4a88c7e commit 8a27ab9
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 14 deletions.
27 changes: 27 additions & 0 deletions .circleci/.maven.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0" xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>rso</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>

<profiles>
<profile>
<id>gpg</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>gpg</activeProfile>
</activeProfiles>
</settings>
16 changes: 16 additions & 0 deletions .circleci/circleci-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CI Debug Notes
================
To validate some circleci stuff, I was able to run a “build locally” using the steps below.
The local build runs in a docker container.

* (Once) Install circleci client (`brew install circleci`)

* Convert the “real” config.yml into a self contained (non-workspace) config via:

circleci config process .circleci/config.yml > .circleci/local-config.yml

* Run a local build with the following command:

circleci local execute -c .circleci/local-config.yml --job 'github-maven-deploy/build-and-test'

With the above command, those operations what cannot occur locally will show an error (like `Error: FAILED with error not supported`), but the build will proceed and can complete “successfully”, which allows you to verify scripts in your config, etc.
68 changes: 68 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: 2.1

orbs:
github-maven-deploy: github-maven-deploy/[email protected]

mvn-build-test-command: &mvn-build-test-command
mvn-build-test-command: mvn clean verify -PbuildKar -Dit

mvn-deploy-command: &mvn-deploy-command
mvn-deploy-command: mvn -s .circleci/.maven.xml clean deploy -PbuildKar -DdeployAtEnd=true -DperformRelease=true -DskipTests -Dspotbugs.skip=true
context: rso-base

mvn-collect-artifacts-command: &mvn-collect-artifacts-command
mvn-collect-artifacts-command: |
mkdir -p ~/project/artifacts/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/project/artifacts/junit/ \;
# restore line below after ITs are added
#cp ~/project/${rootArtifactId}-it/target/failsafe-reports/*.xml ~/project/artifacts/junit/
workflows:
workflow:
jobs:
- github-maven-deploy/build-and-test:
<<: *mvn-build-test-command
<<: *mvn-collect-artifacts-command

- github-maven-deploy/approve-deploy-patch-version:
type: approval
requires:
- github-maven-deploy/build-and-test
filters:
branches:
only: master
- github-maven-deploy/approve-deploy-minor-version:
type: approval
requires:
- github-maven-deploy/build-and-test
filters:
branches:
only: master
- github-maven-deploy/approve-deploy-major-version:
type: approval
requires:
- github-maven-deploy/build-and-test
filters:
branches:
only: master
- github-maven-deploy/deploy-patch-version:
requires:
- github-maven-deploy/approve-deploy-patch-version
<<: *mvn-deploy-command
filters:
branches:
only: master
- github-maven-deploy/deploy-minor-version:
requires:
- github-maven-deploy/approve-deploy-minor-version
<<: *mvn-deploy-command
filters:
branches:
only: master
- github-maven-deploy/deploy-major-version:
requires:
- github-maven-deploy/approve-deploy-major-version
<<: *mvn-deploy-command
filters:
branches:
only: master
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ make this simpler, as well.
versus how you fixed it.
* Try to fix one thing per pull request! Many people work on this code, so the more focused your changes are, the less
of a headache other people will have when they merge their work in.
* Ensure your Pull Request passes tests either locally or via TravisCI (it will run automatically on your PR)
* Ensure your Pull Request passes tests either locally or via CI (it will run automatically on your PR)
* Make sure to add yourself or your organization to CONTRIBUTORS.md as a part of your PR, if you are new to the project!
* If you're stuck, ask our [gitter channel](https://gitter.im/sonatype/nexus-developers)! There are a number of
experienced programmers who are happy to help with learning and troubleshooting.
Expand Down
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
-->
# Nexus Repository Composer Format

[![Build Status](https://travis-ci.org/sonatype-nexus-community/nexus-repository-composer.svg?branch=master)](https://travis-ci.org/sonatype-nexus-community/nexus-repository-composer) [![Join the chat at https://gitter.im/sonatype/nexus-developers](https://badges.gitter.im/sonatype/nexus-developers.svg)](https://gitter.im/sonatype/nexus-developers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![DepShield Badge](https://depshield.sonatype.org/badges/sonatype-nexus-community/nexus-repository-composer/depshield.svg)](https://depshield.github.io)
[![CircleCI](https://circleci.com/gh/sonatype-nexus-community/nexus-repository-composer.svg?style=svg)](https://circleci.com/gh/sonatype-nexus-community/nexus-repository-composer) [![Join the chat at https://gitter.im/sonatype/nexus-developers](https://badges.gitter.im/sonatype/nexus-developers.svg)](https://gitter.im/sonatype/nexus-developers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![DepShield Badge](https://depshield.sonatype.org/badges/sonatype-nexus-community/nexus-repository-composer/depshield.svg)](https://depshield.github.io)

# Table Of Contents
* [Developing](#developing)
* [Requirements](#requirements)
* [Building](#building)
* [Travis CI](#travis-ci)
* [Using Composer with Nexus Repository Manger 3](#using-composer-with-nexus-repository-manager-3)
* [Installing the plugin](#installing-the-plugin)
* [Temporary Install](#temporary-install)
Expand Down Expand Up @@ -48,11 +47,6 @@ To build the project and generate the bundle use Maven

If everything checks out, the bundle for Composer should be available in the `target` folder

### Travis CI

This project is built automatically with Travis CI, and you should be able to see build results on your commits, as well
as directly on [Travis CI](https://travis-ci.org/sonatype-nexus-community/nexus-repository-composer/).

#### Build with Docker

`docker build -t nexus-repository-composer:0.0.2 .`
Expand Down Expand Up @@ -153,4 +147,4 @@ Looking to contribute to our code but need some help? There's a few ways to get
* Check out the [Nexus Repository User List](https://groups.google.com/a/glists.sonatype.com/forum/?hl=en#!forum/nexus-users)

## Composer Plugin
The composer plugin `elendev/nexus-composer-push` (https://github.com/Elendev/nexus-composer-push) provide a composer command to push to a Nexus Repository using this plugin.
The composer plugin `elendev/nexus-composer-push` (https://github.com/Elendev/nexus-composer-push) provide a composer command to push to a Nexus Repository using this plugin.

0 comments on commit 8a27ab9

Please sign in to comment.