Skip to content

Commit

Permalink
Merge pull request #90 from lucidsoftware/deb-artifactory
Browse files Browse the repository at this point in the history
Add step to deploy deb to github workflow
  • Loading branch information
tmccombs authored Apr 23, 2021
2 parents 7b5867f + 890a6d7 commit f3df5b3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ jobs:
if [[ $GITHUB_REF == refs/tags/* ]]; then
version="${GITHUB_REF#refs/tags/}"
else
version="${GITHUB_REF#refs/branches/}-SNAPSHOT"
version="${GITHUB_REF##*/}-SNAPSHOT"
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "SBT_OPTS=-Dbuild.version=$version" >> $GITHUB_ENV
- name: Test
run: sbt compile test doc
run: sbt compile test doc Debian/packageBin
- name: Publish to Sonatype
if: ${{ github.repository == 'lucidsoftware/piezo' }}
env:
Expand All @@ -36,12 +37,18 @@ jobs:
else
sbt publishSigned
fi
- name: Publish Deb to Artifactory
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && github.repository == 'lucidsoftware/piezo' }}
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
run: |
curl --silent --fail --show-error -H "Authorization: Bearer $ARTIFACTORY_TOKEN" --upload-file "admin/target/piezo-admin_${VERSION}_all.deb" \
"https://lucidsoftware.jfrog.io/artifactory/apt/pool/piezo-admin_${VERSION//-/\~}_all.deb;deb.distribution=piezo;deb.component=main;deb.architecture=all"
- name: Upload assets to Github
if: ${{ github.action_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
tag="${GITHUB_REF#refs/tags/}"
args=$(printf -- "-a %q " {admin,worker}/target/**/*.jar)
hub release create $args -m "Release $tag" $tag
args=$(printf -- "-a %q " {admin,worker}/target/**/*.jar admin/target/*.deb)
hub release create $args -m "Release $VERSION" $VERSION
16 changes: 14 additions & 2 deletions admin/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
enablePlugins(PlayScala)
enablePlugins(SystemdPlugin)

bashScriptExtraDefines ++= Seq(
s"addJava -Dorg.quartz.properties=${defaultLinuxConfigLocation.value}/${(Linux / packageName).value}/quartz.properties",
"addJava -Dpidfile.path=/var/run/piezo-admin/piezo-admin.pid",
"addJava -Dpidfile.path=/run/piezo-admin/piezo-admin.pid",
s"addJava -Dhttp.port=${PlayKeys.playDefaultPort.value}"
)

Expand All @@ -17,12 +18,23 @@ libraryDependencies ++= Seq(
specs2 % Test
)

maintainer := "Lucid Software Team <ops@lucidchart.com>"
Debian/version := {
val noDashVersion = (Compile/version).value.replace("-", "~")
if (noDashVersion.matches("^\\d.*")) {
noDashVersion
} else {
"0~" + noDashVersion
}
}

maintainer := "Lucid Software, Inc. <ops@lucidchart.com>"

name := "piezo-admin"

packageDescription := "Piezo web admin"

PlayKeys.playDefaultPort := 8001

Debian/defaultLinuxStartScriptLocation := "/lib/systemd/system"

publishTo := sonatypePublishToBundle.value

0 comments on commit f3df5b3

Please sign in to comment.