Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
252 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This can be built and pushed with | ||
# cat aur-checker-Dockerfile | docker build -t "drud/arch-aur-builder:latest" - && docker push "drud/arch-aur-builder:latest" | ||
# - Edit PKGBUILD to change the version and hash or anything else | ||
# - Then run it with | ||
# docker run --rm --mount type=bind,source=$(pwd),target=/tmp/ddev-bin --workdir=/tmp/ddev-bin drud/arch-aur-builder bash -c "makepkg --printsrcinfo > .SRCINFO && makepkg -s" | ||
# Then `git add -u` and commit and push | ||
FROM archlinux:latest | ||
RUN echo | pacman -Sy sudo binutils fakeroot docker docker-compose | ||
RUN useradd builder | ||
USER builder | ||
CMD bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
|
||
# Requires $AUR_SSH_PRIVATE_KEY, a private key in environment variable | ||
# This environment variable must be a single line, with \n replaced by "<SPLIT>" | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if [ -z "${AUR_SSH_PRIVATE_KEY:-}" ]; then | ||
printf "\$AUR_SSH_PRIVATE_KEY must be set in the environment. It should be a single line with \n replaced by <SPLIT>" && exit 101 | ||
fi | ||
if [ "$#" != "3" ]; then | ||
printf "Arguments: AUR_REPO (AUR repo ddev-bin or ddev-edge-bin) \nVERSION_NUMBER (like v1.14.2) \nARTIFACTS_DIR (like /home/circleci/artifacts)\n" && exit 102 | ||
fi | ||
|
||
# For testing, you can change GITHUB_USERNAME to, for example, rfay so releases can be tested | ||
# without bothering people. | ||
GITHUB_USERNAME=drud | ||
AUR_USERNAME=ddev-releaser | ||
AUR_REPO=$1 | ||
VERSION_NUMBER=$2 | ||
ARTIFACTS_DIR=$3 | ||
NO_V_VERSION=$(echo ${VERSION_NUMBER} | awk -F"-" '{ OFS="-"; sub(/^./, "", $1); printf $0; }') | ||
LINUX_HASH=$(cat $ARTIFACTS_DIR/ddev_linux.${VERSION_NUMBER}.tar.gz.sha256.txt | awk '{print $1;}' ) | ||
LINUX_TARBALL_URL=https://github.com/${GITHUB_USERNAME}/ddev/releases/download/${VERSION_NUMBER}/ddev_linux.${VERSION_NUMBER}.tar.gz | ||
if [ ! -z "${LINUX_TARBALL_OVERRIDE:-}" ]; then | ||
LINUX_TARBALL_URL=${LINUX_TARBALL_OVERRIDE} | ||
LINUX_HASH=$(curl -sSL "${LINUX_TARBALL_URL}.sha256.txt" | awk '{print $1}') | ||
fi | ||
|
||
EDGE_DESCRIPTION="" | ||
if [ ${AUR_REPO} = "ddev-edge-bin" ] ; then EDGE_DESCRIPTION=" (edge channel)"; fi | ||
|
||
# Add temporary private key provided by CircleCI context | ||
echo $AUR_SSH_PRIVATE_KEY | perl -p -e 's/<SPLIT>/\n/g' >/tmp/id_rsa_aur && chmod 600 /tmp/id_rsa_aur | ||
|
||
ssh-add /tmp/id_rsa_aur | ||
rm -rf ${AUR_REPO} | ||
git config --global core.sshCommand 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' | ||
git clone ssh://aur@aur.archlinux.org/${AUR_REPO}.git && pushd ${AUR_REPO} && touch .BUILDINFO && chmod -R ugo+w . | ||
|
||
_name="ddev" | ||
cat >PKGBUILD <<END | ||
pkgname="${AUR_REPO}" | ||
pkgver=$(echo ${VERSION_NUMBER} | tr '-' '_') | ||
pkgrel=1 | ||
pkgdesc='DDEV-Local: a local PHP development environment system${EDGE_DESCRIPTION}' | ||
arch=('x86_64') | ||
url='https://github.com/drud/ddev' | ||
license=('Apache') | ||
provides=("$_name") | ||
conflicts=("$_name") | ||
depends=('docker' 'docker-compose') | ||
optdepends=('bash-completion: subcommand completion support') | ||
source=("${LINUX_TARBALL_URL}") | ||
sha256sums=("${LINUX_HASH}") | ||
package() { | ||
install -D -m 0755 ddev "\$pkgdir/usr/bin/ddev" | ||
install -D -m 0755 ddev_bash_completion.sh "\$pkgdir/usr/share/bash-completion/completions/ddev" | ||
} | ||
END | ||
|
||
docker run --rm --mount type=bind,source=$(pwd),target=/tmp/ddev-bin --workdir=/tmp/ddev-bin drud/arch-aur-builder bash -c "makepkg --printsrcinfo > .SRCINFO && makepkg -s" | ||
|
||
git config user.email "randy+ddev-releaser@randyfay.com" | ||
git config user.name "ddev-releaser" | ||
|
||
git commit -am "AUR bump to ${VERSION_NUMBER}" | ||
|
||
git push | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
# Requires $DDEV_GITHUB_TOKEN, a token with public repo power | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if [ $# != 4 ]; then | ||
printf "Arguments: GITHUB_REPO (homebrew repo like drud/homebrew-ddev) \nPROJECT_NAME (like ddev) \nVERSION_NUMBER (like v1.14.2) \nARTIFACTS_DIR (like /home/circleci/artifacts)\n" && exit 101 | ||
fi | ||
|
||
# For testing, you can change GITHUB_USERNAME to, for example, rfay so releases can be tested | ||
# without bothering people. | ||
GITHUB_USERNAME=drud | ||
GITHUB_REPO=$1 | ||
PROJECT_NAME=$2 | ||
VERSION_NUMBER=$3 | ||
ARTIFACTS_DIR=$4 | ||
NO_V_VERSION=$(echo ${VERSION_NUMBER} | awk -F"-" '{ OFS="-"; sub(/^./, "", $1); printf $0; }') | ||
SOURCE_URL="https://github.com/drud/ddev/archive/${VERSION_NUMBER}.tar.gz" | ||
SOURCE_SHA=$(curl -sSL ${SOURCE_URL} | shasum -a 256 | awk '{print $1}') | ||
|
||
LINUX_BOTTLE_SHA=$(awk '{print $1}' <"${ARTIFACTS_DIR}/${PROJECT_NAME}-${NO_V_VERSION}.x86_64_linux.bottle.tar.gz.sha256.txt") | ||
MACOS_BOTTLE_SHA=$(awk '{print $1}' <${ARTIFACTS_DIR}/${PROJECT_NAME}-${NO_V_VERSION}.sierra.bottle.tar.gz.sha256.txt) | ||
|
||
|
||
TMPDIR=$(mktemp -d) | ||
cd ${TMPDIR} && git clone https://github.com/${GITHUB_REPO} && cd $(basename ${GITHUB_REPO}) | ||
|
||
cat >Formula/${PROJECT_NAME}.rb <<END | ||
class Ddev < Formula | ||
desc "ddev: a local development environment management system" | ||
homepage "https://ddev.readthedocs.io/en/stable/" | ||
url "${SOURCE_URL}" | ||
sha256 "${SOURCE_SHA}" | ||
# depends_on "docker" => :run | ||
# depends_on "docker-compose" => :run | ||
depends_on "docker" => :build | ||
depends_on "go" => :build | ||
depends_on "mkcert" => :run | ||
depends_on "nss" => :run | ||
bottle do | ||
root_url "https://github.com/drud/ddev/releases/download/${VERSION_NUMBER}/" | ||
cellar :any_skip_relocation | ||
sha256 "${LINUX_BOTTLE_SHA}" => :x86_64_linux | ||
sha256 "${MACOS_BOTTLE_SHA}" => :sierra | ||
end | ||
def install | ||
system "make", "VERSION=v#{version}", "COMMIT=v#{version}" | ||
system "mkdir", "-p", "#{bin}" | ||
if OS.mac? | ||
system "cp", ".gotmp/bin/darwin_amd64/ddev", "#{bin}/ddev" | ||
system ".gotmp/bin/darwin_amd64/ddev_gen_autocomplete" | ||
else | ||
system "cp", ".gotmp/bin/ddev", "#{bin}/ddev" | ||
system ".gotmp/bin/ddev_gen_autocomplete" | ||
end | ||
bash_completion.install ".gotmp/bin/ddev_bash_completion.sh" => "ddev" | ||
zsh_completion.install ".gotmp/bin/ddev_zsh_completion.sh" => "ddev" | ||
end | ||
test do | ||
system "#{bin}/ddev", "--version" | ||
end | ||
def caveats | ||
<<~EOS | ||
Make sure to do a 'mkcert -install' if you haven't done it before, it may require your sudo password. | ||
ddev requires docker and docker-compose. | ||
Docker installation instructions at https://ddev.readthedocs.io/en/stable/users/docker_installation/ | ||
EOS | ||
end | ||
end | ||
END | ||
|
||
git config user.email "randy@randyfay.com" | ||
git config user.name "rfay" | ||
git add -u | ||
git commit -m "Homebrew bump to ${VERSION_NUMBER}" | ||
|
||
git push -q https://${GITHUB_USERNAME}:${DDEV_GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters