Skip to content

Commit

Permalink
INIT Container Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Vad1mo committed Nov 20, 2023
1 parent d85ebd7 commit eedb827
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 1 deletion.
94 changes: 94 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
image: docker:stable

services:
- docker:dind

variables:
GIT_DEPTH: "1"
DOCKER_DRIVER: "overlay2"
DOCKER_TLS_CERTDIR: ""
DOCKER_BUILDKIT: "1"
REGISTRY_DOMAIN: "8gears.container-registry.com"

before_script:
- apk add --purge --no-cache make bash git docker-compose curl
- mkdir -p $HOME/.docker/
- echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
stages:
- build

build-portal:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_PORTAL: "${REGISTRY_DOMAIN}/container-registry/harbor-portal"
script:
- export VERSIONTAG=$(cat ./VERSION)
- mv setting-container-registry.json src/portal/src/setting.json
- cp -a container-registry-logo.svg src/portal/src/images/
- make build -e BUILDTARGET="_build_prepare _build_portal" -e BASEIMAGETAG="$VERSIONTAG" -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_PORTAL="$DOCKERIMAGENAME_PORTAL"
- docker push "${DOCKERIMAGENAME_PORTAL}:${VERSIONTAG}"

build-portal-advantest:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_PORTAL: "${REGISTRY_DOMAIN}/container-registry/harbor-portal"
NG_BUILD_ARGS: '--prod --base-href /admin-console/ --deploy-url /admin-console/'
script:
- export VERSIONTAG="$(cat ./VERSION)-advantest"
- mv setting-advantest.json src/portal/src/setting.json
- cp -a advantest-logo.svg src/portal/src/images/
- make build -e BUILDTARGET="_build_prepare _build_portal" -e BASEIMAGETAG=$(cat ./VERSION) -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_PORTAL="$DOCKERIMAGENAME_PORTAL"
- docker push "${DOCKERIMAGENAME_PORTAL}:${VERSIONTAG}"

build-core:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_CORE: "${REGISTRY_DOMAIN}/container-registry/harbor-core"
script:
- export VERSIONTAG=$(cat ./VERSION)
#- make update_prepare_version check_environment versions_prepare compile_core DEVFLAG="false" BASEIMAGETAG="$VERSIONTAG" VERSIONTAG="$VERSIONTAG"
#- make -f make/photon/Makefile _build_core BASEIMAGETAG="$VERSIONTAG" DOCKERIMAGENAME_CORE="$DOCKERIMAGENAME_CORE" VERSIONTAG="$VERSIONTAG"
- make versions_prepare compile_core build -e BUILDTARGET="_build_prepare _build_core" -e BASEIMAGETAG="$VERSIONTAG" -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_CORE="$DOCKERIMAGENAME_CORE"
- docker push "${DOCKERIMAGENAME_CORE}:${VERSIONTAG}"

build-registry:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_REG: "${REGISTRY_DOMAIN}/container-registry/registry-photon"
script:
- export VERSIONTAG=$(cat ./VERSION)
- make versions_prepare build -e BUILDTARGET="_build_prepare _build_registry" -e BASEIMAGETAG="$VERSIONTAG" -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_REG="$DOCKERIMAGENAME_REG"
- docker push "${DOCKERIMAGENAME_REG}:${VERSIONTAG}"
allow_failure: true

build-jobservice:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_JOBSERVICE: "${REGISTRY_DOMAIN}/container-registry/harbor-jobservice"
script:
- export VERSIONTAG=$(cat ./VERSION)
#- echo "$CR_REGISTRY_PASS" | docker login -u "$CR_REGISTRY_USER" --password-stdin c8n.io
#- make check_environment versions_prepare compile_jobservice DEVFLAG="false" BASEIMAGETAG="$VERSIONTAG" VERSIONTAG="$VERSIONTAG"
- make versions_prepare compile_jobservice build -e BUILDTARGET="_build_prepare _build_jobservice" -e BASEIMAGETAG="$VERSIONTAG" -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_JOBSERVICE="$DOCKERIMAGENAME_JOBSERVICE"
- docker push "$DOCKERIMAGENAME_JOBSERVICE":"$VERSIONTAG"

build-exporter:
stage: build
only:
- /^cr/.*/ # regular expression
variables:
DOCKERIMAGENAME_EXPORTER: "${REGISTRY_DOMAIN}/container-registry/harbor-exporter"
script:
- export VERSIONTAG=$(cat ./VERSION)
- make versions_prepare build -e BUILDTARGET="_build_prepare _compile_and_build_exporter" -e BASEIMAGETAG="$VERSIONTAG" -e DEVFLAG=false -e VERSIONTAG=$VERSIONTAG -e DOCKERIMAGENAME_EXPORTER="$DOCKERIMAGENAME_EXPORTER"
- docker push "${DOCKERIMAGENAME_EXPORTER}:${VERSIONTAG}"
19 changes: 19 additions & 0 deletions advantest-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions container-registry-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions setting-advantest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"headerBgColor": {
"darkMode": "",
"lightMode": ""
},
"loginBgImg": "",
"loginTitle": "Advantest Container Registry",
"product": {
"name": "Container Registry",
"logo": "advantest-logo.svg",
"introduction": "8gears Container Registry is a Harbor-based container registry as a service offered and operated by the project's maintainer and contributors. Harbor is a CNCF-graded open-source container registry for securely managing container images and other OCI artifacts with policies, role-based access control, vulnerability scanning, and signing."
}
}
13 changes: 13 additions & 0 deletions setting-container-registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"headerBgColor": {
"darkMode": "",
"lightMode": ""
},
"loginBgImg": "",
"loginTitle": "Container Registry",
"product": {
"name": "Container Registry",
"logo": "container-registry-logo.svg",
"introduction": "8gears Container Registry is a Harbor-based container registry as a service offered and operated by the project's maintainer and contributors. Harbor is a CNCF-graded open-source container registry for securely managing container images and other OCI artifacts with policies, role-based access control, vulnerability scanning, and signing."
}
}
2 changes: 1 addition & 1 deletion src/portal/src/app/account/sign-in/sign-in.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h4 class="m-0">
}">
<a
rel="noopener noreferrer"
href="https://github.com/goharbor/harbor"
href="https://container-registry.com/"
target="_blank"
>{{ 'BUTTON.MORE_INFO' | translate }}</a
>
Expand Down

0 comments on commit eedb827

Please sign in to comment.