-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Conjur-Enterprise/auto-releases
CNJR-5562: Add automated release
- Loading branch information
Showing
12 changed files
with
136 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
[Bb]in/ | ||
packages/ | ||
TestResults/ | ||
VERSION | ||
|
||
# globs | ||
Makefile.in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
#!/bin/sh -xe | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
finish() { | ||
if [ -n "$CIDFILE" ]; then | ||
CID=`cat $CIDFILE` | ||
docker rm -f $CID | ||
rm -f $CIDFILE | ||
CID=$(cat "$CIDFILE") | ||
docker rm -f "$CID" | ||
rm -f "$CIDFILE" | ||
fi | ||
} | ||
trap finish EXIT | ||
|
||
TAG=`cat docker/tag` | ||
TAG=$(cat docker/tag) | ||
|
||
CIDFILE=`mktemp -u` | ||
docker run -v $PWD:/src:ro --cidfile=$CIDFILE -e build_name=$1 -e WRITE_ARTIFACTORY_USERNAME -e WRITE_ARTIFACTORY_PASSWORD -e WRITE_ARTIFACTORY_URL $TAG | ||
CIDFILE=$(mktemp -u) | ||
docker run -v "$PWD":/src:ro --cidfile="$CIDFILE" -e WRITE_ARTIFACTORY_USERNAME -e WRITE_ARTIFACTORY_PASSWORD -e WRITE_ARTIFACTORY_URL "$TAG" | ||
|
||
CID=`cat $CIDFILE` | ||
CID=$(cat "$CIDFILE") | ||
|
||
docker cp $CID:"/build/TestResults.xml" . | ||
docker cp "$CID":"/build/TestResults.xml" . | ||
mkdir -p bin | ||
docker cp $CID:"/build/conjur-api/bin/Release/net6.0/conjur-api.dll" bin/conjur-api.dll | ||
docker cp "$CID":"/build/conjur-api/bin/Release/net6.0/conjur-api.dll" bin/conjur-api.dll | ||
|
||
cat TestResults.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
#!/bin/sh -xe | ||
#!/usr/bin/env bash | ||
set -euox pipefail | ||
|
||
function repo_root() { | ||
git rev-parse --show-toplevel | ||
} | ||
|
||
function project_version() { | ||
# VERSION derived from CHANGELOG and automated release library | ||
echo "$(<"$(repo_root)/VERSION")" | ||
} | ||
|
||
# Create a clean copy of the source code for build | ||
cp -a /src /build | ||
git config --global --add safe.directory /build | ||
cd /build | ||
git clean -fdx || : | ||
# Copy the VERSION file generated by the CI to the build directory | ||
cp /src/VERSION /build/VERSION | ||
|
||
# Restore nuget packages | ||
dotnet restore | ||
|
||
# test | ||
dotnet build | ||
dotnet test --logger:"junit;LogFileName=/build/TestResults.xml" | ||
|
||
# build | ||
dotnet build api-dotnet.sln --configuration Release | ||
VERSION=$(project_version) | ||
dotnet build api-dotnet.sln --configuration Release /p:AssemblyVersion="$VERSION" | ||
|
||
docker/nuget.sh | ||
docker/nuget.sh "$VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh -xe | ||
#!/usr/bin/env bash | ||
set -euox pipefail | ||
|
||
BIN=/conjur-api.dll | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters