Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Container Library
DNS-over-HTTPS
Commits
65b219c7
Unverified
Commit
65b219c7
authored
Mar 28, 2019
by
Sheogorath
Browse files
Add CI chain and image deployment
parent
b0ffe51b
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
65b219c7
image
:
quay.io/sheogorath/ubuntu-ci:18.04
services
:
-
docker:dind
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master
:
stage
:
build
variables
:
DOCKER_HOST
:
"
tcp://docker:2375"
DOH_VERSION
:
"
2.0.1"
script
:
-
docker build --pull --build-arg VERSION="$DOH_VERSION" -t "doh:testing" .
-
./tools/tagging.sh "$CI_REGISTRY_IMAGE" "${DOH_VERSION:-latest}" ""
-
docker images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | xargs -L 1 docker push
only
:
-
master
tags
:
-
docker
build
:
stage
:
build
variables
:
DOCKER_HOST
:
"
tcp://docker:2375"
script
:
-
docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except
:
-
master
tags
:
-
docker
Dockerfile
View file @
65b219c7
FROM
golang
ARG
VERSION=master
RUN
true
\
&&
git clone https://github.com/m13253/dns-over-https.git
\
&&
git clone https://github.com/m13253/dns-over-https.git
--depth
1
-b
"
$VERSION
"
\
&&
cd
dns-over-https
\
&&
make
\
&&
true
...
...
tools/tagging.sh
0 → 100755
View file @
65b219c7
#!/bin/sh
if
[
"
$1
"
=
"--help"
]
;
then
echo
"
Usage of
$0
:
$0
<PREFIX> <VERSION> <SUFFIX>
Example:
$0
doh 2.0.24 alpine
"
fi
PREFIX
=
${
1
:-
doh
}
VERSION
=
${
2
}
[
"
${
3
}
"
!=
""
]
&&
[
"
${
3
}
"
!=
"debian"
]
&&
SUFFIX
=
"-
${
3
}
"
if
[
"
$VERSION
"
!=
""
]
;
then
docker tag doh:testing
"
$PREFIX
:
$(
echo
"
${
VERSION
}
"
|
sed
-e
's/^v//'
|
cut
-d
.
-f1
)
${
SUFFIX
}
"
docker tag doh:testing
"
$PREFIX
:
$(
echo
"
${
VERSION
}
"
|
sed
-e
's/^v//'
|
cut
-d
.
-f1-2
)
${
SUFFIX
}
"
docker tag doh:testing
"
$PREFIX
:
$(
echo
"
${
VERSION
}
"
|
sed
-e
's/^v//'
|
cut
-d
.
-f1-3
)
${
SUFFIX
}
"
docker tag doh:testing
"
$PREFIX
:
$(
echo
"
${
VERSION
}
"
|
sed
-e
's/^v//'
|
cut
-d
.
-f1-4
)
${
SUFFIX
}
"
[
"
$SUFFIX
"
=
""
]
&&
docker tag doh:testing
"
$PREFIX
:latest"
else
echo
"No version provided. Skipping tagging..."
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment