-
Notifications
You must be signed in to change notification settings - Fork 12
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 #45 from Native-Planet/standalone
Beta-3.3.0
- Loading branch information
Showing
32 changed files
with
453 additions
and
445 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
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,67 +1,10 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
reg_pw = credentials('Dockerhub PW') | ||
environ = sh ( | ||
script: ''' | ||
echo $BRANCH_NAME|sed 's@origin/@@g' | ||
''', | ||
returnStdout: true | ||
).trim() | ||
} | ||
stages { | ||
stage('Build') { | ||
environment { | ||
environ = sh ( | ||
script: ''' | ||
echo $BRANCH_NAME|sed 's@origin/@@g' | ||
''', | ||
returnStdout: true | ||
).trim() | ||
tag = sh ( | ||
script: ''' | ||
if [ "${environ}" = "dev" ]; then | ||
echo "staging" | ||
elif [ "${environ}" = "master" ]; then | ||
echo "latest" | ||
else | ||
echo "nobuild" | ||
fi | ||
''', | ||
returnStdout: true | ||
).trim() | ||
} | ||
steps { | ||
script { | ||
if( "${tag}" == "nobuild" ) { | ||
currentBuild.getRawBuild().getExecutor().interrupt(Result.ABORTED) | ||
print("Ignoring branch ${tag}") | ||
sleep(1) | ||
} | ||
} | ||
git url: 'https://github.com/Native-Planet/anchor-source.git', | ||
credentialsId: 'Github token', | ||
branch: "${environ}" | ||
sh "docker login -u nativeplanet -p $reg_pw docker.io" | ||
dir("${env.WORKSPACE}/"){ | ||
sh ( | ||
script: ''' | ||
docker buildx build --platform linux/amd64 --no-cache ./api/ -t groundseg-api:${tag} | ||
docker tag groundseg-api:${tag} nativeplanet/groundseg-api:${tag} | ||
docker buildx build --platform linux/amd64 --no-cache ./ui/ -t anchor-webui:${tag} | ||
docker tag groundseg-webui:${tag} nativeplanet/groundseg-webui:${tag} | ||
docker push nativeplanet/groundseg-api:${tag} | ||
docker push nativeplanet/groundseg-webui:${tag} | ||
''', | ||
returnStdout: true | ||
) | ||
} | ||
sh 'mv ./release/version.csv /opt/groundseg/version/version.csv' | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
cleanWs deleteDirs: true, notFailBuild: true | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.