-
Notifications
You must be signed in to change notification settings - Fork 23
/
assemble
executable file
·34 lines (28 loc) · 990 Bytes
/
assemble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -e
#
# S2I assemble script for the 'aspnet' image.
# The 'assemble' script builds your application source so that it is ready to run.
#
# For more information refer to the documentation:
# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
#
if [[ "$1" == "-h" ]]; then
# If the 'aspnet' assemble script is executed with '-h' flag,
# print the usage.
exec /usr/libexec/s2i/usage
fi
# Restore artifacts from the previous build (if they exist).
# We set them here just for show, but you will need to set this up with your logic
# according to the application directory that you chose.
if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then
echo "---> Restoring build artifacts..."
mv /tmp/artifacts/* ${HOME}/
fi
echo "---> Building and installing application from source..."
cd ${HOME}
dotnet restore
dotnet build
# Fix source directory permissions
fix-permissions ./
# set permissions for any installed artifacts
fix-permissions /opt/app-root