Skip to content

Commit

Permalink
Merge pull request #221 from bcgov/dev
Browse files Browse the repository at this point in the history
merge release 2.0.1 to master

There errors in the github actions build are a failure to contact slack.
I suspect this was setup when we were using slack and before it was shut done.
I'm going to ignore the error and proceed with the merge.
  • Loading branch information
dkelsey authored Feb 22, 2020
2 parents 12271c0 + 68527e2 commit 37dfd57
Show file tree
Hide file tree
Showing 209 changed files with 18,038 additions and 203 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
49 changes: 49 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: GitHub CI for Router

on:
push:
branches:
- dev
pull_request:
branches:
- master
- dev

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [1.11]
os: [ubuntu-latest]
pom_ver: [2.0.0]

steps:
- name: SCM Checkout
uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java_version }}
- name: Update Maven Release Version
run: mvn versions:set -DnewVersion='${{ matrix.pom_ver }}' -DgenerateBackupPoms=false --file pom.xml
- name: Build with Maven and Scan with SonarQube
env:
SONAR_URL: ${{ secrets.SONAR_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn clean package sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN --file pom.xml
- uses: 8398a7/action-slack@v1
with:
type: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
if: failure()
- uses: 8398a7/action-slack@v1
with:
type: success
env:
SLACK_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
if: success()
16 changes: 16 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: sidecar package
on:
push:
branches:
- master
jobs:
dockerize:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: SCM Checkout
uses: actions/checkout@v1
- name: One Click Docker
uses: pangzineng/Github-Action-One-Click-Docker@v1.1.1
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compiled class file
# ---> Java
*.class

# Log file
Expand All @@ -21,3 +21,21 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Maven
target/

# Eclipse
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
local.properties
.classpath
.settings/
.loadpath
*.launch
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM maven:3-jdk-11-slim AS builder
ADD . /app
WORKDIR /app
RUN mvn versions:set -DnewVersion='1' -DgenerateBackupPoms=false && mvn package

FROM busybox
RUN mkdir /app
COPY --from=builder /app/ols-*/target/ols-*.war /app/
RUN ls -la /app/
CMD ["tail", "-f", "/dev/null"]
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '1'))
}
parameters {
string(defaultValue: 'https://github.com/bcgov/ols-router.git', description: 'Source Code Repo URL', name: 'gitRepo')
string(defaultValue: 'dev', description: 'Git Branch or Tag Name', name: 'gitBranch')
choice(name: 'pn', choices: ['ols-router-admin', 'ols-router-web'], description: 'Product Name to build, used by docker package')
string(defaultValue: '2.0.0-SNAPSHOT', description: 'Version Tag will be used by Arctifactory', name: 'mvnTag', trim: false)
string(defaultValue: 'clean package -Pk8s -pl ${pn} -am', description: 'default maven life cycle goal', name: 'mvnGoal', trim: false)
}
stages {
stage ('code checkout') {
steps {
git branch: '${gitBranch}', url: "${gitRepo}"
}
}

stage('build && SonarQube analysis') {
environment {
scannerHome = tool 'appqa'
}
steps {
withSonarQubeEnv('SonarQube') {
withMaven(maven:'m3') {
sh 'mvn clean package sonar:sonar -Dsonar.java.source=11'
}
}
}
}
/* stage("Quality Gate") {
steps {
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: false
}
}
} */

stage ('create docker sidecar image') {
steps {
script {
def ocDir = tool "oc3.11"
withEnv(["PATH+OC=${ocDir}"]) {
openshift.withCluster() {
def models = openshift.process( "-f", "https://raw.githubusercontent.com/bcgov/ols-router/tools/ols-router.bc.yaml", "-p", "PROJ_NAME=${pn}", "SITE_REPO=${gitRepo}", "REPO_BRANCH=${gitBranch}", "MVN_GOAL=${mvnGoal}" )
openshift.delete( models )
def created = openshift.create( models )
def bc = openshift.selector( 'bc', [build: '${pn}'] )
def statusv = openshift.raw( 'status', '-v' )
echo "Cluster status: ${statusv.out}"
def buildSelector = bc.startBuild()
buildSelector.logs('-f')
def result = buildSelector.logs('-f')
def logsString = result.actions[0].out
def logsErr = result.actions[0].err
echo "The logs operation require ${result.actions.size()} oc interactions"
echo "Logs executed: ${result.actions[0].cmd}"
}
}
}
}
}
}
}
Loading

0 comments on commit 37dfd57

Please sign in to comment.