From 1027bc18e6c18e5bb485087e736c745c7ab79305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 14:39:57 +0200 Subject: [PATCH 1/8] Test example changes --- src/ralph/settings/dev.py | 2 ++ src/ralph/settings/prod.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/ralph/settings/dev.py b/src/ralph/settings/dev.py index 59f29824c3..8334931b4b 100644 --- a/src/ralph/settings/dev.py +++ b/src/ralph/settings/dev.py @@ -59,3 +59,5 @@ def only_true(request): 'function': 'DataCenterAssetAdmin.changelist_view' }, ] +ADMIN_SITE_HEADER = 'Ralph 3.14' +ADMIN_SITE_TITLE = 'Ralph 3.14' diff --git a/src/ralph/settings/prod.py b/src/ralph/settings/prod.py index b8bd309ca8..355741d9af 100644 --- a/src/ralph/settings/prod.py +++ b/src/ralph/settings/prod.py @@ -86,3 +86,6 @@ STATSD_GRAPHS_PREFIX = os.environ.get( 'STATSD_GRAPHS_PREFIX', 'ralph.graphs' ) + +ADMIN_SITE_HEADER = 'Ralph 3.14' +ADMIN_SITE_TITLE = 'Ralph 3.14' From 90e5d255a3bbca9747b7be50c9f17eba4e4138e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:12:29 +0200 Subject: [PATCH 2/8] Add workflow to build snapshot --- .github/workflows/publish-snapshot.yml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish-snapshot.yml diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 0000000000..565a1e008d --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,34 @@ +name: Publish snapshot + +on: + workflow_dispatch: + inputs: + branch: + description: 'For which branch build snapshot?' + required: true + +jobs: + publish: + + runs-on: ubuntu-latest + environment: ci + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.branch }} + - name: Publish docker snapshot + env: + RETRY_COUNT: 3 + run: | + docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }} + export RALPH_VERSION=$(shell ./get_version.sh show) + until [ "$RETRY_COUNT" -le 0 ] + do + make publish-docker-snapshot-image && break + RETRY_COUNT=$((RETRY_COUNT-1)) + echo "==== Publish docker failed. Remaining retries: $RETRY_COUNT ====" + done + docker logout From ee5bf4985b656f6d2d75e1a8ccc1b14764df54fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:19:45 +0200 Subject: [PATCH 3/8] Run on push --- .github/workflows/publish-snapshot.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 565a1e008d..69c4fe647a 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -1,11 +1,11 @@ name: Publish snapshot -on: - workflow_dispatch: - inputs: - branch: - description: 'For which branch build snapshot?' - required: true +on: [push] +# workflow_dispatch: +# inputs: +# branch: +# description: 'For which branch build snapshot?' +# required: true jobs: publish: @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - ref: ${{ github.event.inputs.branch }} +# ref: ${{ github.event.inputs.branch }} - name: Publish docker snapshot env: RETRY_COUNT: 3 From 947223d9faf405bde8c5a03c2b37fdfeb7b30771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:24:19 +0200 Subject: [PATCH 4/8] Add missing makefile target --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 2f0752c4c5..e600cb95b0 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,12 @@ publish-docker-image: build-docker-image docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(RALPH_VERSION) docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:latest +publish-docker-snapshot-image: build-snapshot-docker-image + echo $(version) + +# docker push $(DOCKER_REPO_NAME)/ralph:$(RALPH_VERSION) +# docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(RALPH_VERSION) + install-js: npm install ./node_modules/.bin/gulp From 64470cdb7154c99dc2d2baabc6f7157c34a5998e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:30:29 +0200 Subject: [PATCH 5/8] Test variables in Makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index e600cb95b0..344cd84867 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ build-docker-image: build-snapshot-docker-image: version = $(shell ./get_version.sh show) build-snapshot-docker-image: build-snapshot-package + echo $(version) docker build \ -f docker/Dockerfile-prod \ --build-arg RALPH_VERSION="$(version)" \ @@ -69,6 +70,7 @@ publish-docker-image: build-docker-image docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(RALPH_VERSION) docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:latest +publish-docker-snapshot-image: version = $(shell ./get_version.sh show) publish-docker-snapshot-image: build-snapshot-docker-image echo $(version) From f64cd8e7c9184daf6e15ff24ed467a52a3fb6f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:37:07 +0200 Subject: [PATCH 6/8] Fix makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 344cd84867..115ce8b164 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ build-docker-image: build-snapshot-docker-image: version = $(shell ./get_version.sh show) build-snapshot-docker-image: build-snapshot-package - echo $(version) + echo "$version" docker build \ -f docker/Dockerfile-prod \ --build-arg RALPH_VERSION="$(version)" \ @@ -72,10 +72,10 @@ publish-docker-image: build-docker-image publish-docker-snapshot-image: version = $(shell ./get_version.sh show) publish-docker-snapshot-image: build-snapshot-docker-image - echo $(version) + echo "$version" -# docker push $(DOCKER_REPO_NAME)/ralph:$(RALPH_VERSION) -# docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(RALPH_VERSION) +# docker push $(DOCKER_REPO_NAME)/ralph:$(version) +# docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(version) install-js: npm install From c5d8decf2f262aec822498bd1a3ea484fc3dee46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 15:47:20 +0200 Subject: [PATCH 7/8] Fix makefile --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 115ce8b164..5a5acfbe67 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ build-docker-image: build-snapshot-docker-image: version = $(shell ./get_version.sh show) build-snapshot-docker-image: build-snapshot-package - echo "$version" + echo "$(version)" docker build \ -f docker/Dockerfile-prod \ --build-arg RALPH_VERSION="$(version)" \ @@ -72,10 +72,8 @@ publish-docker-image: build-docker-image publish-docker-snapshot-image: version = $(shell ./get_version.sh show) publish-docker-snapshot-image: build-snapshot-docker-image - echo "$version" - -# docker push $(DOCKER_REPO_NAME)/ralph:$(version) -# docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(version) + docker push $(DOCKER_REPO_NAME)/ralph:$(version) + docker push $(DOCKER_REPO_NAME)/ralph-static-nginx:$(version) install-js: npm install From 86894001f2a8087b802a0171114f47bdc1e806d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulc?= Date: Wed, 8 May 2024 16:08:01 +0200 Subject: [PATCH 8/8] Clean up changes. Snapshots should work now --- .github/workflows/publish-snapshot.yml | 14 +++++++------- Makefile | 1 - src/ralph/settings/dev.py | 4 ++-- src/ralph/settings/prod.py | 3 --- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 69c4fe647a..565a1e008d 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -1,11 +1,11 @@ name: Publish snapshot -on: [push] -# workflow_dispatch: -# inputs: -# branch: -# description: 'For which branch build snapshot?' -# required: true +on: + workflow_dispatch: + inputs: + branch: + description: 'For which branch build snapshot?' + required: true jobs: publish: @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 -# ref: ${{ github.event.inputs.branch }} + ref: ${{ github.event.inputs.branch }} - name: Publish docker snapshot env: RETRY_COUNT: 3 diff --git a/Makefile b/Makefile index 5a5acfbe67..617686554c 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,6 @@ build-docker-image: build-snapshot-docker-image: version = $(shell ./get_version.sh show) build-snapshot-docker-image: build-snapshot-package - echo "$(version)" docker build \ -f docker/Dockerfile-prod \ --build-arg RALPH_VERSION="$(version)" \ diff --git a/src/ralph/settings/dev.py b/src/ralph/settings/dev.py index 8334931b4b..a8444a514d 100644 --- a/src/ralph/settings/dev.py +++ b/src/ralph/settings/dev.py @@ -59,5 +59,5 @@ def only_true(request): 'function': 'DataCenterAssetAdmin.changelist_view' }, ] -ADMIN_SITE_HEADER = 'Ralph 3.14' -ADMIN_SITE_TITLE = 'Ralph 3.14' +ADMIN_SITE_HEADER = 'Ralph DEV' +ADMIN_SITE_TITLE = 'Ralph DEV' diff --git a/src/ralph/settings/prod.py b/src/ralph/settings/prod.py index 355741d9af..b8bd309ca8 100644 --- a/src/ralph/settings/prod.py +++ b/src/ralph/settings/prod.py @@ -86,6 +86,3 @@ STATSD_GRAPHS_PREFIX = os.environ.get( 'STATSD_GRAPHS_PREFIX', 'ralph.graphs' ) - -ADMIN_SITE_HEADER = 'Ralph 3.14' -ADMIN_SITE_TITLE = 'Ralph 3.14'