Skip to content

Commit f17c2bf

Browse files
authored
Sort devfile versions in descending order (#144)
* Added automatic sort of devfile versions Signed-off-by: Paul Schultz <[email protected]> * added gitattributes Signed-off-by: Paul Schultz <[email protected]> * added execute permissions Signed-off-by: Paul Schultz <[email protected]> * added explicit use of bash when executing scripts Signed-off-by: Paul Schultz <[email protected]> * fixed tests Signed-off-by: Paul Schultz <[email protected]> Signed-off-by: Paul Schultz <[email protected]>
1 parent 343c4c5 commit f17c2bf

File tree

66 files changed

+1344
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1344
-601
lines changed

.gitattributes

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# source code
2+
*.php eol=lf
3+
*.css eol=lf
4+
*.sass eol=lf
5+
*.scss eol=lf
6+
*.less eol=lf
7+
*.styl eol=lf
8+
*.js eol=lf
9+
*.ts eol=lf
10+
*.jsx eol=lf
11+
*.tsx eol=lf
12+
*.coffee eol=lf
13+
*.json eol=lf
14+
*.htm eol=lf
15+
*.html eol=lf
16+
*.xml eol=lf
17+
*.svg eol=lf
18+
*.txt eol=lf
19+
*.ini eol=lf
20+
*.inc eol=lf
21+
*.pl eol=lf
22+
*.rb eol=lf
23+
*.py eol=lf
24+
*.scm eol=lf
25+
*.sql eol=lf
26+
*.sh eol=lf
27+
*.bat eol=lf
28+
*.go eol=lf
29+
30+
# templates
31+
*.ejs eol=lf
32+
*.hbt eol=lf
33+
*.jade eol=lf
34+
*.haml eol=lf
35+
*.hbs eol=lf
36+
*.dot eol=lf
37+
*.tmpl eol=lf
38+
*.phtml eol=lf
39+
40+
# server config
41+
.htaccess eol=lf
42+
43+
# git config
44+
.gitattributes eol=lf
45+
.gitignore eol=lf
46+
.gitconfig eol=lf
47+
48+
# code analysis config
49+
.jshintrc eol=lf
50+
.jscsrc eol=lf
51+
.jshintignore eol=lf
52+
.csslintrc eol=lf
53+
54+
# misc config
55+
*.yaml eol=lf
56+
*.yml eol=lf
57+
.editorconfig eol=lf
58+
59+
# build config
60+
*.npmignore eol=lf
61+
*.bowerrc eol=lf
62+
63+
# Heroku
64+
Procfile eol=lf
65+
.slugignore eol=lf
66+
67+
# Documentation
68+
*.md eol=lf
69+
LICENSE eol=lf
70+
AUTHORS eol=lf
71+
72+
#
73+
## These files are binary and should be left untouched
74+
#
75+
76+
# (binary is a macro for -eol=lf -diff)
77+
*.png binary
78+
*.jpg binary
79+
*.jpeg binary
80+
*.gif binary
81+
*.ico binary
82+
*.mov binary
83+
*.mp4 binary
84+
*.mp3 binary
85+
*.flv binary
86+
*.fla binary
87+
*.swf binary
88+
*.gz binary
89+
*.zip binary
90+
*.7z binary
91+
*.ttf binary
92+
*.eot binary
93+
*.woff binary
94+
*.pyc binary
95+
*.pdf binary

.github/workflows/ci.yaml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,101 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
go:
1111
name: Check go tools build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Check out code
15-
uses: actions/checkout@v2
14+
- name: Check out code
15+
uses: actions/checkout@v2
1616

17-
- name: Setup Go environment
18-
uses: actions/setup-go@v2
19-
with:
20-
go-version: 1.17
17+
- name: Setup Go environment
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.17
2121

22-
- name: Check if index-generator build is working
23-
run: cd index/generator && ./build.sh
22+
- name: Check if index-generator build is working
23+
run: cd index/generator && bash ./build.sh
2424

25-
- name: Test index-generator
26-
run: cd index/generator && go test ./...
25+
- name: Test index-generator
26+
run: cd index/generator && go test ./...
27+
28+
- name: Check if registry-library build is working
29+
run: cd registry-library && bash ./build.sh
2730

28-
- name: Check if registry-library build is working
29-
run: cd registry-library && ./build.sh
30-
3131
docker:
3232
name: Check docker builds
3333
runs-on: ubuntu-latest
3434
steps:
35-
- name: Check out code
36-
uses: actions/checkout@v2
35+
- name: Check out code
36+
uses: actions/checkout@v2
37+
38+
- name: Check license
39+
run: |
40+
export PATH=$PATH:$(go env GOPATH)/bin
41+
go install github.com/google/addlicense@latest
42+
git reset HEAD --hard
43+
bash ./check_licenses.sh
44+
if [[ $? != 0 ]]
45+
then
46+
echo "license headers not found:"
47+
git --no-pager diff
48+
exit 1
49+
fi
3750
38-
- name: Check license
39-
run: |
40-
export PATH=$PATH:$(go env GOPATH)/bin
41-
go install github.com/google/addlicense@latest
42-
git reset HEAD --hard
43-
./check_licenses.sh
44-
if [[ $? != 0 ]]
45-
then
46-
echo "license headers not found:"
47-
git --no-pager diff
48-
exit 1
49-
fi
51+
- name: Check if index server build is working
52+
run: cd index/server && bash ./build.sh
5053

51-
- name: Check if index server build is working
52-
run: cd index/server && ./build.sh
54+
- name: Test index server
55+
run: cd index/server && go test ./... -coverprofile cover.out
5356

54-
- name: Test index server
55-
run: cd index/server && go test ./... -coverprofile cover.out
57+
- name: Check if oci server build is working
58+
run: cd oci-registry && bash ./build.sh
5659

57-
- name: Check if oci server build is working
58-
run: cd oci-registry && ./build.sh
59-
60-
- name: Check if devfile-registry-integration build is working
61-
run: cd tests/integration && ./docker-build.sh
60+
- name: Check if devfile-registry-integration build is working
61+
run: cd tests/integration && bash ./docker-build.sh
6262

63-
- name: Upload coverage to Codecov
64-
uses: codecov/[email protected]
63+
- name: Upload coverage to Codecov
64+
uses: codecov/[email protected]
6565

6666
test_minikube:
6767
name: Test Devfile Registry
6868
runs-on: ubuntu-latest
6969
steps:
70-
- name: Checkout
71-
uses: actions/checkout@v1
72-
- name: Setup Go environment
73-
uses: actions/setup-go@v2
74-
with:
75-
go-version: 1.17
76-
- name: Setup Minikube
77-
uses: manusa/[email protected]
78-
with:
79-
minikube version: 'v1.21.0'
80-
kubernetes version: 'v1.21.0'
81-
driver: 'docker'
82-
github token: ${{ secrets.GITHUB_TOKEN }}
83-
start args: '--addons=ingress'
84-
- name: Run the devfile registry integration tests
85-
run: .ci/run_tests_minikube_linux.sh
70+
- name: Checkout
71+
uses: actions/checkout@v1
72+
- name: Setup Go environment
73+
uses: actions/setup-go@v2
74+
with:
75+
go-version: 1.17
76+
- name: Setup Minikube
77+
uses: manusa/[email protected]
78+
with:
79+
minikube version: 'v1.21.0'
80+
kubernetes version: 'v1.21.0'
81+
driver: 'docker'
82+
github token: ${{ secrets.GITHUB_TOKEN }}
83+
start args: '--addons=ingress'
84+
- name: Run the devfile registry integration tests
85+
run: bash .ci/run_tests_minikube_linux.sh
8686

8787
test_staging:
8888
name: Test Staging Devfile Registry
8989
runs-on: ubuntu-latest
9090
steps:
91-
- name: Checkout
92-
uses: actions/checkout@v1
93-
- name: Setup Go environment
94-
uses: actions/setup-go@v2
95-
with:
96-
go-version: 1.17
97-
- name: Run the devfile registry integration tests
98-
run: |
99-
# Run the integration tests
100-
cd tests/integration
101-
./docker-build.sh
102-
docker run --env REGISTRY=https://registry.stage.devfile.io --env IS_TEST_REGISTRY=false devfile-registry-integration
91+
- name: Checkout
92+
uses: actions/checkout@v1
93+
- name: Setup Go environment
94+
uses: actions/setup-go@v2
95+
with:
96+
go-version: 1.17
97+
- name: Run the devfile registry integration tests
98+
run: |
99+
# Run the integration tests
100+
cd tests/integration
101+
bash ./docker-build.sh
102+
docker run --env REGISTRY=https://registry.stage.devfile.io --env IS_TEST_REGISTRY=false devfile-registry-integration

.github/workflows/pushimage-next.yaml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ name: Next Dockerimage
1717

1818
on:
1919
push:
20-
branches: [ main ]
20+
branches: [main]
2121
repository_dispatch:
2222
types: [build]
2323

2424
jobs:
2525
indexServerBuild:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Check out registry support source code
29-
uses: actions/checkout@v2
30-
- name: Login to Quay
31-
uses: docker/login-action@v1
32-
with:
33-
registry: quay.io
34-
username: ${{ secrets.QUAY_USERNAME }}
35-
password: ${{ secrets.QUAY_PASSWORD }}
36-
- name: Build the index server base image
37-
run: cd index/server && ./build.sh
38-
- name: Push the index server base image
39-
run: cd index/server && ./push.sh quay.io/devfile/devfile-index-base:next
28+
- name: Check out registry support source code
29+
uses: actions/checkout@v2
30+
- name: Login to Quay
31+
uses: docker/login-action@v1
32+
with:
33+
registry: quay.io
34+
username: ${{ secrets.QUAY_USERNAME }}
35+
password: ${{ secrets.QUAY_PASSWORD }}
36+
- name: Build the index server base image
37+
run: cd index/server && bash ./build.sh
38+
- name: Push the index server base image
39+
run: cd index/server && bash ./push.sh quay.io/devfile/devfile-index-base:next
4040

4141
dispatch:
4242
needs: indexServerBuild
@@ -57,7 +57,7 @@ jobs:
5757
else
5858
echo ::set-output name=repo::$(echo ${{ github.event.client_payload.repo }})
5959
fi
60-
60+
6161
# Check if commit sha is not set in the client payload
6262
# If it's not set, the triggered commit came from this repo (registry-support)
6363
# If it is set, the triggered commit came from registry-viewer
@@ -79,32 +79,32 @@ jobs:
7979
ociRegistryBuild:
8080
runs-on: ubuntu-latest
8181
steps:
82-
- name: Check out registry support source code
83-
uses: actions/checkout@v2
84-
- name: Build and push oci-registry docker image
85-
uses: docker/[email protected]
86-
with:
87-
path: ./oci-registry
88-
username: ${{ secrets.QUAY_USERNAME }}
89-
password: ${{ secrets.QUAY_PASSWORD }}
90-
registry: quay.io
91-
repository: devfile/oci-registry
92-
dockerfile: ./oci-registry/Dockerfile
93-
tags: next
94-
tag_with_sha: true
82+
- name: Check out registry support source code
83+
uses: actions/checkout@v2
84+
- name: Build and push oci-registry docker image
85+
uses: docker/[email protected]
86+
with:
87+
path: ./oci-registry
88+
username: ${{ secrets.QUAY_USERNAME }}
89+
password: ${{ secrets.QUAY_PASSWORD }}
90+
registry: quay.io
91+
repository: devfile/oci-registry
92+
dockerfile: ./oci-registry/Dockerfile
93+
tags: next
94+
tag_with_sha: true
9595

9696
devfileRegistryIntegrationBuild:
9797
runs-on: ubuntu-latest
9898
steps:
99-
- name: Check out registry support source code
100-
uses: actions/checkout@v2
101-
- name: Login to Quay
102-
uses: docker/login-action@v1
103-
with:
104-
registry: quay.io
105-
username: ${{ secrets.QUAY_USERNAME }}
106-
password: ${{ secrets.QUAY_PASSWORD }}
107-
- name: Build the index server base image
108-
run: cd tests/integration && ./docker-build.sh
109-
- name: Push the index server base image
110-
run: cd tests/integration && ./docker-push.sh quay.io/devfile/devfile-registry-integration:next
99+
- name: Check out registry support source code
100+
uses: actions/checkout@v2
101+
- name: Login to Quay
102+
uses: docker/login-action@v1
103+
with:
104+
registry: quay.io
105+
username: ${{ secrets.QUAY_USERNAME }}
106+
password: ${{ secrets.QUAY_PASSWORD }}
107+
- name: Build the index server base image
108+
run: cd tests/integration && bash ./docker-build.sh
109+
- name: Push the index server base image
110+
run: cd tests/integration && bash ./docker-push.sh quay.io/devfile/devfile-registry-integration:next

build-tools/dl_starter_projects.sh

100644100755
File mode changed.

build_registry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ set -eux
1212
. ./index/server/build.sh
1313

1414
# Build the test devfile registry image
15-
docker build -t devfile-index:latest -f .ci/Dockerfile .
15+
docker build -t devfile-index:latest -f .ci/Dockerfile .

index/generator/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de
88
github.com/go-git/go-git/v5 v5.4.2
99
github.com/mitchellh/go-homedir v1.1.0
10+
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249
1011
github.com/spf13/cobra v1.1.1
1112
github.com/spf13/viper v1.7.1
1213
github.com/stretchr/testify v1.7.0

0 commit comments

Comments
 (0)