New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert admin to use same test/lint standard as the main pipelines #682
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
--- | ||
platform: linux | ||
|
||
image_resource: | ||
type: registry-image | ||
source: | ||
repository: cybojenix/govwifi-concourse-runner | ||
|
||
inputs: | ||
- name: govwifi-admin | ||
- name: mysql-image | ||
- name: nginx-image | ||
- name: ruby-image | ||
- name: govwifi-admin-prebuilt | ||
- name: src | ||
- name: docker-cache/mysql-image | ||
- name: docker-cache/nginx-image | ||
- name: docker-cache/ruby-image | ||
- name: docker-cache/app-prebuilt | ||
|
||
params: | ||
USE_CONCOURSE_COMPOSE: true | ||
ON_CONCOURSE: true | ||
|
||
run: | ||
path: govwifi-admin/ci/tasks/scripts/lint.sh | ||
path: src/ci/tasks/scripts/lint.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
--- | ||
platform: linux | ||
|
||
image_resource: | ||
type: registry-image | ||
source: | ||
repository: cybojenix/govwifi-concourse-runner | ||
|
||
inputs: | ||
- name: govwifi-admin | ||
- name: mysql-image | ||
- name: nginx-image | ||
- name: ruby-image | ||
- name: src | ||
- name: docker-cache/mysql-image | ||
- name: docker-cache/nginx-image | ||
- name: docker-cache/ruby-image | ||
|
||
outputs: | ||
- name: govwifi-admin-prebuilt | ||
# aligns with PREBUILT_TAG | ||
- name: docker-cache/app-prebuilt | ||
|
||
caches: | ||
- path: govwifi-admin-prebuilt-cached | ||
- path: docker-cache/app-prebuilt-cached | ||
|
||
params: | ||
USE_CONCOURSE_COMPOSE: true | ||
# Expose that we're using Concourse | ||
ON_CONCOURSE: true | ||
# Set this to custom image names for preloading the app image. see `docker-compose.concourse.yml` | ||
PREBUILT_TAG: 'app-prebuilt' | ||
PREBUILT_CACHED_DIR: 'docker-cache/app-prebuilt-cached' | ||
|
||
run: | ||
path: govwifi-admin/ci/tasks/scripts/pre-build.sh | ||
path: src/ci/tasks/scripts/pre-build.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -v -e -u -o pipefail | ||
set -e -u -o pipefail | ||
|
||
./govwifi-admin/ci/tasks/scripts/with-docker.sh | ||
./src/ci/tasks/scripts/with-docker.sh | ||
|
||
cd govwifi-admin | ||
workspace_dir="${PWD}" | ||
cd src | ||
|
||
make lint | ||
|
||
cd "${workspace_dir}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -v -e -u -o pipefail | ||
set -e -u -o pipefail | ||
|
||
./govwifi-admin/ci/tasks/scripts/with-docker.sh | ||
./src/ci/tasks/scripts/with-docker.sh | ||
|
||
cd govwifi-admin | ||
|
||
[[ -f "../govwifi-admin-prebuilt-cached/image.tar" ]] && docker load -qi "../govwifi-admin-prebuilt-cached/image.tar" | ||
workspace_dir="${PWD}" | ||
prebuilt_dir="${workspace_dir}/docker-cache/${PREBUILT_TAG}" | ||
prebuilt_cached_dir="${workspace_dir}/${PREBUILT_CACHED_DIR}" | ||
|
||
cd src | ||
|
||
make prebuild | ||
docker tag "$(docker-compose images -q app)" "govwifi-admin-app-prebuilt" | ||
docker save "govwifi-admin-app-prebuilt" -o "../govwifi-admin-prebuilt/image.tar" | ||
cp "../govwifi-admin-prebuilt/image.tar" "../govwifi-admin-prebuilt-cached/image.tar" | ||
docker tag "$(docker-compose images -q app)" "${PREBUILT_TAG}" | ||
docker save "${PREBUILT_TAG}" -o "${prebuilt_dir}/image.tar" | ||
cp "${prebuilt_dir}/image.tar" "${prebuilt_cached_dir}/image.tar" | ||
|
||
cd "${workspace_dir}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -v -e -u -o pipefail | ||
set -e -u -o pipefail | ||
|
||
./govwifi-admin/ci/tasks/scripts/with-docker.sh | ||
./src/ci/tasks/scripts/with-docker.sh | ||
|
||
cd govwifi-admin | ||
workspace_dir="${PWD}" | ||
cd src | ||
|
||
make test | ||
|
||
cd / | ||
cd "${workspace_dir}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,28 @@ | |
|
||
set -e -u -o pipefail | ||
|
||
# Launches the docker daemon, and loads our cached images from the `docker-cache` folder. | ||
|
||
source /docker-helpers.sh | ||
start_docker | ||
|
||
function load_layers() { | ||
|
||
# don't do anything if we don't have cache | ||
[[ ! -d 'docker-cache' ]] && return 0; | ||
[[ -z "$(ls docker-cache/*/image.tar)" ]] && return 0; | ||
|
||
echo "loading docker layer cache" | ||
pids= | ||
docker load -qi mysql-image/image.tar & pids[0]=$! | ||
docker load -qi nginx-image/image.tar & pids[1]=$! | ||
docker load -qi ruby-image/image.tar & pids[2]=$! | ||
[[ -f "govwifi-admin-prebuilt/image.tar" ]] && docker load -qi "govwifi-admin-prebuilt/image.tar" & pids[3]=$! | ||
|
||
index=0 | ||
for cached_image in docker-cache/*/image.tar; do | ||
docker load -qi "${cached_image}" & pids[${index}]=$! | ||
index="$(( "${index}" + 1 ))" | ||
done | ||
|
||
for pid in ${pids[*]}; do | ||
wait "$pid" || true # we don't care about the return code of docker loading | ||
wait "$pid" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity, we now care about the return code of docker loading? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, explanation for this one. This occurred when the cache wasn't populated, and relates to the old line 14.
The adding With the move to globbing, the only issues we'll get are ones we want to raise |
||
done | ||
} | ||
load_layers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
--- | ||
platform: linux | ||
|
||
image_resource: | ||
type: registry-image | ||
source: | ||
repository: cybojenix/govwifi-concourse-runner | ||
|
||
inputs: | ||
- name: govwifi-admin | ||
- name: mysql-image | ||
- name: nginx-image | ||
- name: ruby-image | ||
- name: govwifi-admin-prebuilt | ||
- name: src | ||
- name: docker-cache/mysql-image | ||
- name: docker-cache/nginx-image | ||
- name: docker-cache/ruby-image | ||
- name: docker-cache/app-prebuilt | ||
|
||
params: | ||
USE_CONCOURSE_COMPOSE: true | ||
ON_CONCOURSE: true | ||
|
||
run: | ||
path: govwifi-admin/ci/tasks/scripts/test.sh | ||
path: src/ci/tasks/scripts/test.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need Nginx? Pretty sure we just use Puma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used by the
fake-register
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes ok