Skip to content

Commit

Permalink
gitlab => github updates
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Dec 31, 2024
1 parent 1a5797d commit f21916c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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_ 😎

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
10 changes: 5 additions & 5 deletions gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: ''
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions project.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f21916c

Please sign in to comment.