Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
13407678
Commit
13407678
authored
Jun 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: zip the packages for dist
parent
7cddca2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
7 deletions
+36
-7
scripts/dist.sh
scripts/dist.sh
+36
-7
No files found.
scripts/dist.sh
View file @
13407678
...
...
@@ -12,9 +12,11 @@ cd $DIR
# Determine the version that we're building based on the contents
# of packer/version.go.
VERSION
=
$(
grep
"const Version "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
VERSIONDIR
=
"
${
VERSION
}
"
PREVERSION
=
$(
grep
"const VersionPrerelease "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
if
[
!
-z
$PREVERSION
]
;
then
PREVERSION
=
"
${
PREVERSION
}
.
$(
date
-u
+%s
)
"
VERSIONDIR
=
"
${
VERSIONDIR
}
-
${
PREVERSION
}
"
fi
echo
"Version:
${
VERSION
}
${
PREVERSION
}
"
...
...
@@ -31,6 +33,21 @@ xc() {
xc
}
# This function waits for all background tasks to complete
waitAll
()
{
RESULT
=
0
for
job
in
`
jobs
-p
`
;
do
wait
$job
if
[
$?
-ne
0
]
;
then
RESULT
=
1
fi
done
if
[
$RESULT
-ne
0
]
;
then
exit
$RESULT
fi
}
# Make sure that if we're killed, we kill all our subprocseses
trap
"kill 0"
SIGINT SIGTERM EXIT
...
...
@@ -48,13 +65,25 @@ for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
)
&
done
# Wait for all the background tasks to finish
RESULT
=
"0"
for
job
in
`
jobs
-p
`
;
do
wait
$job
if
[
$?
-ne
0
]
;
then
RESULT
=
"1"
waitAll
# Zip all the packages
mkdir
-p
./pkg/
${
VERSIONDIR
}
/dist
for
PLATFORM
in
$(
find ./pkg/
${
VERSIONDIR
}
-mindepth
1
-maxdepth
1
-type
d
)
;
do
PLATFORM_NAME
=
$(
basename
${
PLATFORM
}
)
ARCHIVE_NAME
=
"
${
VERSIONDIR
}
_
${
PLATFORM_NAME
}
"
if
[
$PLATFORM_NAME
=
"dist"
]
;
then
continue
fi
(
pushd
${
PLATFORM
}
zip
${
DIR
}
/pkg/
${
VERSIONDIR
}
/dist/
${
ARCHIVE_NAME
}
.zip ./
*
popd
)
&
done
exit
$RESULT
waitAll
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment