Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
ac386f01e0 | |||
08ead4258f | |||
f930f3a6a7 | |||
b6d4a76c70 | |||
9a7ecd27e5 | |||
11b70b0ddf | |||
79f8cb5e0e | |||
3e1286b9ac | |||
a8ae886959 | |||
da1c977a62 | |||
b99b55a05b | |||
133bf0abe5 | |||
df260bbab9 | |||
080bd2bc48 | |||
a0032b8168 | |||
a09efd1125 | |||
4ce28c7979 | |||
415eaea56e | |||
bde4597dd9 | |||
80946d4f0c | |||
2155e886ef | |||
8b61a90b5f |
8
.gitignore
vendored
8
.gitignore
vendored
@ -8,12 +8,16 @@ pages/
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches and builds
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
|
||||
# custom
|
||||
# custom
|
||||
test
|
||||
|
@ -57,8 +57,8 @@ pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: pages
|
||||
script:
|
||||
- npmci command yarn global add npmpage
|
||||
- npmci command npmpage
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci command tsdoc
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
67
README.md
67
README.md
@ -1,67 +0,0 @@
|
||||
# npmdocker
|
||||
|
||||
develop npm modules cross platform with docker
|
||||
|
||||
## Availabililty
|
||||
|
||||
[](https://www.npmjs.com/package/npmdocker)
|
||||
[](https://GitLab.com/gitzone/npmdocker)
|
||||
[](https://github.com/gitzone/npmdocker)
|
||||
[](https://gitzone.gitlab.io/npmdocker/)
|
||||
|
||||
## Status for master
|
||||
|
||||
[](https://GitLab.com/gitzone/npmdocker/commits/master)
|
||||
[](https://GitLab.com/gitzone/npmdocker/commits/master)
|
||||
[](https://www.npmjs.com/package/npmdocker)
|
||||
[](https://david-dm.org/gitzonetools/npmdocker)
|
||||
[](https://www.bithound.io/github/gitzonetools/npmdocker/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/gitzonetools/npmdocker)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
### Why does this package exist?
|
||||
|
||||
Sometimes you want a clean and fresh linux environment everytime you test your package.
|
||||
Usually this is the default i CI, but locally behaviour tends to defer.
|
||||
|
||||
### Where does it work
|
||||
|
||||
The npmdocker package works in everywhere where the docker cli is available. e.g.:
|
||||
|
||||
* docker toolbox
|
||||
* native docker application
|
||||
* docker in docker
|
||||
* mounted docker.sock
|
||||
|
||||
### How do I use it?
|
||||
|
||||
create a npmextra.json in the project's root directory
|
||||
|
||||
```json
|
||||
{
|
||||
"npmdocker": {
|
||||
"baseImage": "hosttoday/ht-docker-node:npmts",
|
||||
"command": "npmci test stable",
|
||||
"dockerSock": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| option | description |
|
||||
| ----------- | ------------------------------------------------------------------------------------- |
|
||||
| baseImage | the base image that is the context for your project |
|
||||
| command | the cli command to run within the the project's directory inside the docker container |
|
||||
| dockersSock | wether or not the testcontainer will have access to the docker.sock of the host |
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://git.zone)
|
@ -1,6 +1,6 @@
|
||||
FROM hosttoday/ht-docker-node:npmci
|
||||
RUN yarn global add npmdocker
|
||||
RUN yarn global add @gitzone/tsdocker
|
||||
COPY ./ /workspace
|
||||
WORKDIR /workspace
|
||||
ENV CI=true
|
||||
CMD ["npmdocker","runinside"];
|
||||
CMD ["tsdocker","runinside"];
|
||||
|
28406
package-lock.json
generated
28406
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
42
package.json
42
package.json
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@gitzone/tsdocker",
|
||||
"version": "1.2.29",
|
||||
"version": "1.2.40",
|
||||
"private": false,
|
||||
"description": "develop npm modules cross platform with docker",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"bin": {
|
||||
"npmdocker": "cli.js"
|
||||
"tsdocker": "cli.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "(npm run clean && npm run setupCheck && npm run testStandard && npm run testSpeed)",
|
||||
@ -33,28 +33,28 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.11",
|
||||
"@gitzone/tsrun": "^1.2.6",
|
||||
"@gitzone/tstest": "^1.0.20",
|
||||
"@pushrocks/tapbundle": "^3.0.9",
|
||||
"@types/node": "^12.0.0",
|
||||
"tslint": "^5.16.0",
|
||||
"@gitzone/tsbuild": "^2.1.27",
|
||||
"@gitzone/tsrun": "^1.2.17",
|
||||
"@gitzone/tstest": "^1.0.57",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^16.10.1",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/npmextra": "^3.0.1",
|
||||
"@pushrocks/projectinfo": "^4.0.2",
|
||||
"@pushrocks/qenv": "^4.0.0",
|
||||
"@pushrocks/npmextra": "^3.0.9",
|
||||
"@pushrocks/projectinfo": "^4.0.5",
|
||||
"@pushrocks/qenv": "^4.0.10",
|
||||
"@pushrocks/smartanalytics": "^2.0.15",
|
||||
"@pushrocks/smartcli": "^3.0.7",
|
||||
"@pushrocks/smartfile": "^7.0.2",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartlog-destination-local": "^7.0.5",
|
||||
"@pushrocks/smartlog-source-ora": "^1.0.4",
|
||||
"@pushrocks/smartopen": "^1.0.8",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartshell": "^2.0.13",
|
||||
"@pushrocks/smartstring": "^3.0.10",
|
||||
"@types/shelljs": "^0.8.5"
|
||||
"@pushrocks/smartcli": "^3.0.14",
|
||||
"@pushrocks/smartfile": "^8.0.10",
|
||||
"@pushrocks/smartlog": "^2.0.44",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
||||
"@pushrocks/smartlog-source-ora": "^1.0.9",
|
||||
"@pushrocks/smartopen": "^1.0.22",
|
||||
"@pushrocks/smartpromise": "^3.1.6",
|
||||
"@pushrocks/smartshell": "^2.0.28",
|
||||
"@pushrocks/smartstring": "^3.0.24",
|
||||
"@types/shelljs": "^0.8.9"
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* smartanalytics:
|
||||
* We count executions of this tool to keep track which of our tools are really used.
|
||||
* This insight is used to plan spending our limited resources for improving them.
|
||||
* Any submitted analytics data is fully anonymized (no Ips or any other personal information is tracked).
|
||||
* Feel free to dig into the smartanalytics package, if you are interested in how it works.
|
||||
* Our privacy policy can be found here: https://lossless.gmbh/privacy.html
|
||||
* The privacy policy is also linked in the readme, so we hope this behaviour does not come as a surprise to you.
|
||||
* Have a nice day and regards
|
||||
* Your Open Source team at Lossless GmbH :)
|
||||
*/
|
||||
import * as smartanalytics from '@pushrocks/smartanalytics';
|
||||
const npmdockerAnalytics = new smartanalytics.Analytics({
|
||||
apiEndPoint: 'https://pubapi.lossless.one',
|
||||
appName: 'tsdocker',
|
||||
projectId: 'gitzone'
|
||||
});
|
||||
npmdockerAnalytics.recordEvent('npmtoolexecution', {
|
||||
somedata: 'somedata'
|
||||
});
|
@ -1,4 +1,3 @@
|
||||
import './analytics';
|
||||
import * as plugins from './tsdocker.plugins';
|
||||
import * as cli from './tsdocker.cli';
|
||||
|
||||
|
@ -11,7 +11,7 @@ const tsdockerCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
export let run = () => {
|
||||
tsdockerCli.standardTask().subscribe(async argvArg => {
|
||||
let configArg = await ConfigModule.run().then(DockerModule.run);
|
||||
const configArg = await ConfigModule.run().then(DockerModule.run);
|
||||
if (configArg.exitCode === 0) {
|
||||
logger.log('success', 'container ended all right!');
|
||||
} else {
|
||||
@ -68,7 +68,7 @@ export let run = () => {
|
||||
});
|
||||
logger.log('ok', 'Starting speedtest');
|
||||
await smartshellInstance.exec(
|
||||
`docker pull tianon/speedtest && docker run --rm tianon/speedtest`
|
||||
`docker pull tianon/speedtest && docker run --rm tianon/speedtest --accept-license --accept-gdpr`
|
||||
);
|
||||
});
|
||||
|
||||
@ -78,7 +78,9 @@ export let run = () => {
|
||||
});
|
||||
logger.log('ok', `Starting vscode in cwd ${paths.cwd}`);
|
||||
await smartshellInstance.execAndWaitForLine(
|
||||
`docker run -p 127.0.0.1:8443:8443 -v "${paths.cwd}:/home/coder/project" registry.gitlab.com/hosttoday/ht-docker-vscode --allow-http --no-auth`,
|
||||
`docker run -p 127.0.0.1:8443:8443 -v "${
|
||||
paths.cwd
|
||||
}:/home/coder/project" registry.gitlab.com/hosttoday/ht-docker-vscode --allow-http --no-auth`,
|
||||
/Connected to shared process/
|
||||
);
|
||||
await plugins.smartopen.openUrl('testing-vscode.git.zone:8443');
|
||||
|
@ -6,11 +6,11 @@ export interface IConfig {
|
||||
command: string;
|
||||
dockerSock: boolean;
|
||||
exitCode?: number;
|
||||
keyValueObject: any[];
|
||||
keyValueObject: {[key: string]: any};
|
||||
}
|
||||
|
||||
const getQenvKeyValueObject = async () => {
|
||||
let qenvKeyValueObjectArray: {[key: string]: string | number};
|
||||
let qenvKeyValueObjectArray: { [key: string]: string | number };
|
||||
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
|
||||
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObject;
|
||||
} else {
|
||||
@ -19,7 +19,7 @@ const getQenvKeyValueObject = async () => {
|
||||
return qenvKeyValueObjectArray;
|
||||
};
|
||||
|
||||
const buildConfig = async (qenvKeyValueObjectArg: {[key: string]: string | number}) => {
|
||||
const buildConfig = async (qenvKeyValueObjectArg: { [key: string]: string | number }) => {
|
||||
const npmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
||||
const config = npmextra.dataFor<IConfig>('npmdocker', {
|
||||
baseImage: 'hosttoday/ht-docker-node:npmdocker',
|
||||
|
Loading…
x
Reference in New Issue
Block a user