mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
moved deployscripts, checkout code on workflow, new upgrade script
This commit is contained in:
parent
afc96fec88
commit
dfc8db74d6
7
.github/workflows/publish-branded.yml
vendored
7
.github/workflows/publish-branded.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
- name: Build branded images
|
||||
run: |
|
||||
deployment/build-branded-images.sh
|
||||
deployment/scripts/build-branded-images.sh
|
||||
docker save "ocelotsocialnetwork/backend-branded" > /tmp/backend-branded.tar
|
||||
docker save "ocelotsocialnetwork/webapp-branded" > /tmp/webapp-branded.tar
|
||||
docker save "ocelotsocialnetwork/maintenance-branded" > /tmp/maintenance-branded.tar
|
||||
@ -46,6 +46,9 @@ jobs:
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Download Docker Image (Backend)
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
@ -71,7 +74,7 @@ jobs:
|
||||
run: docker load < /tmp/maintenance-branded.tar
|
||||
|
||||
- name: Upload to dockerhub
|
||||
run: deployment/upload-branded-images.sh
|
||||
run: deployment/scripts/upload-branded-images.sh
|
||||
# - name: login to dockerhub
|
||||
# run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
|
||||
#
|
||||
|
||||
@ -12,7 +12,7 @@ SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
DOCKERHUB_ORGANISATION=${DOCKERHUB_ORGANISATION:-"ocelotsocialnetwork"}
|
||||
OCELOT_VERSION=${OCELOT_VERSION:-$(node -p -e "require('${SCRIPT_DIR}/../package.json').version")}
|
||||
OCELOT_VERSION=${OCELOT_VERSION:-$(node -p -e "require('${SCRIPT_DIR}/../../package.json').version")}
|
||||
BRANDED_VERSION=${BRANDED_VERSION:-${GITHUB_RUN_NUMBER:-"local"}}
|
||||
BUILD_DATE=${BUILD_DATE:-$(date -u +'%Y-%m-%dT%H:%M:%SZ')}
|
||||
BUILD_VERSION=${BRANDED_VERSION}-ocelot.social${OCELOT_VERSION}
|
||||
@ -23,30 +23,30 @@ docker build --target branded \
|
||||
-t "${DOCKERHUB_ORGANISATION}/backend-branded:latest" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/backend-branded:${OCELOT_VERSION}" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/backend-branded:${BUILD_VERSION}" \
|
||||
-f "${SCRIPT_DIR}/src/docker/backend.Dockerfile" \
|
||||
-f "${SCRIPT_DIR}/../src/docker/backend.Dockerfile" \
|
||||
--build-arg "CONFIGURATION=${CONFIGURATION}" \
|
||||
--build-arg "APP_IMAGE_TAG_CODE=${OCELOT_VERSION}-code" \
|
||||
--build-arg "APP_IMAGE_TAG_BASE=${OCELOT_VERSION}-base" \
|
||||
"${SCRIPT_DIR}/."
|
||||
"${SCRIPT_DIR}/../."
|
||||
|
||||
# webapp
|
||||
docker build --target branded \
|
||||
-t "${DOCKERHUB_ORGANISATION}/webapp-branded:latest" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/webapp-branded:${OCELOT_VERSION}" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/webapp-branded:${BUILD_VERSION}" \
|
||||
-f "${SCRIPT_DIR}/src/docker/webapp.Dockerfile" \
|
||||
-f "${SCRIPT_DIR}/../src/docker/webapp.Dockerfile" \
|
||||
--build-arg "CONFIGURATION=${CONFIGURATION}" \
|
||||
--build-arg "APP_IMAGE_TAG_CODE=${OCELOT_VERSION}-code" \
|
||||
--build-arg "APP_IMAGE_TAG_BASE=${OCELOT_VERSION}-base" \
|
||||
"${SCRIPT_DIR}/."
|
||||
"${SCRIPT_DIR}/../."
|
||||
|
||||
# mainteance
|
||||
docker build --target branded \
|
||||
-t "${DOCKERHUB_ORGANISATION}/maintenance-branded:latest" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/maintenance-branded:${OCELOT_VERSION}" \
|
||||
-t "${DOCKERHUB_ORGANISATION}/maintenance-branded:${BUILD_VERSION}" \
|
||||
-f "${SCRIPT_DIR}/src/docker/maintenance.Dockerfile" \
|
||||
-f "${SCRIPT_DIR}/../src/docker/maintenance.Dockerfile" \
|
||||
--build-arg "CONFIGURATION=${CONFIGURATION}" \
|
||||
--build-arg "APP_IMAGE_TAG_CODE=${OCELOT_VERSION}-code" \
|
||||
--build-arg "APP_IMAGE_TAG_BASE=${OCELOT_VERSION}-base" \
|
||||
"${SCRIPT_DIR}/."
|
||||
"${SCRIPT_DIR}/../."
|
||||
16
deployment/scripts/upgrade.sh
Normal file
16
deployment/scripts/upgrade.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yml}
|
||||
VALUES=${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubenertes/values.yaml
|
||||
|
||||
# constants
|
||||
CHART=${SCRIPT_DIR}/../src/kubernetes/Chart.yaml
|
||||
|
||||
# upgrade with helm
|
||||
helm --kubeconfig=... upgrade ocelot --values ${VALUES} ${CHART}
|
||||
@ -12,7 +12,7 @@ SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
# configuration
|
||||
DOCKERHUB_ORGANISATION=${DOCKERHUB_ORGANISATION:-"ocelotsocialnetwork"}
|
||||
OCELOT_VERSION=${OCELOT_VERSION:-$(node -p -e "require('${SCRIPT_DIR}/../package.json').version")}
|
||||
OCELOT_VERSION=${OCELOT_VERSION:-$(node -p -e "require('${SCRIPT_DIR}/../../package.json').version")}
|
||||
BRANDED_VERSION=${BRANDED_VERSION:-${GITHUB_RUN_NUMBER:-"local"}}
|
||||
BUILD_VERSION=${BRANDED_VERSION}-ocelot.social${OCELOT_VERSION}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user