Commit 6f9bc67f authored by Nikos Psaromanolakis's avatar Nikos Psaromanolakis
Browse files

Initial public release

parents
Loading
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+14 −0
Original line number Diff line number Diff line
node_modules
.next
build
dist
.git
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
 No newline at end of file

.eslintrc.json

0 → 100644
+16 −0
Original line number Diff line number Diff line
{
  "extends": [
    "next",
    "next/core-web-vitals",
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "plugins": ["react", "@typescript-eslint"],
  "parserOptions": {
    "ecmaVersion": 2021,
    "sourceType": "module"
  },
  "rules": {}
}

.gitignore

0 → 100644
+43 −0
Original line number Diff line number Diff line
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# IntelliJ
.idea
*.ipr
*.iml
*.iws
# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.history
 No newline at end of file

.gitlab-ci.yml

0 → 100644
+147 −0
Original line number Diff line number Diff line
stages:
  - dev_image_build
  - dev_deploy
  - dev_workflows
  - release
  - image_build

#default:
#  image: registry.ubitech.eu/nsit/maestro-apps/golang:latest

variables:
  DOCKER_HOST: tcp://docker:2375
  DOCKER_TLS_CERTDIR: ''
  DOCKER_DRIVER: overlay2
  #DEPLOYMENT_SERVER_USER: "nsit"
  #DEPLOYMENT_SERVER_IP: "192.168.5.44"
  DEPLOYMENT_SERVER_IP: '192.168.5.185'
  DEPLOYMENT_SERVER_USER: 'ubuntu'
  IMAGE_NAME: 'maestro-portal'
  TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: 'registry.ubitech.eu/nsit/maestro-apps'
  TESTCONTAINERS_CHECKS_DISABLE: 'true'
 

dev_image_build_job:
  stage: dev_image_build
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
      command: ['--tls=false']
      alias: docker
  before_script:
    - docker info > /dev/null
  script:
    - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
    - docker buildx build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA .
    - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}')
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

dev_deploy_job:
  stage: dev_deploy
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/python-argocd:3.9
    pull_policy: [always, if-not-present]
  before_script:
    - git clone --depth 1 --branch gitops-cd https://oauth2:$INSTALLER_TOKEN@$INSTALLER_REPO
    - cd $INSTALLER_PATH


  script:
    - python3 scripts/helm_update.py $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $DEV_TMF_API_IMAGE $DEV_SONATA_OSS_IMAGE $DEV_SONATA_CORE_IMAGE $DEV_ZTC_CLIENT_IMAGE $DEV_PORTAL_CART_IMAGE $DEV_TELEMETRY_IMAGE $DEV_PEERING_IMAGE $DEV_REGISTRY_IMAGE $DEV_FABRIC_IMAGE
    - git add .
    - git config --global user.email "avalantasis@ubitech.eu"
    - git config --global user.name "avalantasis"
    - |
      if git commit -m "Update values.yaml for GitOps CD [skip ci]"; then 
        git push origin gitops-cd 
      else
        echo "No changes to commit."
      fi
    - |
      set -e
      argocd login "$ARGOCD_SERVER" --username "$ARGOCD_USERNAME" --password "$ARGOCD_PASSWORD" --insecure
      argocd app get hypo --refresh >/dev/null
      argocd app wait hypo --sync --health --timeout 120
      echo "Argo CD application 'hypo' is synced and healthy."
  dependencies:
     - dev_image_build_job
  rules:
     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'



#dev_workflows_job:
#  stage: dev_workflows
#  image:
#    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
#  services:
#    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
#      command: ['--tls=false']
#      alias: docker
#  before_script:
#    - docker info > /dev/null
#    - apk update && apk add git
#    - git clone https://oauth2:$COLLECTION_TOKEN@gitlab.ubitech.eu/maestro-v2/io.maestro.cd/io.maestro.cd.collections.git
#    - cp io.maestro.cd.collections/files/collection.json .
#    - cp io.maestro.cd.collections/files/env.json .
#    - echo "$MAESTRO_APPS_TOKEN" | docker login $MAESTRO_APPS_REGISTRY -u $MAESTRO_APPS_USER --password-stdin
#  script:
#    #- sleep 120
#    - ls -l
#    - docker run -v $(pwd):/etc/newman -t registry.ubitech.eu/nsit/maestro-apps/postman/newman:latest run /etc/newman/collection.json --environment /etc/newman/env.json
#  dependencies:
#    - dev_deploy_job
#  rules:
#    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

semantic_versioning_job:
  image: registry.ubitech.eu/nsit/maestro-apps/node:lts
  stage: release
  variables:
    GITLAB_TOKEN: $GROUP_ACCESS_TOKEN
  script:
    - RELEASE_VERSION=$(npx -y
      -p @semantic-release/commit-analyzer@9.0.2
      -p @semantic-release/git@10.0.1
      -p @semantic-release/gitlab@9.5.0
      -p @semantic-release/release-notes-generator@10.0.3
      -p @semantic-release/exec@6.0.3
      -p @semantic-release/changelog@6.0.2
      -p conventional-changelog-conventionalcommits@5.0.0
      -p semantic-release@19.0.5
      semantic-release | grep -oP '(?<=Published release ).*' | awk '{print $1}' || echo "no-release" )
    - echo "$RELEASE_VERSION" > release_version.txt
    - cat release_version.txt
  artifacts:
    paths:
      - release_version.txt
  only:
    - main

image_build_job:
  stage: image_build
  image:
    name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16
  services:
    - name: registry.ubitech.eu/nsit/maestro-apps/docker:20.10.16-dind
      command: ['--tls=false']
      alias: docker
  before_script:
    - docker info > /dev/null
    - RELEASE_VERSION=$(cat release_version.txt)
    - echo  $RELEASE_VERSION
    - if [ "$RELEASE_VERSION" = "no-release" ]; then exit 0; fi
  script:
    - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
    - docker buildx build -t $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest .
    - IMAGE_ID=$(docker images | grep $CI_REGISTRY/$CI_PROJECT_PATH\/$IMAGE_NAME | awk '{print $3}')
    - docker tag $IMAGE_ID $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:latest
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/$IMAGE_NAME:$RELEASE_VERSION
  only:
    - main
  dependencies:
    - semantic_versioning_job

.prettierignore

0 → 100644
+6 −0
Original line number Diff line number Diff line
node_modules
.next
build
dist
public
package-lock.json
 No newline at end of file
Loading