forked from Azure/azure-cosmosdb-spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fokko Driesprong
committed
Jul 8, 2018
1 parent
739c5a1
commit 3f60b39
Showing
5 changed files
with
93 additions
and
0 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
*.iml | ||
target/ | ||
*.DS_Store | ||
.zinc/ | ||
.m2/ |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
steps: | ||
- task: DockerCompose@0 | ||
displayName: package fat jar | ||
inputs: | ||
dockerComposeCommand: run --rm maven mvn clean package | ||
- task: ShellScript@2 | ||
displayName: Upload artifact to ADLS | ||
inputs: | ||
scriptPath: ./deploy_to_adls.sh | ||
env: | ||
AZURE_SP_USERNAME: $(azure_sp_username) | ||
AZURE_SP_PASSWORD: $(azure_sp_password) | ||
AZURE_SP_TENANTID: $(azure_sp_tenantid) | ||
AZURE_ADLS_NAME: $(azure_adls_name) |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Checking if commit is release tag" | ||
|
||
tag=`git describe --exact-match --tags HEAD` | ||
if [[ ${tag} =~ ^([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})$ ]] | ||
then | ||
echo "Commit is a release, deploying artifact" | ||
echo "logging into azure" | ||
|
||
az login \ | ||
--service-principal \ | ||
-u ${AZURE_SP_USERNAME} \ | ||
-p ${AZURE_SP_PASSWORD} \ | ||
--tenant ${AZURE_SP_TENANTID} | ||
|
||
fn=`find ./target/scala-2.11/ -name "*.jar" | rev | cut -d '/' -f1 | rev | head -n 1` # gotta love `rev` | ||
source=./target/scala-2.11/${fn} | ||
destination=/libraries/${BUILD_DEFINITIONNAME}/${BUILD_DEFINITIONNAME}-${tag}.jar | ||
|
||
echo "uploading artifact from" | ||
echo " | from ${source}" | ||
echo " | to ${AZURE_ADLS_NAME}" | ||
echo " | on path ${destination}" | ||
|
||
az dls fs upload \ | ||
--account ${AZURE_ADLS_NAME} \ | ||
--source-path ${source} \ | ||
--destination-path ${destination} | ||
else | ||
echo "Commit is not a release, not deploying artifact" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Checking if commit is release tag" | ||
|
||
tag=`git describe --exact-match --tags HEAD` | ||
if [[ ${tag} =~ ^([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})$ ]] | ||
then | ||
echo "Commit is a release, deploying artifact" | ||
echo "logging into azure" | ||
|
||
az login \ | ||
--service-principal \ | ||
-u ${AZURE_SP_USERNAME} \ | ||
-p ${AZURE_SP_PASSWORD} \ | ||
--tenant ${AZURE_SP_TENANTID} | ||
|
||
fn=`find ./target/ -name "*uber.jar" | rev | cut -d '/' -f1 | rev | head -n 1` # gotta love `rev` | ||
source=./target/scala-2.11/${fn} | ||
destination=/libraries/${BUILD_DEFINITIONNAME}/${BUILD_DEFINITIONNAME}-${tag}.jar | ||
|
||
echo "uploading artifact from" | ||
echo " | from ${source}" | ||
echo " | to ${AZURE_ADLS_NAME}" | ||
echo " | on path ${destination}" | ||
|
||
az dls fs upload \ | ||
--account ${AZURE_ADLS_NAME} \ | ||
--source-path ${source} \ | ||
--destination-path ${destination} | ||
else | ||
echo "Commit is not a release, not deploying artifact" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3.3" | ||
services: | ||
maven: | ||
image: maven:3.5.4 | ||
working_dir: /root/ | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /root | ||
tty: true | ||
environment: | ||
- AZURE_COSMOS_END_POINT | ||
- AZURE_COSMOS_MASTER_KEY |