From f21916cd3d348a3e002d0e50204fd50b54f72f26 Mon Sep 17 00:00:00 2001 From: Tracey Jaquith Date: Tue, 31 Dec 2024 03:49:55 +0000 Subject: [PATCH] gitlab => github updates --- README.md | 10 +++++----- build.sh | 2 +- deploy.sh | 2 +- gitlab.yml | 10 +++++----- project.nomad | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2e2ee5e..229a1ff 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Code, setup, and information to: [[_TOC_]] -# Overview +# GitLab Overview Deployment leverages a simple `.gitlab-ci.yml` using GitLab runners & CI/CD ([build] and [test]); then switches to custom [deploy] phase to deploy docker containers into `nomad`. @@ -46,7 +46,7 @@ test: - cd /app # or wherever in your image - npm test # or whatever your test scripts/steps are ``` -- [optional] you can _instead_ copy [the included file](.gitlab-ci.yml) and customize/extend it. +- [optional] you can _instead_ copy [the included file](gitlab.yml) and customize/extend it. - [optional] you can copy this [project.nomad](project.nomad) file into your repo top level and customize/extend it if desired - _... but there's a good chance you won't need to_ 😎 @@ -78,7 +78,7 @@ NOMAD_VAR_VOLUMES ``` - See the top of [project.nomad](project.nomad) - Our customizations always prefix with `NOMAD_VAR_`. -- You can simply insert them, with values, in your project's `.gitlab-ci.yml` file before including _our_ `.gitlab-ci.yml` like above. +- You can simply insert them, with values, in your project's `.gitlab-ci.yml` file before including _our_ [gitlab.yml](gitlab.yml) like above. - Examples 👇 #### Don't actually deploy containers to nomad Perhaps your project just wants to leverage the CI (Continuous Integration) for [buil] and/or [test] steps - but not CD (Continuous Deployment). An example might be a back-end container that runs elsewhere and doesn't have web listener. @@ -283,7 +283,7 @@ Setting up your repo to deploy to ext is easy! - `brew install nomad` - `source $HOME/.config/nomad` - better yet: - - `git clone https://gitlab.com/internetarchive/nomad` + - `git clone https://github.com/internetarchive/nomad` - adjust next line depending on where you checked out the above repo - add this to your `$HOME/.bash_profile` or `$HOME/.zshrc` etc. - `FI=$HOME/nomad/aliases && [ -e $FI ] && source $FI` @@ -404,7 +404,7 @@ variables: NOMAD_VAR_COUNT_CANARIES: 0 include: - - remote: 'https://gitlab.com/internetarchive/nomad/-/raw/master/.gitlab-ci.yml' + - remote: 'https://raw.githubusercontent.com/internetarchive/nomad/refs/heads/main/gitlab.yml' ``` `vars.nomad`: ```ini diff --git a/build.sh b/build.sh index 5cc1bcc..91c6608 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ # Wondering how to do podman-in-podman? Of course we are. Here's a minimal example: # # SOCK=$(sudo podman info |grep -F podman.sock |rev |cut -f1 -d ' ' |rev) -# podman run --rm --privileged --net=host --cgroupns=host -v $SOCK:$SOCK registry.gitlab.com/internetarchive/nomad/master zsh -c 'podman --remote ps -a' +# podman run --rm --privileged --net=host --cgroupns=host -v $SOCK:$SOCK ghcr.io/internetarchive/nomad:main zsh -c 'podman --remote ps -a' set -o pipefail diff --git a/deploy.sh b/deploy.sh index c430a3d..e070683 100755 --- a/deploy.sh +++ b/deploy.sh @@ -184,7 +184,7 @@ function main() { cp "$REPODIR/project.nomad" project.nomad else rm -f project.nomad - wget -q https://gitlab.com/internetarchive/nomad/-/raw/master/project.nomad + wget -q https://raw.githubusercontent.com/internetarchive/nomad/refs/heads/main/project.nomad fi verbose "Replacing variables internal to project.nomad." diff --git a/gitlab.yml b/gitlab.yml index c2ace58..1f16090 100644 --- a/gitlab.yml +++ b/gitlab.yml @@ -9,7 +9,7 @@ # NOTE: very first pipeline, the [build] below will make sure this is created -image: registry.gitlab.com/internetarchive/nomad/master +image: ghcr.io/internetarchive/nomad:main stages: - build @@ -23,9 +23,9 @@ build: # https://gitlab.com/gitlab-org/gitlab/-/raw/master/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml stage: build # If need to rebuild this image while runners are down, `cd` to this directory, then, as root: - # podman login registry.gitlab.com - # podman build --net=host --tag registry.gitlab.com/internetarchive/nomad/master . && sudo podman push registry.gitlab.com/internetarchive/nomad/master - image: registry.gitlab.com/internetarchive/nomad/master + # podman login ghcr.io + # podman build --net=host --tag ghcr.io/internetarchive/nomad:main . && sudo podman push ghcr.io/internetarchive/nomad:main + image: ghcr.io/internetarchive/nomad:main variables: DOCKER_HOST: 'unix:///run/podman/podman.sock' DOCKER_TLS_CERTDIR: '' @@ -53,7 +53,7 @@ test-ourself: deploy: stage: deploy script: - # https://gitlab.com/internetarchive/nomad/-/blob/master/deploy.sh + # https://github.com/internetarchive/nomad/blob/main/deploy.sh - /deploy.sh environment: name: $CI_COMMIT_REF_SLUG diff --git a/project.nomad b/project.nomad index 2ff454b..986a47f 100644 --- a/project.nomad +++ b/project.nomad @@ -16,7 +16,7 @@ variables { CI_REGISTRY_READ_TOKEN = "" # preferred name - # This autogenerates from https://gitlab.com/internetarchive/nomad/-/blob/master/.gitlab-ci.yml + # This autogenerates from https://github.com/internetarchive/nomad/blob/main/gitlab.yml # & normally has "-$CI_COMMIT_REF_SLUG" appended, but is omitted for "main" or "master" branches. # You should not change this. SLUG = "internetarchive-bai" @@ -107,7 +107,7 @@ variable "PORTS" { } variable "HOSTNAMES" { - # This autogenerates from https://gitlab.com/internetarchive/nomad/-/blob/master/.gitlab-ci.yml + # This autogenerates from https://github.com/internetarchive/nomad/blob/main/gitlab.yml # but you can override to 1 or more custom hostnames if desired, eg: # NOMAD_VAR_HOSTNAMES='["www.example.com", "site.example.com"]' type = list(string)