Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
run: |
docker compose build
GIT_BRANCH='refs/tags/0.0.0' docker buildx bake
14 changes: 2 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
def version=""
pipeline {
agent any

environment {
API_PORT='1313'
WS_PORT='9002'
}

stages {
stage('Push Image to Docker Registry') {
steps {
script {

withDockerRegistry(url: 'https://registry.onlinedi.vision:5000', credentialsId:'docker-registry') {
version="v" + sh(script:'echo ${GIT_BRANCH} | cut -d/ -f3- | xargs echo -n', returnStdout: true)
echo "VERSION TO BE DEPLOYED: $version"
sh "docker build . -t od-official-server:${version} --build-context 'bare-repo=test-env-compose/rootfs/repo'"
sh "docker tag od-official-server:${version} registry.onlinedi.vision:5000/od-official-server:${version}"
sh "docker push registry.onlinedi.vision:5000/od-official-server:${version}"
sh "docker buildx bake --set release.output=\"type=registry\""
}
}
}
}
stage ('Deploying to K8S') {
def version="v" + sh(script:'echo ${GIT_BRANCH} | cut -d/ -f3- | xargs echo -n', returnStdout: true)
steps {
build job: 'PROD/K8S-INFRA/DEPLOY', parameters: [[$class: 'StringParameterValue', name: 'DEPLOYMENT', value: 'od-official-server'], [$class: 'StringParameterValue', name: 'NEW_VERSION', value: version]]
}
Expand Down
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ For more in depth analysis of what it does please either check out the code of `

The "Test Env" sets up some random credentials (such as keys for encryption, and so on...). To have better control of what the keys are you can edit `launch-test-env.sh`, specifically these lines:
```sh
export SALT_ENCRYPTION_IV="ffA_1D6s^jf!6\$xx"
export SALT_ENCRYPTION_KEY='#a1aA3!h4a@ah3a4'
export SALT_ENCRYPTION_IV="FFFFFFFFFFFFFFFF"
export SALT_ENCRYPTION_KEY='aaaaaaaaaaaaaaaa'
export SCYLLA_CASSANDRA_PASSWORD='cassandra'
export API_PORT=1313
export NO_OF_WORKERS=32
Expand All @@ -36,3 +36,19 @@ These being the lines that set up the necessary environment variables for `od-of

Please checkout [CONTRIBUTING.md](./CONTRIBUTING.md) and [TESTING.md](./TESTING.md).

## Building server images with docker bake

To simply build a local server image you can run the following command:
```sh
GIT_BRANCH="refs/tags/1.2.3" docker buildx bake --set release.output="type=docker"
```

If you'd like to publish this image to the registry you can use:
```sh
GIT_BRANCH="refs/tags/1.2.3" docker buildx bake --set release.output="type=registry"
```

> ![WARNING]
> `GIT_BRANCH` is the ref to the tag in git. Whatever you set it to will be used
> to tag the image you create. For example `GIT_BRANCH="refs/tags/1.2.3` will tag
> your image as `registry.onlinedi.vision:5000/od-official-server:v1.2.3`.
21 changes: 0 additions & 21 deletions compose.ci.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions compose.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
variable "GIT_BRANCH" {}

group "default" {
targets = [ "release" ]
}

function "tag" {
params = [ branch ]
result = "v${split("/", branch)[2]}"
}

target "release" {
target = "runtime"
contexts = {
bare-repo = "test-env-compose/rootfs/repo"
}
args = {
GIT_BRANCH = "${GIT_BRANCH}"
}
output = [ "type=cacheonly" ]
tags = [ "registry.onlinedi.vision:5000/od-official-server:${tag("${GIT_BRANCH}")}" ]
}
Loading