Skip to content

Commit 3b308f5

Browse files
authored
Merge pull request #5 from bramwelt-gitlab-test/ci-1583970719
New CI
2 parents 86a225c + 54abd9f commit 3b308f5

File tree

6 files changed

+172
-3
lines changed

6 files changed

+172
-3
lines changed

.github/workflows/merge.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Merges
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
merge:
12+
runs-on: ubuntu-latest
13+
env:
14+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
15+
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository"
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Java 1.8
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Cache Packages
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
- name: Build and Run Tests
30+
run: mvn $MAVEN_CLI_OPTS install
31+
- name: Archive SNAPSHOTs
32+
uses: actions/upload-artifact@v1
33+
with:
34+
name: snapshot
35+
path: target

.github/workflows/pull_request.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Pull Requests
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
pull_request:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
env:
14+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
15+
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository"
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Java 1.8
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Cache Packages
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
- name: Build and Run Tests
30+
run: mvn $MAVEN_CLI_OPTS install

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Releases
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
release:
7+
types:
8+
- created
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
env:
14+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
15+
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository"
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Java 1.8
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Strip SNAPSHOT Version
23+
run: |
24+
mvn $MAVEN_CLI_OPTS \
25+
versions:set versions:update-child-modules versions:commit \
26+
-DnewVersion=${VERSION/refs\/tags\/} \
27+
-DgenerateBackupPoms=false
28+
env:
29+
VERSION: ${{ github.ref }}
30+
- name: Publish GitHub Packages
31+
run: |
32+
mvn $MAVEN_CLI_OPTS \
33+
deploy \
34+
-D altDeploymentRepository=release::default::${MAVEN_RELEASE_REPO_URL}
35+
env:
36+
MAVEN_RELEASE_REPO_USER: ${{ github.actor }}
37+
MAVEN_RELEASE_REPO_PASS: ${{ secrets.GITHUB_TOKEN }}
38+
MAVEN_RELEASE_REPO_URL: https://maven.pkg.github.com/${{ github.repository }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
target/*
1+
.tox/
2+
*.retry
3+
*.swp

.m2/settings.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<servers>
5+
<server>
6+
<id>release</id>
7+
<username>${env.MAVEN_RELEASE_REPO_USER}</username>
8+
<password>${env.MAVEN_RELEASE_REPO_PASS}</password>
9+
</server>
10+
</servers>
11+
</settings>

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1-
# README
1+
# My CI/CD Ready Repo
2+
3+
## Roles can be installed with:
4+
5+
# Future this will be `install linuxfoundation.ci`
6+
# which will contain all the other roles as dependencies
7+
# and may be done as a post-run script for cookiecutter
8+
ansible-galaxy install -r requirements.yml --roles-path roles
9+
10+
## Individual roles can be tested with the following command:
11+
12+
# In the future this will be molecule, or an ansible specific runner
13+
docker run --rm -it \
14+
-v $PWD:/app \
15+
-w /app \
16+
-e ANSIBLE_STDOUT_CALLBACK=unixy \
17+
-e WORKSPACE=/app \
18+
williamyeh/ansible:alpine3 \
19+
ansible-playbook -c local .playbooks/verify.yml
20+
21+
22+
23+
24+
25+
# Java Toolchain
26+
27+
## Environment
28+
29+
- MAVEN_RELEASE_REPO_URL
30+
URL of the release repository
31+
32+
- MAVEN_RELEASE_REPO_USER
33+
Username for the release repository
34+
35+
- MAVEN_RELEASE_REPO_PASS
36+
Password for the release repository
37+
38+
- MAVEN_RELEASE_REPO
39+
Nmae of the release repository
40+
41+
- MAVEN_SNAPSHOT_REPO_URL
42+
URL of the snapshot repository
43+
44+
- MAVEN_SNAPSHOT_REPO_USER
45+
Username for the snapshot repository
46+
47+
- MAVEN_SNAPSHOT_REPO_PASS
48+
Password for the snapshot repository
49+
50+
- MAVEN_SNAPSHOT_REPO
51+
Nmae of the snapshot repository
52+
53+
54+
55+
256

3-
Simple maven dependency

0 commit comments

Comments
 (0)