Commit 7e7537d5 authored by Kostis Trantzas's avatar Kostis Trantzas Committed by João Capucho
Browse files

fix for #1: Adding CI configuration and fixing docker-compose for non-dev deployments

parent 07f91884
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+40 −0
Original line number Diff line number Diff line
include:
  - project: osl/code/org.etsi.osl.main
    ref: main
    file: 
      - ci-templates/default.yml
      - ci-templates/build.yml
    rules:
      - if: '$CI_COMMIT_REF_NAME == "main"'
  
  - project: osl/code/org.etsi.osl.main
    ref: develop
    file: 
      - ci-templates/default.yml
      - ci-templates/build.yml
    rules:
      - if: '$CI_COMMIT_REF_NAME == "develop"'

  - project: osl/code/org.etsi.osl.main
    ref: $CI_COMMIT_REF_NAME
    file: 
      - ci-templates/default.yml
      - ci-templates/build.yml
    rules:
      - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'

  - project: osl/code/org.etsi.osl.main
    ref: develop
    file: 
      - ci-templates/default.yml
      - ci-templates/build_unprotected.yml
    rules:
      - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && $CI_COMMIT_REF_PROTECTED == "false"'

maven_build:
  extends: .maven_build

docker_build:
  extends: .docker_build
  needs:
    - maven_build
+2 −0
Original line number Diff line number Diff line
FROM ibm-semeru-runtimes:open-17.0.7_7-jdk

RUN mkdir -p /opt/openslice/lib/

COPY target/secret-controller-0.1.0.jar /opt/openslice/lib/
CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/secret-controller-0.1.0.jar"]

ci_settings.xml

0 → 100644
+16 −0
Original line number Diff line number Diff line
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  <servers>
    <server>
      <id>gitlab-maven</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Job-Token</name>
            <value>${CI_JOB_TOKEN}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
  </servers>
</settings>
+37 −19
Original line number Diff line number Diff line
services:
  osl-secrets-controller:
    build:
      context: .
      dockerfile: Dockerfile
    image: labs.etsi.org:5050/osl/code/addons/org.etsi.osl.controllers.secrets:develop
    container_name: osl-secrets-controller
    restart: always
    profiles: ["dev", "prod"]
    environment:
      SPRING_ARTEMIS_BROKER_URL: tcp://anartemis:61616?jms.watchTopicAdvisories=false
      SPRING_ARTEMIS_USER: artemis
      SPRING_ARTEMIS_PASSWORD: artemis
      VAULT_URI: http://osl-vault:8200 
      VAULT_TOKEN: hvs.AAAAAAAAAAAA
      LOGGING_LEVEL_ORG_SPRINGFRAMEWORK: INFO
    logging:
      driver: "json-file"
      options:
        max-size: "250m"
        max-file: "2"       
    networks:
    -  compose_back


  vault:
    image: hashicorp/vault:2.0
    container_name: osl-vault
    image: hashicorp/vault:2.0
    restart: always
    profiles: ["dev"]
    command: server
    ports:
    - "8200:8200"
@@ -12,24 +38,13 @@ services:
    configs:
      - source: vault_config
        target: /vault/config/config.hcl

  osl-secrets-controller:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: osl-secrets-controller
    environment:
      SPRING_ARTEMIS_BROKER_URL: tcp://artemis:61616
      SPRING_ARTEMIS_USER: artemis
      SPRING_ARTEMIS_PASSWORD: password
      VAULT_URI: http://osl-vault:8200 
      VAULT_TOKEN: hvs.AAAAAAAAAAAA
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 10s
    logging:
      driver: "json-file"
      options:
        max-size: "200m"
        max-file: "3"
    networks:
    -  compose_back

volumes:
  vault_data:
@@ -50,3 +65,6 @@ configs:
        tls_disable = true
      }

networks:
  compose_back:
    external: true
 No newline at end of file