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
Show 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
...
@@ -12,9 +12,11 @@ cd $DIR
# Determine the version that we're building based on the contents
# Determine the version that we're building based on the contents
# of packer/version.go.
# of packer/version.go.
VERSION
=
$(
grep
"const Version "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
VERSION
=
$(
grep
"const Version "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
VERSIONDIR
=
"
${
VERSION
}
"
PREVERSION
=
$(
grep
"const VersionPrerelease "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
PREVERSION
=
$(
grep
"const VersionPrerelease "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
if
[
!
-z
$PREVERSION
]
;
then
if
[
!
-z
$PREVERSION
]
;
then
PREVERSION
=
"
${
PREVERSION
}
.
$(
date
-u
+%s
)
"
PREVERSION
=
"
${
PREVERSION
}
.
$(
date
-u
+%s
)
"
VERSIONDIR
=
"
${
VERSIONDIR
}
-
${
PREVERSION
}
"
fi
fi
echo
"Version:
${
VERSION
}
${
PREVERSION
}
"
echo
"Version:
${
VERSION
}
${
PREVERSION
}
"
...
@@ -31,6 +33,21 @@ xc() {
...
@@ -31,6 +33,21 @@ xc() {
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
# Make sure that if we're killed, we kill all our subprocseses
trap
"kill 0"
SIGINT SIGTERM EXIT
trap
"kill 0"
SIGINT SIGTERM EXIT
...
@@ -48,13 +65,25 @@ for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
...
@@ -48,13 +65,25 @@ for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
)
&
)
&
done
done
# Wait for all the background tasks to finish
waitAll
RESULT
=
"0"
for
job
in
`
jobs
-p
`
;
do
# Zip all the packages
wait
$job
mkdir
-p
./pkg/
${
VERSIONDIR
}
/dist
if
[
$?
-ne
0
]
;
then
for
PLATFORM
in
$(
find ./pkg/
${
VERSIONDIR
}
-mindepth
1
-maxdepth
1
-type
d
)
;
do
RESULT
=
"1"
PLATFORM_NAME
=
$(
basename
${
PLATFORM
}
)
ARCHIVE_NAME
=
"
${
VERSIONDIR
}
_
${
PLATFORM_NAME
}
"
if
[
$PLATFORM_NAME
=
"dist"
]
;
then
continue
fi
fi
(
pushd
${
PLATFORM
}
zip
${
DIR
}
/pkg/
${
VERSIONDIR
}
/dist/
${
ARCHIVE_NAME
}
.zip ./
*
popd
)
&
done
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