Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
Kirill Smelkov
gitlab-workhorse
Commits
cabd0a43
Commit
cabd0a43
authored
Jan 18, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build artifacts metadata version to 0.0.2
parent
1556bee3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
internal/artifacts/metadata.go
internal/artifacts/metadata.go
+10
-6
No files found.
internal/artifacts/metadata.go
View file @
cabd0a43
package
artifacts
package
artifacts
import
(
import
(
"archive/zip"
"archive/zip"
"io"
"encoding/binary"
"encoding/binary"
"encoding/json"
"encoding/json"
"io"
"strconv"
)
)
type
metadata
struct
{
type
metadata
struct
{
Modified
uint16
`json:"modified"`
Modified
int64
`json:"modified"`
Mode
string
`json:"mode"`
CRC
uint32
`json:"crc,omitempty"`
CRC
uint32
`json:"crc,omitempty"`
Size
uint64
`json:"size,omitempty"`
Size
uint64
`json:"size,omitempty"`
Zipped
uint64
`json:"zipped,omitempty"`
Zipped
uint64
`json:"zipped,omitempty"`
...
@@ -16,10 +19,11 @@ type metadata struct {
...
@@ -16,10 +19,11 @@ type metadata struct {
func
newMetadata
(
file
*
zip
.
File
)
metadata
{
func
newMetadata
(
file
*
zip
.
File
)
metadata
{
return
metadata
{
return
metadata
{
Modified
:
file
.
ModifiedDate
,
Modified
:
file
.
ModTime
()
.
Unix
(),
Mode
:
strconv
.
FormatUint
(
uint64
(
file
.
Mode
()
.
Perm
()),
8
),
CRC
:
file
.
CRC32
,
CRC
:
file
.
CRC32
,
Size
:
file
.
C
ompressedSize64
,
Size
:
file
.
Unc
ompressedSize64
,
Zipped
:
file
.
Unc
ompressedSize64
,
Zipped
:
file
.
C
ompressedSize64
,
Comment
:
file
.
Comment
,
Comment
:
file
.
Comment
,
}
}
}
}
...
@@ -34,7 +38,7 @@ func (m metadata) write(output io.Writer) error {
...
@@ -34,7 +38,7 @@ func (m metadata) write(output io.Writer) error {
}
}
func
generateZipMetadata
(
output
io
.
Writer
,
archive
*
zip
.
Reader
)
error
{
func
generateZipMetadata
(
output
io
.
Writer
,
archive
*
zip
.
Reader
)
error
{
err
:=
writeString
(
output
,
"GitLab Build Artifacts Metadata 0.0.
1
\n
"
)
err
:=
writeString
(
output
,
"GitLab Build Artifacts Metadata 0.0.
2
\n
"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
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