-
Notifications
You must be signed in to change notification settings - Fork 25
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
Gitlab #84
Gitlab #84
Changes from all commits
4f54aae
29e559a
c4c8e9f
ee69d31
71d33bc
85727e8
6484bc4
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
gitlab-dev: | ||
tags: | ||
- meao | ||
- gcp | ||
only: | ||
- gitlab | ||
variables: | ||
NAMESPACE: nucleus-dev | ||
script: | ||
- docker/bin/build_images.sh | ||
- docker/bin/push2dockerhub.sh | ||
- bin/update-config.sh | ||
|
||
master: | ||
tags: | ||
- meao | ||
- gcp | ||
only: | ||
- master | ||
variables: | ||
NAMESPACE: nucleus-dev | ||
script: | ||
- docker/bin/build_images.sh | ||
- docker/bin/push2dockerhub.sh | ||
- bin/update-config.sh | ||
|
||
stage: | ||
tags: | ||
- meao | ||
- gcp | ||
only: | ||
- stage | ||
variables: | ||
NAMESPACE: nucleus-stage | ||
script: | ||
- docker/bin/build_images.sh | ||
- docker/bin/push2dockerhub.sh | ||
- bin/update-config.sh | ||
|
||
prod: | ||
tags: | ||
- meao | ||
- gcp | ||
only: | ||
- prod | ||
variables: | ||
NAMESPACE: nucleus-prod | ||
script: | ||
- docker/bin/build_images.sh | ||
- docker/bin/push2dockerhub.sh | ||
- bin/update-config.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -ex | ||
# env vars: CLUSTER_NAME, CONFIG_BRANCH, CONFIG_REPO, NAMESPACE, DEPLOYMENT_YAML | ||
|
||
. ${BASH_SOURCE%/*}/../docker/bin/set_git_env_vars.sh # sets DOCKER_IMAGE_TAG | ||
pushd $(mktemp -d) | ||
git clone --depth=1 -b ${CONFIG_BRANCH:=master} ${CONFIG_REPO:=github-mozmar-robot:mozmeao/nucleus-config} nucleus-config | ||
cd nucleus-config | ||
|
||
set -u | ||
sed -i -e "s|image: .*|image: ${DOCKER_IMAGE_TAG}|" ${CLUSTER_NAME:=iowa-b}/${NAMESPACE:=nucleus-dev}/${DEPLOYMENT_YAML:=deploy.yaml} | ||
git add ${CLUSTER_NAME}/${NAMESPACE}/${DEPLOYMENT_YAML} | ||
git commit -m "set image to ${DOCKER_IMAGE_TAG} in ${CLUSTER_NAME}" || echo "nothing new to commit" | ||
git push | ||
popd |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,6 @@ function imageExists() { | |
return $? | ||
} | ||
|
||
function dockerRun() { | ||
env_file="$1" | ||
image_tag="mozorg/bedrock_${2}:${GIT_COMMIT}" | ||
cmd="$3" | ||
docker run --rm --user $(id -u) -v "$PWD:/app" --env-file "docker/envfiles/${env_file}.env" "$image_tag" bash -c "$cmd" | ||
} | ||
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. For my own edification, why do we no longer need this? |
||
|
||
if ! imageExists; then | ||
docker/bin/docker_build.sh --pull | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ set -ex | |
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source $BIN_DIR/set_git_env_vars.sh | ||
|
||
DOCKER_USERNAME="${DOCKER_USERNAME:-mozjenkins}" | ||
|
||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
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. Assuming these are now set in the cluster? 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. the credentials are stored on the runner instances and interactive login using a password from an env var is neither needed nor desired. |
||
|
||
# Push to docker hub | ||
docker push $DOCKER_IMAGE_TAG | ||
|
||
|
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.
Is there a reason we can't have these two combined (adding an entry in
only
)? Or are they just separated for now to call out that one is testing and will be deleted later?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.
as discussed on zoom, let's keep both jobs for now, and we can use the gitlab branch in the furture for testing new versions of .gitlab-ci.yml outside of the master branch.