Skip to content

Commit

Permalink
Support for a gitlab pipeline (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Jul 3, 2019
1 parent f82316e commit 247005a
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 8 deletions.
64 changes: 64 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

image: maven:3.6.1-jdk-11

variables:
GITLAB: "true"
LOCAL_REPO: "${CI_PROJECT_DIR}/.m2/repository"

# Cache downloaded dependencies and plugins between builds.
# "CI_JOB_NAME" should preserve cache across branches
cache:
paths:
- "$LOCAL_REPO"
key: "$CI_JOB_NAME"

stages:
- build

build_job:
stage: build
only:
- /^fix-.*$/
script:
- env
- if [ -d "$LOCAL_REPO" ]; then ls "$LOCAL_REPO" ; else echo "No $LOCAL_REPO"; fi
- etc/scripts/build.sh
tags:
- helidon

copyright_job:
stage: build
only:
- /^fix-.*$/
script:
- env
- if [ -d "$LOCAL_REPO" ]; then ls "$LOCAL_REPO" ; else echo "No $LOCAL_REPO"; fi
- etc/scripts/copyright.sh
tags:
- helidon

checkstyle:
stage: build
only:
- /^fix-.*$/
script:
- env
- if [ -d "$LOCAL_REPO" ]; then ls "$LOCAL_REPO" ; else echo "No $LOCAL_REPO"; fi
- etc/scripts/checkstyle.sh
tags:
- helidon
5 changes: 3 additions & 2 deletions etc/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ fi
# Path to the root of the workspace
readonly WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)

source ${WS_DIR}/etc/scripts/wercker-env.sh
source ${WS_DIR}/etc/scripts/pipeline-env.sh

if [ "${WERCKER}" = "true" ] ; then
if [ "${WERCKER}" = "true" -o "${GITLAB}" = "true" ] ; then
apt-get update && apt-get -y install graphviz
fi

inject_credentials

mvn -f ${WS_DIR}/pom.xml \
clean install -e \
-B \
-Pexamples,integrations,spotbugs,adoc-check,javadoc,docs,sources,ossrh-releases,tck,tests

examples/quickstarts/archetypes/test-archetypes.sh
4 changes: 2 additions & 2 deletions etc/scripts/checkstyle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,7 @@ readonly LOG_FILE=$(mktemp -t XXXcheckstyle-log)

readonly RESULT_FILE=$(mktemp -t XXXcheckstyle-result)

source ${WS_DIR}/etc/scripts/wercker-env.sh
source ${WS_DIR}/etc/scripts/pipeline-env.sh

die(){ echo "${1}" ; exit 1 ;}

Expand Down
2 changes: 1 addition & 1 deletion etc/scripts/copyright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ readonly WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)

readonly RESULT_FILE=$(mktemp -t XXXcopyright-result)

source ${WS_DIR}/etc/scripts/wercker-env.sh
source ${WS_DIR}/etc/scripts/pipeline-env.sh

die(){ echo "${1}" ; exit 1 ;}

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions etc/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ readonly PREPARE_HOOKS=( ${WS_DIR}/examples/quickstarts/archetypes/set-version.s
# Hooks for deployment work
readonly PERFORM_HOOKS=( ${WS_DIR}/examples/quickstarts/archetypes/deploy-archetypes.sh )

source ${WS_DIR}/etc/scripts/wercker-env.sh
source ${WS_DIR}/etc/scripts/pipeline-env.sh

if [ "${WERCKER}" = "true" ] ; then
if [ "${WERCKER}" = "true" -o "${GITLAB}" = "true" ] ; then
apt-get update && apt-get -y install graphviz
fi

Expand Down
3 changes: 3 additions & 0 deletions examples/employee-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
2 changes: 1 addition & 1 deletion examples/quickstarts/archetypes/create-archetype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,5 @@ echo "DONE!"
echo ""

if [ ! -z "${MAVEN_ARGS}" ] ; then
mvn -f ${ARCHETYPE_DIR}/pom.xml ${MAVEN_ARGS}
mvn -B -f ${ARCHETYPE_DIR}/pom.xml ${MAVEN_ARGS}
fi

0 comments on commit 247005a

Please sign in to comment.