Mean-field and shell-model approaches to deformation of unstable nuclei