Skip to content

Commit

Permalink
Add gitlab-ci file/Publishing packages to nexus
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Avramenko <[email protected]>
  • Loading branch information
oavramenk committed Oct 21, 2021
1 parent 6548c9c commit ae721c6
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
43 changes: 43 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
stages:
- static scans
- publish pages
- publish packages

variables:
VAULT_ADDR: $VAULT_ADDR


secret_detection:
stage: static scans

license_scanning:
stage: static scans

publish:
stage: publish packages
tags:
- docker-sock
image: advancedtelematic/gitlab-jobs:0.2.5
only:
- master
except:
- schedules
script:
- git fetch origin
- git describe
- export VAULT_TOKEN=$(cat /opt/vault/token)
- gitlab-docker-login $VAULT_ADDR
- eval $(set-vault-env -v $VAULT_ADDR --secret gitlab/ats-aws-key --secret gitlab/maven-publish)
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 +publish
cache:
paths:
- .ivy2/
- .sbt/

include:
- project: "poit/spc/be/prodsec-secret-detection"
file: "ITT-Secret-Detection.gitlab-ci.yml"
- template: License-Scanning.gitlab-ci.yml
- project: olp/edge/ota/infra/security
ref: v0.0.9
file: /shared.yaml
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

17 changes: 9 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,22 @@ lazy val commonSettings =
"-source", "1.8",
"-target", "1.8"
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
publishTo := {
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "content/repositories/releases")
},
credentials +=
Credentials(
readSettings("PUBLISH_REALM"),
URI.create(nexus).getHost,
readSettings("PUBLISH_USER"),
readSettings("PUBLISH_PASSWORD")
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
publishTo := {
val server = nexus
if (isSnapshot.value)
Some("snapshots" at server + "snapshots")
else
Some("releases" at server + "releases")
},
releaseProcess := Seq(
checkSnapshotDependencies,
releaseStepCommand(ExtraReleaseCommands.initialVcsChecksCommand),
Expand Down

0 comments on commit ae721c6

Please sign in to comment.