Skip to content

Commit

Permalink
Merge pull request #45 from firstBitMarksistskaya/nixel2007-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 authored Oct 1, 2024
2 parents 39d2f26 + 4e21eac commit 55e79c3
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 49 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
strategy:
fail-fast: false
matrix:
dir: [ 'jdk', 'oscript' ]
script: [ 'build-base-k8s-jenkins-agent.sh', 'build-base-swarm-jenkins-agent.sh', 'build-edt-swarm-agent.sh', 'build-oscript-k8s-agent.sh', 'build-oscript-swarm-agent.sh', 'build-server.sh' ]

steps:
- name: Checkout repository
Expand All @@ -25,5 +26,14 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Build Docker images
env:
DOCKER_REGISTRY_URL: 'localhost:5000'
DOCKER_LOGIN: ""
DOCKER_PASSWORD: ""
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME}}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD}}
ONEC_VERSION: '8.3.24.1624'
EDT_VERSION: '2023.3.6'
run: |
docker build -t oscript:latest -f ${{ matrix.dir }}/Dockerfile .
docker run -d -p 5000:5000 --name registry registry:2
./${{ matrix.script }}
17 changes: 12 additions & 5 deletions build-base-k8s-jenkins-agent.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

Expand Down
17 changes: 12 additions & 5 deletions build-base-swarm-jenkins-agent.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

Expand Down
17 changes: 12 additions & 5 deletions build-crs.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

Expand Down
21 changes: 14 additions & 7 deletions build-edt-k8s-agent.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
#!/usr/bin/env bash
set -eo pipefail

if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

edt_version=$EDT_VERSION
Expand Down
21 changes: 14 additions & 7 deletions build-edt-swarm-agent.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
#!/usr/bin/env bash
set -eo pipefail

if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

edt_version=$EDT_VERSION
Expand Down
19 changes: 13 additions & 6 deletions build-oscript-k8s-agent.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

docker build \
Expand Down
19 changes: 13 additions & 6 deletions build-oscript-swarm-agent.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
last_arg='--no-cache .'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

docker build \
Expand Down
17 changes: 12 additions & 5 deletions build-server.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
if [ -n "${DOCKER_LOGIN}" ] && [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY_URL}" ]; then
if ! docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY_URL}"; then
echo "Docker login failed"
exit 1
fi
else
echo "Skipping Docker login due to missing credentials"
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then
docker system prune -af
fi

last_arg='.'
if [ $NO_CACHE = 'true' ] ; then
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
fi

Expand Down

0 comments on commit 55e79c3

Please sign in to comment.