Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Manager #33

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5a621d9
Added package-manager install; Added dependencies.json
MikeLauer Oct 24, 2022
0202663
Refactor; Added Comments; Added cleanup
MikeLauer Oct 24, 2022
7e543b5
Refactor
MikeLauer Oct 24, 2022
115166b
Added .lib to .gitignore
MikeLauer Oct 24, 2022
e1d4502
Added docs
MikeLauer Oct 24, 2022
252652a
Changed install: single packages can be install via cli; Added remove…
MikeLauer Oct 25, 2022
3b72e20
refactor
MikeLauer Oct 25, 2022
cc417e7
Changed dependency file format; Changed download method to git; Refac…
MikeLauer Oct 26, 2022
3756056
Refactor
MikeLauer Oct 26, 2022
3b9a6ac
Changed directory sync
MikeLauer Oct 31, 2022
a43ad69
Added purge command
MikeLauer Oct 31, 2022
99cc18a
Refactor
MikeLauer Oct 31, 2022
e754f68
Small docs fix
MikeLauer Oct 31, 2022
8d11c5b
Added recursion (changed install and purge)
MikeLauer Oct 31, 2022
69c4baa
refactor
MikeLauer Oct 31, 2022
49677ee
refactor
MikeLauer Oct 31, 2022
caac597
licenses fix (added 'BSD*')
MikeLauer Oct 31, 2022
1fdfc4f
style fix
MikeLauer Oct 31, 2022
a2135e5
deleted update file, it's included in install
MikeLauer Oct 31, 2022
b8db967
changed dependency file location to lib/sub-folders
MikeLauer Oct 31, 2022
5221ab9
refactor
milesstoetzner Nov 1, 2022
0b432e8
refactor
milesstoetzner Nov 1, 2022
0985a57
minor
milesstoetzner Nov 1, 2022
42aac6a
refactor
milesstoetzner Nov 2, 2022
ad1dbfa
minor
milesstoetzner Nov 2, 2022
053a021
Merge branch 'main' into feature/package-manager
milesstoetzner Nov 2, 2022
c957e91
refactor
milesstoetzner Nov 3, 2022
3d884d6
refactor
milesstoetzner Nov 5, 2022
9c07ae2
refactor
milesstoetzner Nov 5, 2022
2824372
refactor
milesstoetzner Nov 6, 2022
cf02d1e
refactor
milesstoetzner Nov 6, 2022
c08df08
refactor
milesstoetzner Nov 6, 2022
9dfbc5d
refactor
milesstoetzner Nov 6, 2022
af96f61
merge main
milesstoetzner Nov 11, 2022
57b4982
merge main
milesstoetzner Nov 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: yarn build

- name: (BUILD) Set Version
run: sed -i "s/__VERSION__/${GITHUB_SHA}/" build/cli/config.js
run: sed -i "s/__VERSION__/${GITHUB_SHA}/" build/utils/config.js

- name: (BUILD) Setup Packaging Cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: yarn build

- name: (BUILD) Set Version
run: sed -i "s/__VERSION__/${GITHUB_SHA}/" build/cli/config.js
run: sed -i "s/__VERSION__/${GITHUB_SHA}/" build/utils/config.js

- name: (BUILD) Setup Packaging Cache
uses: actions/cache@v3
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ dist

# tests
!tests/tmp/.gitkeep
tests/tmp
tests/tmp

# libs
lib
tmp
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN yarn test

# Build
RUN yarn build
RUN sed -i "s/__VERSION__/${GITHUB_SHA}/" build/cli/config.js
RUN sed -i "s/__VERSION__/${GITHUB_SHA}/" build/utils/config.js
RUN yarn package

# Docs
Expand Down
33 changes: 33 additions & 0 deletions clone-repo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Takes 7.755s

# Good
# - versions are treated the same

# Bad
# - versions not available

rm -rf cache-test
mkdir cache-test
cd cache-test

clone_package() {
echo -----------------------------------
echo
echo $1__$2__$4
echo
echo -----------------------------------

if [ ! -d "$1__$2" ]; then
# git clone --depth 1 $3 $1__$2
git clone $3 $1__$2
fi

cd $1__$2
git checkout $4
cd ..
}

clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library 1ee103e9c2910667448ff8af57157b11eab3530d
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library develop # only one that can be upgraded
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library config-nifi # only one that can be upgraded
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library v2.0.0
63 changes: 63 additions & 0 deletions clone-single.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Takes 6.439s

# Bad:
# - detect commit

# Good:
# - pull works everywhere
# - versions available

# Neutral:
# - duplication not bad since only one commit

# Notes:
# - detect branch by "git status -> On branch"

rm -rf cache-test
mkdir cache-test
cd cache-test

clone_package_commit() {
echo -----------------------------------
echo
echo $1__$2__$4
echo
echo -----------------------------------

mkdir $1__$2__$4
cd $1__$2__$4

git init
git remote add origin $3
git fetch --depth 1 origin $4
git checkout $4

cd ..
}

# can be pulled
clone_package_branch() {
echo -----------------------------------
echo
echo $1__$2__$4
echo
echo -----------------------------------

git clone --depth 1 --branch $4 $3 $1__$2__$4
}


clone_package_tag() {
echo -----------------------------------
echo
echo $1__$2__$4
echo
echo -----------------------------------

git clone --depth 1 --branch $4 $3 $1__$2__$4
}

clone_package_commit alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library 1ee103e9c2910667448ff8af57157b11eab3530d
clone_package_branch alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library develop
clone_package_branch alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library config-nifi
clone_package_tag alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library v2.0.0
29 changes: 29 additions & 0 deletions clone-tree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Takes 6.921s

rm -rf cache-test
mkdir cache-test
cd cache-test



clone_package() {
echo -----------------------------------
echo
echo $1__$2__$4
echo
echo -----------------------------------

if [ ! -d "$1__$2" ]; then
# git clone --depth 1 $3 $1__$2
git clone $3 $1__$2
fi

cd $1__$2
git worktree add --force --checkout ../$1__$2__$4 $4
cd ..
}

clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library 1ee103e9c2910667448ff8af57157b11eab3530d
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library develop # only one that can be upgraded
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library config-nifi # only one that can be upgraded
clone_package alien4cloud csar-public-library https://github.com/alien4cloud/csar-public-library v2.0.0
1 change: 1 addition & 0 deletions docs/cmds/licenses/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const LICENSES: {[key: string]: string} = {
'0BSD': 'https://opensource.org/licenses/0BSD',
'CC0-1.0': 'https://creativecommons.org/publicdomain/zero/1.0',
'CC-BY-3.0': 'https://creativecommons.org/licenses/by/3.0/',
'BSD*': '',
}

/**
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ This command is also executed during the `release` workflow and, therefore, over
## Build

To locally build the project, run the following command.
This will generate Javascript inside the `/build` directory.
This will generate JavaScript inside the `/build` directory.

```linenums="1"
yarn build
Expand All @@ -249,7 +249,7 @@ yarn build
{{ linux_only_notice() }}

To locally package the project, run the following command.
This will package the previously build Javascript using [`pkg`](https://github.com/vercel/pkg){target=_blank} and generate binaries inside the `/dist` directory.
This will package the previously build JavaScript using [`pkg`](https://github.com/vercel/pkg){target=_blank} and generate binaries inside the `/dist` directory.

```linenums="1"
yarn package
Expand All @@ -261,5 +261,5 @@ On pushes to the `main` branch, the `release` workflow is triggered.
This workflow runs several tests, builds and packages the project and creates a new release.
Thereby, an existing release and `latest` tag is deleted.
There is only one release at total.
During the workflow the string `__VERSION__` inside a Javascript file is replace with the current commit hash.
During the workflow the string `__VERSION__` inside a JavaScript file is replace with the current commit hash.
As a consequence, `vintner --version` returns the commit hash.
Loading