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
69f96aa3
Commit
69f96aa3
authored
Jun 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Begin work on the dist.sh script to create the distribution
parent
70c4753f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
3 deletions
+60
-3
dist.sh
dist.sh
+43
-0
packer/version.go
packer/version.go
+17
-3
No files found.
dist.sh
0 → 100755
View file @
69f96aa3
#!/bin/bash
set
-e
# Get the directory where this script is. This will also resolve
# any symlinks in the directory/script, so it will be the fully
# resolved path.
SOURCE
=
"
${
BASH_SOURCE
[0]
}
"
while
[
-h
"
$SOURCE
"
]
;
do
SOURCE
=
"
$(
readlink
"
$SOURCE
"
)
"
;
done
DIR
=
"
$(
cd
-P
"
$(
dirname
"
$SOURCE
"
)
"
&&
pwd
)
"
# 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/'
)
PREVERSION
=
$(
grep
"const VersionPrerelease "
packer/version.go |
sed
-E
's/.*"(.+)"$/\1/'
)
if
[
!
-z
$PREVERSION
]
;
then
PREVERSION
=
"
${
PREVERSION
}
.
$(
date
-u
+%s
)
"
fi
echo
"Version:
${
VERSION
}
${
PREVERSION
}
"
# This function builds whatever directory we're in...
xc
()
{
goxc
\
-arch
=
"386 amd64 arm"
\
-os
=
"linux darwin windows freebsd openbsd"
\
-d
=
"
${
DIR
}
/pkg"
\
-pv
=
"
${
VERSION
}
"
\
-pr
=
"
${
PREVERSION
}
"
\
go-install
\
xc
}
# Build our root project
xc
# Build all the plugins
for
PLUGIN
in
$(
find ./plugin
-mindepth
1
-maxdepth
1
-type
d
)
;
do
PLUGIN_NAME
=
$(
basename
${
PLUGIN
}
)
pushd
${
PLUGIN
}
xc
popd
find ./pkg
-type
f
-name
${
PLUGIN_NAME
}
-execdir
mv
${
PLUGIN_NAME
}
packer-
${
PLUGIN_NAME
}
';'
done
packer/version.go
View file @
69f96aa3
package
packer
import
"fmt"
import
(
"bytes"
"fmt"
)
// The version of packer.
const
Version
=
"0.1.0.dev"
const
Version
=
"0.1.0"
// Any pre-release marker for the version. If this is "" (empty string),
// then it means that it is a final release. Otherwise, this is the
// pre-release marker.
const
VersionPrerelease
=
"dev"
type
versionCommand
byte
...
...
@@ -15,7 +23,13 @@ command-line flags for this command.`
}
func
(
versionCommand
)
Run
(
env
Environment
,
args
[]
string
)
int
{
env
.
Ui
()
.
Say
(
fmt
.
Sprintf
(
"Packer v%v"
,
Version
))
var
versionString
bytes
.
Buffer
fmt
.
Fprintf
(
&
versionString
,
"Packer v%s"
,
Version
)
if
VersionPrerelease
!=
""
{
fmt
.
Fprintf
(
&
versionString
,
".%s"
,
VersionPrerelease
)
}
env
.
Ui
()
.
Say
(
versionString
.
String
())
return
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