Skip to content

Commit

Permalink
change to non snapshot release
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesw committed Nov 20, 2024
1 parent 05c3d2f commit 3eec56e
Show file tree
Hide file tree
Showing 16 changed files with 1,319 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bld_mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ jobs:
strategy:
matrix:
include:
- project: hello_world
# - project: hello_world_2
- project: hello-world
- project: hello-world-alt

runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ jobs:
strategy:
matrix:
include:
- project: hello_world
- project: hello_world_2
- project: hello-world
- project: hello-world-alt

runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 8 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# RUN export ASDF_NODEJS_AUTO_ENABLE_COREPACK=yes
# RUN export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
nodejs 20.15.0
# RUN corepack enable
# RUN asdf reshim nodejs
java temurin-11.0.15+10
maven 3.6.3
mvnd 0.9.0
109 changes: 109 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/usr/bin/env bash

# exit on errors
set -o errexit -o errtrace -o nounset -o functrace -o pipefail
shopt -s inherit_errexit 2>/dev/null || true
trap 'sk-catch --exit_code $? --line $LINENO --linecallfunc "$BASH_COMMAND" --funcstack $(printf "::%s" ${FUNCNAME[@]}) -o stdout ' ERR

# import shellkit functions
source shellkit_bootstrap.sh

# defaults
current_dir=`pwd`
checkout_name=$(basename `pwd`)
NAME="$(basename "${0}")"
build_envs="prod sandbox qa int"
tag="v2.0.1"
current_dir=`pwd`

#
# functions
#

usage(){
I_USAGE="
Usage: ${NAME} [OPTIONS]
Description:
Build orcid-source war files for each project and then deploy to and artifact repo
NOTE: credentials for the artifact repo are sourced from aws secrets but you still need your aws api access to be configured
secretid is stored in shellkit.conf
General usage:
${NAME} -t vx.x.x
Required options:
-t | --tag ) tag ($tag)
"
echo "$I_USAGE"
exit

}

#
# args
#

while :
do
case ${1-default} in
--*help|-h ) usage ; exit 0 ;;
-t | --tag ) tag=$2; shift 2 ;;
-b | --build_envs ) build_envs=$2; shift 2 ;;
-v | --verbose ) verbose_arg='-v' VERBOSE=$((VERBOSE+1)); shift ;;
--) shift ; break ;;
-*) echo "WARN: Unknown option (ignored): $1" >&2 ; shift ;;
*) break ;;
esac
done

sk-arg-check tag

tag_numeric=$(echo "$tag" | tr -dc '[:digit:].')
echo_log "building for: $tag_numeric"

#
# setup build environment from .tool-versions
#
echo_log "configure build environment for orcid-angular $tag_numeric"

sk-asdf-install-tool-versions
# set JAVA_HOME
. ~/.asdf/plugins/java/set-java-home.bash
_asdf_java_update_java_home

sk-dir-make ~/log

echo $AWS_SECRET_ID
# source the secrets for the artifact uploads
sk-aws-secret-source $AWS_SECRET_ID

echo ${ARTIFACT_URL}${ARTIFACT_REPO_PATH}

export ARTIFACT_USER=$ARTIFACT_USER
export ARTIFACT_PASSWORD=$ARTIFACT_PASSWORD

for project in hello_world;do

build_log_file=~/log/orcid-source-${project}-${tag_numeric}.log

echo "mvn --batch-mode \
--settings settings-custom-deploy.xml \
--file \"${project}/pom.xml\" \
-Dmaven.test.skip \
-DaltReleaseDeploymentRepository=github::${ARTIFACT_URL}${ARTIFACT_REPO_PATH} \
deploy -Dmaven.test.skip -l $build_log_file"

mvn --batch-mode \
--settings settings-custom-deploy.xml \
--file "${project}/pom.xml" \
-Dmaven.test.skip \
-DaltReleaseDeploymentRepository=github::${ARTIFACT_URL}${ARTIFACT_REPO_PATH} \
deploy -Dmaven.test.skip -l $build_log_file
done

25 changes: 21 additions & 4 deletions hello_world_2/pom.xml → hello-world-alt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>hello-world-alt</artifactId>
<packaging>war</packaging>
<name>ORCID - hello-world</name>

<parent>
<groupId>com.example</groupId>
<groupId>org.orcid</groupId>
<artifactId>hello-world-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>hello-world-2</artifactId>

<properties>
<main.basedir>${project.parent.basedir}</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -33,6 +38,18 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>

</plugins>
</build>


</project>
15 changes: 15 additions & 0 deletions hello-world-alt/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Hello World</display-name>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>com.example.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
22 changes: 17 additions & 5 deletions hello_world/pom.xml → hello-world/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>hello-world</artifactId>
<packaging>war</packaging>
<name>ORCID - hello-world</name>

<parent>
<groupId>com.example</groupId>
<groupId>org.orcid</groupId>
<artifactId>hello-world-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<main.basedir>${project.parent.basedir}</main.basedir>
</properties>

<artifactId>hello-world</artifactId>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -38,6 +38,18 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>

</plugins>
</build>


</project>
15 changes: 15 additions & 0 deletions hello-world/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Hello World</display-name>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>com.example.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
Loading

0 comments on commit 3eec56e

Please sign in to comment.