Skip to content

Commit

Permalink
updating dev-kube
Browse files Browse the repository at this point in the history
  • Loading branch information
popenc committed Jun 29, 2023
2 parents 256cfac + 8cba63b commit 627a4ec
Show file tree
Hide file tree
Showing 164 changed files with 17,940 additions and 42,313 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/docker-builds.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

name: Create and publish a Docker image

on:
push:
branches: ['dev-kube']
on: push

env:
REGISTRY: ghcr.io
FLASK_IMAGE: USEPA/cyanweb-api
MYSQL_IMAGE: USEPA/cyanweb-db
ANGULAR_IMAGE: USEPA/cyanweb-angular
NGINX_IMAGE: USEPA/cyanweb-nginx
REDIS_IMAGE: USEPA/cyanweb-redis

jobs:
build-api:
Expand Down Expand Up @@ -140,4 +139,35 @@ jobs:
file: docker/nginx/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-redis:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REDIS_IMAGE }}

- name: Build and push Cyanweb Redis Docker image
uses: docker/build-push-action@v2
with:
context: .
file: docker/redis/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ docker/flask/requirements.*
.vscode/

sk_*.txt

env.json
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
stages:
- Image Build

include:
- project: 'DSO/DASTScanner'
file: '.gitlab-ci.yml'
- remote: 'https://gitlab.com/prismacloud-public/shift-left/extension/-/raw/master/.pcs.gitlab-ci.yml'

CopyDevImages:
stage: Image Build
tags:
- qed-stg-runner
when: manual
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- mkdir -p /workspace
# Cyanweb Flask Image:
- echo "FROM ghcr.io/usepa/cyanweb-api:dev" > /workspace/Dockerfile
- /kaniko/executor --context=/workspace --destination=$CI_REGISTRY_IMAGE/cyanweb-api:$CI_COMMIT_REF_NAME
# Cyanweb Angular Image:
- echo "FROM ghcr.io/usepa/cyanweb-angular:dev" > /workspace/Dockerfile
- /kaniko/executor --context=/workspace --destination=$CI_REGISTRY_IMAGE/cyanweb-angular:$CI_COMMIT_REF_NAME
# Cyanweb MySQL Image:
- echo "FROM ghcr.io/usepa/cyanweb-db:dev" > /workspace/Dockerfile
- /kaniko/executor --context=/workspace --destination=$CI_REGISTRY_IMAGE/cyanweb-db:$CI_COMMIT_REF_NAME
8 changes: 6 additions & 2 deletions config/set_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import requests
import json
import socket
import os.path

# logger = logging.getLogger(__name__)
# logger.warning("EPA-Cyano-Web set_environment.py")
Expand All @@ -27,5 +28,8 @@ def __init__(self):

def load_deployment_environment(self):
# TODO: Load default .env if .env not found?
logging.warning("Loading env vars from: {}.".format(self.env_path))
load_dotenv(self.env_path) # loads env vars into environment
if os.path.exists(self.env_path):
logging.info("Loading env vars from: {}.".format(self.env_path))
load_dotenv(self.env_path) # loads env vars into environment
else:
logging.warning("Could not locate env var file: {}. Assuming env vars already set in enviornment.".format(self.env_path))
Loading

0 comments on commit 627a4ec

Please sign in to comment.