Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
3b55d6e9
Commit
3b55d6e9
authored
Jun 03, 2022
by
Josh Spicer
Committed by
GitHub
Jun 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add v2 action
parent
c12a205a
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
16478 additions
and
1 deletion
+16478
-1
README.md
.github/devcontainers-action/README.md
+3
-0
action.yml
.github/devcontainers-action/action.yml
+32
-0
index.js
.github/devcontainers-action/dist/index.js
+15411
-0
index.js.map
.github/devcontainers-action/dist/index.js.map
+1
-0
licenses.txt
.github/devcontainers-action/dist/licenses.txt
+772
-0
sourcemap-register.js
.github/devcontainers-action/dist/sourcemap-register.js
+1
-0
collection.js
.github/devcontainers-action/lib/contracts/collection.js
+2
-0
main.js
.github/devcontainers-action/lib/main.js
+84
-0
utils.js
.github/devcontainers-action/lib/utils.js
+131
-0
sync-action.sh
.github/devcontainers-action/sync-action.sh
+13
-0
release-v1.yaml
.github/workflows/release-v1.yaml
+1
-1
release.yaml
.github/workflows/release.yaml
+26
-0
.gitignore
.gitignore
+1
-0
No files found.
.github/devcontainers-action/README.md
0 → 100644
View file @
3b55d6e9
# Devcontainers/action
Temporary copy of
[
devcontainers/action
](
https://github.com/devcontainers/action
)
.
.github/devcontainers-action/action.yml
0 → 100644
View file @
3b55d6e9
name
:
'
Dev
Container'
description
:
'
Publish
custom
development
container
feature(s)
and/or
templates(s)'
author
:
'
GitHub'
branding
:
icon
:
box
color
:
blue
inputs
:
# Global options
publish-features
:
required
:
false
default
:
"
false"
description
:
"
['true'/'false']
Publish
dev
container
'feature'
artifacts"
publish-templates
:
required
:
false
default
:
"
false"
description
:
"
['true'/'false']
Publish
dev
container
'template'
artifacts"
# 'features' options
base-path-to-features
:
required
:
false
default
:
'
./features/src'
description
:
"
Relative
path
to
the
'src'
folder
containing
dev
container
'feature(s)'"
# 'template' options
base-path-to-templates
:
required
:
false
default
:
'
./templates/src'
description
:
"
Relative
path
to
the
folder
containing
dev
container
'template(s)'"
runs
:
using
:
'
node12'
main
:
'
dist/index.js'
.github/devcontainers-action/dist/index.js
0 → 100644
View file @
3b55d6e9
This diff is collapsed.
Click to expand it.
.github/devcontainers-action/dist/index.js.map
0 → 100644
View file @
3b55d6e9
This diff is collapsed.
Click to expand it.
.github/devcontainers-action/dist/licenses.txt
0 → 100644
View file @
3b55d6e9
This diff is collapsed.
Click to expand it.
.github/devcontainers-action/dist/sourcemap-register.js
0 → 100644
View file @
3b55d6e9
This diff is collapsed.
Click to expand it.
.github/devcontainers-action/lib/contracts/collection.js
0 → 100644
View file @
3b55d6e9
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
.github/devcontainers-action/lib/main.js
0 → 100644
View file @
3b55d6e9
"use strict"
;
/*--------------------------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
*-------------------------------------------------------------------------------------------------------------*/
var
__createBinding
=
(
this
&&
this
.
__createBinding
)
||
(
Object
.
create
?
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
Object
.
defineProperty
(
o
,
k2
,
{
enumerable
:
true
,
get
:
function
()
{
return
m
[
k
];
}
});
})
:
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
o
[
k2
]
=
m
[
k
];
}));
var
__setModuleDefault
=
(
this
&&
this
.
__setModuleDefault
)
||
(
Object
.
create
?
(
function
(
o
,
v
)
{
Object
.
defineProperty
(
o
,
"default"
,
{
enumerable
:
true
,
value
:
v
});
})
:
function
(
o
,
v
)
{
o
[
"default"
]
=
v
;
});
var
__importStar
=
(
this
&&
this
.
__importStar
)
||
function
(
mod
)
{
if
(
mod
&&
mod
.
__esModule
)
return
mod
;
var
result
=
{};
if
(
mod
!=
null
)
for
(
var
k
in
mod
)
if
(
k
!==
"default"
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
mod
,
k
))
__createBinding
(
result
,
mod
,
k
);
__setModuleDefault
(
result
,
mod
);
return
result
;
};
var
__awaiter
=
(
this
&&
this
.
__awaiter
)
||
function
(
thisArg
,
_arguments
,
P
,
generator
)
{
function
adopt
(
value
)
{
return
value
instanceof
P
?
value
:
new
P
(
function
(
resolve
)
{
resolve
(
value
);
});
}
return
new
(
P
||
(
P
=
Promise
))(
function
(
resolve
,
reject
)
{
function
fulfilled
(
value
)
{
try
{
step
(
generator
.
next
(
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
rejected
(
value
)
{
try
{
step
(
generator
[
"throw"
](
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
step
(
result
)
{
result
.
done
?
resolve
(
result
.
value
)
:
adopt
(
result
.
value
).
then
(
fulfilled
,
rejected
);
}
step
((
generator
=
generator
.
apply
(
thisArg
,
_arguments
||
[])).
next
());
});
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
const
core
=
__importStar
(
require
(
"@actions/core"
));
const
utils_1
=
require
(
"./utils"
);
function
run
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
core
.
debug
(
'Reading input parameters...'
);
const
shouldPublishFeatures
=
core
.
getInput
(
'publish-features'
).
toLowerCase
()
===
'true'
;
const
shouldPublishTemplate
=
core
.
getInput
(
'publish-templates'
).
toLowerCase
()
===
'true'
;
if
(
shouldPublishFeatures
)
{
core
.
info
(
'Publishing features...'
);
const
featuresBasePath
=
core
.
getInput
(
'base-path-to-features'
);
yield
packageFeatures
(
featuresBasePath
);
}
if
(
shouldPublishTemplate
)
{
core
.
info
(
'Publishing template...'
);
const
basePathToDefinitions
=
core
.
getInput
(
'base-path-to-templates'
);
yield
packageTemplates
(
basePathToDefinitions
);
}
// TODO: Programatically add feature/template fino with relevant metadata for UX clients.
core
.
info
(
'Generation metadata file: devcontainer-collection.json'
);
yield
(
0
,
utils_1
.
addCollectionsMetadataFile
)();
});
}
function
packageFeatures
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
try
{
core
.
info
(
`Archiving all features in
${
basePath
}
`
);
yield
(
0
,
utils_1
.
getFeaturesAndPackage
)(
basePath
);
core
.
info
(
'Packaging features has finished.'
);
}
catch
(
error
)
{
if
(
error
instanceof
Error
)
core
.
setFailed
(
error
.
message
);
}
});
}
function
packageTemplates
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
try
{
core
.
info
(
`Archiving all templated in
${
basePath
}
`
);
yield
(
0
,
utils_1
.
getTemplatesAndPackage
)(
basePath
);
core
.
info
(
'Packaging templates has finished.'
);
}
catch
(
error
)
{
if
(
error
instanceof
Error
)
core
.
setFailed
(
error
.
message
);
}
});
}
// Kick off execution
run
();
.github/devcontainers-action/lib/utils.js
0 → 100644
View file @
3b55d6e9
"use strict"
;
var
__createBinding
=
(
this
&&
this
.
__createBinding
)
||
(
Object
.
create
?
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
Object
.
defineProperty
(
o
,
k2
,
{
enumerable
:
true
,
get
:
function
()
{
return
m
[
k
];
}
});
})
:
(
function
(
o
,
m
,
k
,
k2
)
{
if
(
k2
===
undefined
)
k2
=
k
;
o
[
k2
]
=
m
[
k
];
}));
var
__setModuleDefault
=
(
this
&&
this
.
__setModuleDefault
)
||
(
Object
.
create
?
(
function
(
o
,
v
)
{
Object
.
defineProperty
(
o
,
"default"
,
{
enumerable
:
true
,
value
:
v
});
})
:
function
(
o
,
v
)
{
o
[
"default"
]
=
v
;
});
var
__importStar
=
(
this
&&
this
.
__importStar
)
||
function
(
mod
)
{
if
(
mod
&&
mod
.
__esModule
)
return
mod
;
var
result
=
{};
if
(
mod
!=
null
)
for
(
var
k
in
mod
)
if
(
k
!==
"default"
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
mod
,
k
))
__createBinding
(
result
,
mod
,
k
);
__setModuleDefault
(
result
,
mod
);
return
result
;
};
var
__awaiter
=
(
this
&&
this
.
__awaiter
)
||
function
(
thisArg
,
_arguments
,
P
,
generator
)
{
function
adopt
(
value
)
{
return
value
instanceof
P
?
value
:
new
P
(
function
(
resolve
)
{
resolve
(
value
);
});
}
return
new
(
P
||
(
P
=
Promise
))(
function
(
resolve
,
reject
)
{
function
fulfilled
(
value
)
{
try
{
step
(
generator
.
next
(
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
rejected
(
value
)
{
try
{
step
(
generator
[
"throw"
](
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
step
(
result
)
{
result
.
done
?
resolve
(
result
.
value
)
:
adopt
(
result
.
value
).
then
(
fulfilled
,
rejected
);
}
step
((
generator
=
generator
.
apply
(
thisArg
,
_arguments
||
[])).
next
());
});
};
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"default"
:
mod
};
};
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
getTemplatesAndPackage
=
exports
.
getFeaturesAndPackage
=
exports
.
addCollectionsMetadataFile
=
exports
.
tarDirectory
=
exports
.
renameLocal
=
exports
.
mkdirLocal
=
exports
.
writeLocalFile
=
exports
.
readLocalFile
=
void
0
;
const
github
=
__importStar
(
require
(
"@actions/github"
));
const
tar
=
__importStar
(
require
(
"tar"
));
const
fs
=
__importStar
(
require
(
"fs"
));
const
core
=
__importStar
(
require
(
"@actions/core"
));
const
util_1
=
require
(
"util"
);
const
path_1
=
__importDefault
(
require
(
"path"
));
exports
.
readLocalFile
=
(
0
,
util_1
.
promisify
)(
fs
.
readFile
);
exports
.
writeLocalFile
=
(
0
,
util_1
.
promisify
)(
fs
.
writeFile
);
exports
.
mkdirLocal
=
(
0
,
util_1
.
promisify
)(
fs
.
mkdir
);
exports
.
renameLocal
=
(
0
,
util_1
.
promisify
)(
fs
.
rename
);
// Filter what gets included in the tar.c
const
filter
=
(
file
,
_
)
=>
{
// Don't include the archive itself.
if
(
file
===
'./devcontainer-features.tgz'
)
{
return
false
;
}
return
true
;
};
function
tarDirectory
(
path
,
tgzName
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
return
tar
.
create
({
file
:
tgzName
,
C
:
path
,
filter
},
[
'.'
]).
then
(
_
=>
{
core
.
info
(
`Compressed
${
path
}
directory to file
${
tgzName
}
`
);
});
});
}
exports
.
tarDirectory
=
tarDirectory
;
function
addCollectionsMetadataFile
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
const
p
=
path_1
.
default
.
join
(
'.'
,
'devcontainer-collection.json'
);
// Insert github repo metadata
const
ref
=
github
.
context
.
ref
;
let
sourceInformation
=
{
source
:
'github'
,
owner
:
github
.
context
.
repo
.
owner
,
repo
:
github
.
context
.
repo
.
repo
,
ref
,
sha
:
github
.
context
.
sha
};
// Add tag if parseable
if
(
ref
.
includes
(
'refs/tags/'
))
{
const
tag
=
ref
.
replace
(
'refs/tags/'
,
''
);
sourceInformation
=
Object
.
assign
(
Object
.
assign
({},
sourceInformation
),
{
tag
});
}
const
metadata
=
{
sourceInformation
,
features
:
[],
templates
:
[]
};
// Write to the file
yield
(
0
,
exports
.
writeLocalFile
)(
p
,
JSON
.
stringify
(
metadata
,
undefined
,
4
));
});
}
exports
.
addCollectionsMetadataFile
=
addCollectionsMetadataFile
;
function
getFeaturesAndPackage
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
let
archives
=
[];
fs
.
readdir
(
basePath
,
(
err
,
files
)
=>
{
if
(
err
)
{
core
.
error
(
err
.
message
);
core
.
setFailed
(
`failed to get list of features:
${
err
.
message
}
`
);
return
;
}
files
.
forEach
(
file
=>
{
core
.
info
(
`feature ==>
${
file
}
`
);
if
(
file
!==
'.'
&&
file
!==
'..'
)
{
const
archiveName
=
`
${
file
}
.tgz`
;
tarDirectory
(
`
${
basePath
}
/
${
file
}
`
,
archiveName
);
archives
.
push
(
archiveName
);
}
});
});
return
archives
;
});
}
exports
.
getFeaturesAndPackage
=
getFeaturesAndPackage
;
function
getTemplatesAndPackage
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
let
archives
=
[];
fs
.
readdir
(
basePath
,
(
err
,
files
)
=>
{
if
(
err
)
{
core
.
error
(
err
.
message
);
core
.
setFailed
(
`failed to get list of templates:
${
err
.
message
}
`
);
return
;
}
files
.
forEach
(
file
=>
{
core
.
info
(
`template ==>
${
file
}
`
);
if
(
file
!==
'.'
&&
file
!==
'..'
)
{
const
archiveName
=
`devcontainer-definition-
${
file
}
.tgz`
;
tarDirectory
(
`
${
basePath
}
/
${
file
}
`
,
archiveName
);
archives
.
push
(
archiveName
);
}
});
});
return
archives
;
});
}
exports
.
getTemplatesAndPackage
=
getTemplatesAndPackage
;
.github/devcontainers-action/sync-action.sh
0 → 100755
View file @
3b55d6e9
#!/bin/bash
# Temporary!
pushd
/workspaces/features/.github/devcontainers-action
rm
./action.yml
rm
-rf
./dist
rm
-rf
./lib
cp
/home/codespace/action/action.yml ./action.yml
cp
-r
/home/codespace/action/dist ./dist
cp
-r
/home/codespace/action/lib ./lib
\ No newline at end of file
.github/workflows/release-v1.yaml
View file @
3b55d6e9
...
@@ -2,7 +2,7 @@ name: "Package dev container features (v1)"
...
@@ -2,7 +2,7 @@ name: "Package dev container features (v1)"
on
:
on
:
push
:
push
:
tags
:
tags
:
-
"
v
*
"
-
"
v
0.0.1
"
workflow_dispatch
:
workflow_dispatch
:
jobs
:
jobs
:
...
...
.github/workflows/release.yaml
0 → 100644
View file @
3b55d6e9
name
:
"
Release
dev
container
features
(v2)"
on
:
push
:
tags
:
-
"
v0.0.2"
# Temporary
workflow_dispatch
:
jobs
:
deploy
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Generate tgz
uses
:
./.github/devcontainers-action
# devcontainers/action
with
:
publish-features
:
"
true"
base-path-to-features
:
"
./src"
-
name
:
Get or Create Release at current tag
uses
:
ncipollo/release-action@v1
with
:
allowUpdates
:
true
# Lets us upload our own artifact from previous step
artifactErrorsFailBuild
:
true
artifacts
:
"
./*.tgz"
token
:
${{ secrets.GITHUB_TOKEN }}
.gitignore
0 → 100644
View file @
3b55d6e9
workspace.code-workspace
\ No newline at end of file
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